AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Win32/Win64 API (native code) Delphi Titelloses Fenster eines Fremdprogrammes positionieren?
Thema durchsuchen
Ansicht
Themen-Optionen

Titelloses Fenster eines Fremdprogrammes positionieren?

Ein Thema von PeterPanino · begonnen am 8. Mär 2009 · letzter Beitrag vom 9. Mär 2009
 
PeterPanino

Registriert seit: 4. Sep 2004
1.451 Beiträge
 
Delphi 10.4 Sydney
 
#5

Re: Titelloses Fenster eines Fremdprogrammes positionieren?

  Alt 8. Mär 2009, 23:12
Hallo, ich habe es jetzt geschafft, die PID und das Fensterhandle vom Programmnamen zu bekommen:

Delphi-Quellcode:
program RepositionWindowFromExeName;

{$APPTYPE CONSOLE}

uses
  Dialogs, // debug
  JclSysInfo,
  SysUtils, Windows;

var
  APID: Cardinal;
  AHandle: THandle;
  rc: TRect;

begin
  try
    APID := GetPidFromProcessName('QGet.exe'); // 11424
    if APID <> INVALID_HANDLE_VALUE then
    begin
      AHandle := GetMainAppWndFromPid(APID);
      MessageDlg(GetWindowCaption(AHandle), mtInformation, [mbOK], 0); // leer!
      GetWindowRect(AHandle, rc);
      MessageDlg(IntToStr(rc.Left) + #13#10 +
                 IntToStr(rc.Top) + #13#10 +
                 IntToStr(rc.Right) + #13#10 +
                 IntToStr(rc.Bottom) + #13#10
                 , mtInformation, [mbOK], 0);
    end;
  except
    on E:Exception do
      Writeln(E.Classname, ': ', E.Message);
  end;
end.
GetWindowCaption:
http://img255.imageshack.us/img255/7...dowcaption.gif

GetWindowRect:
http://img24.imageshack.us/img24/5908/getwindowrect.gif

Wie man sieht, funktioniert das Erfassen der Fensterkoordinaten nicht. Könnte jemand weiterhelfen?
  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 20:41 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