AGB  ·  Datenschutz  ·  Impressum  







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

Finde Window

Ein Thema von ljmarkus · begonnen am 16. Apr 2007 · letzter Beitrag vom 16. Apr 2007
 
ljmarkus

Registriert seit: 14. Apr 2007
Ort: Göttingen
46 Beiträge
 
Delphi 7 Personal
 
#3

Re: Finde Window

  Alt 16. Apr 2007, 20:53
Hallo.

Ich habe das jetzt so gelöst:

Delphi-Quellcode:
procedure TForm1.Timer1Timer(Sender: TObject);
var DC : HDC;
    AColor : Array[1..4] of Byte;
    TheWindowHandle: THandle;
    aRect: TRect;
    ergebnisX, ergebnisY : integer;
begin

  DC:=CreateDC('DISPLAY',NIL,NIL,NIL);

  DWord(AColor) := GetPixel(dc,Mouse.CursorPos.X,Mouse.CursorPos.Y);
  DeleteDC(dc);

  Label1.Caption := 'R: ' + IntToStr(AColor[1]) + '; ' +
                    'G: ' + IntToStr(AColor[2]) + '; ' +
                    'B: ' + IntToStr(AColor[3]) + '; ' +
                    'Hex: ' + IntToHex(DWord(AColor),6);

  Label4.Caption := 'TColor: $'+IntToHex(DWord(AColor),8);

  Label2.Caption := 'X: ' + IntToStr(Mouse.CursorPos.X);
  Label3.Caption := 'Y: ' + IntToStr(Mouse.CursorPos.Y);



  TheWindowHandle := FindWindow('xxxxx','xxxxx');
  GetWindowRect(TheWindowHandle, ARect);
  label5.Caption := 'X: '+ IntToStr(aRect.Left);
  label6.Caption := 'Y: '+ IntToStr(aRect.Top);

  ergebnisX := Mouse.CursorPos.X - aRect.Left;
  label7.Caption := 'X: ' + IntToStr(ergebnisX);

  ergebnisY := Mouse.CursorPos.Y - aRect.Top;
  label8.Caption := 'Y: ' + IntToStr(ergebnisY);

end;
lg, markus
  Mit Zitat antworten Zitat
 


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 05:06 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-2025 by Thomas Breitkreuz