AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Win32/Win64 API (native code) Delphi Fensterposition/-größe einer fremden Anwendung
Thema durchsuchen
Ansicht
Themen-Optionen

Fensterposition/-größe einer fremden Anwendung

Offene Frage von "MuTzE"
Ein Thema von MuTzE · begonnen am 20. Okt 2006 · letzter Beitrag vom 20. Okt 2006
 
Benutzerbild von MuTzE
MuTzE

Registriert seit: 24. Sep 2003
59 Beiträge
 
#7

Re: Fensterposition/-größe einer fremden Anwendung

  Alt 20. Okt 2006, 15:41
Hm wenn ich es so mache gehts bei mir auch. Komisch.


Ich habe diesen Code benutzt um an das Handle des Fensters zu kommen:


Delphi-Quellcode:
function EnumWindowsProc(hWindow: hWnd; lParam: LongInt): boolean; stdcall;
var lpBuffer: PChar;
    WindowCaptionFound: boolean;
    ClassNameFound: boolean;
begin
  GetMem(lpBuffer, 255);
  result:=true;
  WindowCaptionFound:=false;
  ClassNameFound:=false;
  try
    if GetWindowText(hWindow, lpBuffer,255)>0 then
      if Pos(PFindWindowStruct(lParam).Caption, StrPas(lpBuffer))>0
      then WindowCaptionFound:=true;
    if PFindWindowStruct(lParam).ClassName='then
      ClassNameFound:=true
      else if GetClassName(hWindow, lpBuffer, 255)>0 then
        if Pos(PFindWindowStruct(lParam).ClassName, StrPas(lpBuffer))>0
        then ClassNameFound:=true;
    if (WindowCaptionFound and ClassNameFound) then begin
      PFindWindowStruct(lParam).WindowHandle:=hWindow;
      result:=false;
    end;
  finally
    FreeMem(lpBuffer, sizeof(lpBuffer^));
  end;
end;

function FindAWindow(WinCaption: string; WinClassName: string): THandle;
var WindowInfo: TFindWindowStruct;
begin
  with WindowInfo do begin
    caption := WinCaption;
    className := WinClassName;
    WindowHandle := 0;
    EnumWindows(@EnumWindowsProc, LongInt(@WindowInfo));
    result := WindowHandle;
  end;
end;

Und damit gehts irgendwie net.

Hat jemand ne andere Lösung um an das Fensterhandle zu kommen?
A8N32-SLI Deluxe | AMD 64 X2 3800+ @ 2700 MHz | Corsair TWINX1024-3200XL @ 270 MHz | ASUS EN7800GTX @ 490/1300 | Samsung SP2504C | Plextor PX-712SA | Logitech UltraX Media Keyboard | Razer Copperhead Chaos Green | Razer eXactMat | Sennheiser PC150
  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:50 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