AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Maushöhe und Mausbreite abfragen...

Ein Thema von Johannes013 · begonnen am 18. Sep 2009 · letzter Beitrag vom 19. Sep 2009
Antwort Antwort
Johannes013

Registriert seit: 2. Jun 2009
179 Beiträge
 
Delphi 5 Standard
 
#1

Maushöhe und Mausbreite abfragen...

  Alt 18. Sep 2009, 20:48
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
Johannes
Der folgende Satz ist richtig.
Der vorherige Satz ist falsch.
  Mit Zitat antworten Zitat
hathor
(Gast)

n/a Beiträge
 
#2

Re: Maushöhe und Mausbreite abfragen...

  Alt 18. Sep 2009, 21:05
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.

http://msdn.microsoft.com/en-us/libr...8VS.80%29.aspx

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;
  Mit Zitat antworten Zitat
Johannes013

Registriert seit: 2. Jun 2009
179 Beiträge
 
Delphi 5 Standard
 
#3

Re: Maushöhe und Mausbreite abfragen...

  Alt 19. Sep 2009, 13:00
Danke, jetzt hab ichs
Johannes
Der folgende Satz ist richtig.
Der vorherige Satz ist falsch.
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 02:52 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz