Registriert seit: 31. Okt 2003
1.120 Beiträge
Delphi 7 Personal
|
Re: Animirten Cursor in exe einbinden?
29. Nov 2003, 12:59
Delphi-Quellcode:
function LoadAniCursor(hInst : Cardinal; lpID : PChar; lpType : PChar = nil) : HCURSOR;
var
hRes : HRSRC;
dwSize : DWORD;
hGlob : HGLOBAL;
pBytes : PBYTE;
begin
If not Assigned(lpType) then
lpType := PChar('ANICURSOR');
If (StrToIntDef(StrPas(lpID), 0) <> 0) then
hRes := FindResource(hInst, PChar('#' + StrPas(lpID)), lpType)
else
hRes := FindResource(hInst, lpID, lpType);
dwSize := SizeofResource(hInst, hRes);
hGlob := LoadResource(hInst, hRes);
If (hGlob <> 0) then
begin
pBytes := PBYTE(LockResource(hGlob));
result := HCURSOR(CreateIconFromResource(pBytes, dwSize, FALSE, $00030000));
end
else
result := 0;
end;
|
|
Zitat
|