2011-04-25 79 views

回答

2

使用FindWindow函數()來檢索窗口的)把手,和GetWindowRect(獲取座標:

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

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

end; 
4

嘗試使用GetWindowRect功能

var 
    lpRect: TRect; 
begin 
    GetWindowRect(Edit1.Handle,lpRect); 
    ShowMessage(Format('%d,%d',[lpRect.Left,lpRect.Top])); 
end;