Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "WinAPI";
Текущий архив: 2002.04.08;
Скачать: [xml.tar.bz2];

Вниз

Как получить handle активного окна   Найти похожие ветки 

 
Turalyon   (2002-02-06 13:41) [0]

Помогите пожалуйста.
В Help - е нашел функцию GetActiveWindow() но она возвращает handle активного окна в thread... а мне надо первое окно в Z-order-е, может я тупой, но у меня не получается. Помогите пожалуйста...


 
savva   (2002-02-06 13:54) [1]


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.



 
savva   (2002-02-06 14:03) [2]

то есть тебе надо GetTopWindow(NULL);


 
Turalyon   (2002-02-06 14:28) [3]

Ошибку выдает "Invalid variant type conversion"...

procedure TForm1.Button1Click(Sender: TObject);
var mh : HWnd;
begin
mh := GetTopWindow(NULL); < Здесь гад :(
end;


 
savva   (2002-02-06 14:30) [4]

извини, это я по привычке на С..

GetTopWindow(nil);
или

GetTopWindow(0);


 
Turalyon   (2002-02-06 14:42) [5]

Ок. Спасиб, вроде запускается...


 
savva   (2002-02-06 14:49) [6]

не за что



Страницы: 1 вся ветка

Форум: "WinAPI";
Текущий архив: 2002.04.08;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.45 MB
Время: 0.005 c
1-22691
Grishin
2002-03-26 13:22
2002.04.08
В чем проблема?


4-22876
JAndrey
2002-01-31 01:15
2002.04.08
Как заблокировать клавиатуру и мышь?


14-22808
Дмитрий_Ч
2002-02-26 17:29
2002.04.08
SOS!!!


1-22677
snoup
2002-03-26 07:49
2002.04.08
Как сделать так, что бы например по истечению 10 сек. происходило кокоето событие (пример имеется ввиде TTimer)


7-22865
MystiX
2002-01-08 12:25
2002.04.08
CD и Delphi





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский