![]() |
Maushöhe und Mausbreite abfragen...
Hallo,
ich habe ein Programm, dass Anweisungen immer von der Mausposition abhängig ausfürht. Ich kenne Mouse.CursorPos.X und so schon. Aber wie kann ich die Höhe und Breite des Cursors abfragen? Dank im voraus! Johannes013 |
Re: Maushöhe und Mausbreite abfragen...
The hot spot of a cursor is the point to which Windows refers in tracking the cursor's position. By default, the hot spot is set to the upper-left corner of the cursor (coordinates 0,0). The Hotspot property in the Properties window shows the hot spot coordinates.
![]()
Delphi-Quellcode:
procedure TForm1.DrawCursor(bm : TBitmap; OffsetX, OffsetY : integer);
var cursorPos : TPoint; CursorInf: TCursorInfo; Icon: TIcon; IconInf: TIconInfo; begin Icon := TIcon.Create; try CursorInf.cbSize := SizeOf(TCursorInfo); if GetCursorInfo(CursorInf) then if CursorInf.Flags = CURSOR_SHOWING then begin Icon.Handle := CursorInf.hCursor; if GetIconInfo(Icon.Handle, IconInf) then DrawIcon( bm.Canvas.Handle, CursorInf.ptScreenPos.x - (IconInf.xHotspot + OffSetX), CursorInf.ptScreenPos.y - (IconInf.yHotspot+ OffSetY), Icon.Handle); end; finally Icon.Free; end; end; |
Re: Maushöhe und Mausbreite abfragen...
Danke, jetzt hab ichs :D
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:43 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz