![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
Как получить handle активного окна [D6, Win2k]
Turalyon © (2002-02-06 13:41:00)Помогите пожалуйста.
В Help - е нашел функцию GetActiveWindow() но она возвращает handle активного окна в thread... а мне надо первое окно в Z-order-е, может я тупой, но у меня не получается. Помогите пожалуйста...
savva (2002-02-06 14:49:00) [1]не за что
Turalyon (2002-02-06 14:42:00) [2]Ок. Спасиб, вроде запускается...
savva (2002-02-06 14:30:00) [3]извини, это я по привычке на С..
или
GetTopWindow(nil);
GetTopWindow(0);
Turalyon (2002-02-06 14:28:00) [4]Ошибку выдает "Invalid variant type conversion"...
procedure TForm1.Button1Click(Sender: TObject);
var mh : HWnd;
begin
mh := GetTopWindow(NULL); < Здесь гад :(
end;
savva (2002-02-06 14:03:00) [5]то есть тебе надо GetTopWindow(NULL);
savva (2002-02-06 13:54:00) [6]
GetTopWindow
The GetTopWindow function examines the Z order of the child windows associated with the specified parent window and retrieves a handle to the child window at the top of the Z order.
HWND GetTopWindow(
HWND hWnd // handle to parent window
);
Parameters
hWnd
[in] Handle to the parent window whose child windows are to be examined. If this parameter is NULL, the function returns a handle to the window at the top of the Z order.
Return Values
If the function succeeds, the return value is a handle to the child window at the top of the Z order. If the specified window has no child windows, the return value is NULL. To get extended error information, use the GetLastError function.