![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
Проблема с Хендлом окна.
Fus1on © (2006-12-27 23:27:00)Мне нужно запустить дочернее окно через ShellExecute и изьять его хендл, что бы в другой раз при вызове функции - окно просто максимизировалось.
Пробовал так:
procedure TForm1.ShellChangeNotifier1Change;
begin
if (FindWindow ('ExploreWClass', nil) = myHwnd) then
begin
ShowWindow(myHwnd, SW_MAXIMIZE);
end
else
begin
ShellExecute(h, 'explore', fpath, nil, nil, SW_SHOWMAXIMIZED);
myHwnd := GetActiveWindow;
end;
end;
но, myHwnd := GetActiveWindow; - не помогает, т.к. при любых параметрах оно почему - то всеравно не активное, да и возможно условие не правильно. В общем прошу помощи специалистов :)
Fus1on (2006-12-30 19:39:00) [1]thx
trubin (2006-12-28 12:09:00) [2]
> myHwnd := GetActiveWindow;
GetForegroundWindow
Правильный Вася (2006-12-28 11:24:00) [3]изьять его хендл
какой ужас! бедное окно! как оно будет жить без рукоятки?
BiN (2006-12-28 09:52:00) [4]The WaitForInputIdlefunction enables a thread to suspend its execution until the specified process has finished its initialization and is waiting for user input with no input pending. This can be useful for synchronizing a parent process and a newly created child process. When a parent process creates a child process, the CreateProcessfunction returns without waiting for the child process to finish its initialization. Before trying to communicate with the child process, the parent process can use WaitForInputIdleto determine when the child's initialization has been completed. For example, the parent process should use WaitForInputIdle before trying to find a window associated with the child process.
(с) msdn