Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2007.01.21;
Скачать: CL | DM;

Вниз

Проблема с Хендлом окна.   Найти похожие ветки 

 
Fus1on   (2006-12-27 23:27) [0]

Мне нужно запустить дочернее окно через 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; - не помогает, т.к. при любых параметрах оно почему - то всеравно не активное, да и возможно условие не правильно. В общем прошу помощи специалистов :)


 
BiN ©   (2006-12-28 09:52) [1]

The WaitForInputIdle function 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 CreateProcess function returns without waiting for the child process to finish its initialization. Before trying to communicate with the child process, the parent process can use WaitForInputIdle to 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


 
Правильный Вася   (2006-12-28 11:24) [2]

изьять его хендл
какой ужас! бедное окно! как оно будет жить без рукоятки?


 
trubin ©   (2006-12-28 12:09) [3]


> myHwnd := GetActiveWindow;

GetForegroundWindow


 
Fus1on   (2006-12-30 19:39) [4]

thx



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

Текущий архив: 2007.01.21;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.066 c
2-1167914333
mfender
2007-01-04 15:38
2007.01.21
Свойство в Object Inspector е и выбор файла DesignTime


4-1157840763
Дед Маздай
2006-09-10 02:26
2007.01.21
В чём разница WM_RBUTTONUP и WM_NCRBUTTONUP


2-1167689615
Footballer
2007-01-02 01:13
2007.01.21
TMemo и его Lines


2-1167831746
saili
2007-01-03 16:42
2007.01.21
синхронизация таймера с частотой обновления экрана монитора


1-1164377393
DelphiLexx
2006-11-24 17:09
2007.01.21
DBGridEh сделать Footer не внизу а после последней строкой