4

Delphiでウィンドウハンドルの画面相対位置を見つけるにはどうすればよいですか? (X,Y)

4

3 に答える 3

6

FindWindow() を使用してウィンドウのハンドルを取得し、GetWindowRect() を使用して座標を取得します。

var 
 NotepadHandle: hwnd;
 WindowRect: TRect;
begin
 NotepadHandle := FindWindow(nil, 'Untitled - Notepad');

 if NotepadHandle <> 0 then
   GetWindowRect(NotepadHandle, WindowRect)

end;
于 2011-04-25T13:32:54.790 に答える
5

GetWindowRect関数を使ってみる

var
  lpRect: TRect;
begin
   GetWindowRect(Edit1.Handle,lpRect);  
   ShowMessage(Format('%d,%d',[lpRect.Left,lpRect.Top]));
end;
于 2011-04-25T13:28:05.810 に答える