1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
MyCursor := TIcon.Create;
try
if CursorInfo.hCursor <> 0 then
begin
MyCursor.Handle := CursorInfo.hCursor;
GetIconInfo(CursorInfo.hCursor, IconInfo);
point.X:=CursorInfo.ptScreenPos.X - IconInfo.xHotspot;
point.Y:=CursorInfo.ptScreenPos.Y - IconInfo.yHotspot;
end;
HBureau:=GetDesktopWindow;
dc:=GetWindowDC(HBureau);
BitBlt(bmp.canvas.Handle,0,0,w,h,dc,0,0,SRCCOPY);
bmp.canvas.Draw(point.X,point.Y,MyCursor);
finally
MyCursor.ReleaseHandle;
MyCursor.Free;
ReleaseDC(HBureau,DC);
end; |
Partager