Click here to Skip to main content
15,901,505 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: how to get the notify which all of child process has exit? Pin
yqzq20-Jul-05 21:26
yqzq20-Jul-05 21:26 
GeneralRe: how to get the notify which all of child process has exit? Pin
Halawlaws21-Jul-05 1:35
Halawlaws21-Jul-05 1:35 
AnswerRe: how to get the notify which all of child process has exit? Pin
David Crow21-Jul-05 3:13
David Crow21-Jul-05 3:13 
GeneralWMI Programming in VC++ Pin
rajeevktripathi20-Jul-05 20:05
rajeevktripathi20-Jul-05 20:05 
GeneralRe: WMI Programming in VC++ Pin
Marc Soleda20-Jul-05 20:11
Marc Soleda20-Jul-05 20:11 
GeneralRe: WMI Programming in VC++ Pin
rajeevktripathi21-Jul-05 0:00
rajeevktripathi21-Jul-05 0:00 
GeneralRe: WMI Programming in VC++ Pin
David Crow21-Jul-05 3:18
David Crow21-Jul-05 3:18 
GeneralHWND from hProcess Pin
Jetli Jerry20-Jul-05 19:44
Jetli Jerry20-Jul-05 19:44 
Hi all,

I have dll(mfc) which displays dialog with list control with some file [with path] ( .doc,.msg, ... )

When user double clicks my code opens file in maximize mode useing ShellExecuteEx. It returns me HANDLE hProcess. All works fine.

But some file like msg file are not opening in MAXIMIZE state. After looking deep into that i conclude that it is handled by MS Outlook.( means if last msg file is opend in normal window (not maximized) then my code will not open msg file maximized!!.)

So what i want is HWND from hProcess. so that i can send message to that window for maximize!!!

I have searched a lot and also applied a code. but i think my dll handles this so i m not getting required results.


//////////////////////////////////// hProcess is returned by ShellExecuteEx
WaitForInputIdle(hProcess,1000);


FILETIME lpCreationTime, lpCreationTime2;
FILETIME d1,d2,d3;
DWORD dwProcessId;
HANDLE hProc;

GetProcessTimes( hProcess, &lpCreationTime, &d1, &d2, &d3 );

HWND hTemp = ::FindWindow(NULL,NULL);

while ( hTemp != NULL )
{
if ( ::GetParent(hTemp) == NULL )
{
::GetWindowThreadProcessId(hTemp,&dwProcessId);

hProc = OpenProcess(PROCESS_QUERY_INFORMATION, 0, dwProcessId);

GetProcessTimes( hProc, &lpCreationTime2, &d1, &d2, &d3 );

CloseHandle(hProc);


if ( lpCreationTime.dwHighDateTime == lpCreationTime2.dwHighDateTime &&
lpCreationTime.dwLowDateTime == lpCreationTime2.dwLowDateTime )
{
//("Sending Message"); // Never came here
::PostMessage(hTemp,WM_SYSCOMMAND,SC_MAXIMIZE,0);
break;
}
}

hTemp = ::GetWindow(hTemp, GW_HWNDNEXT) ;
//"looping");

}

// i have also tried with EnumWindows and its proc.

Can anyone help me in getting solved my problem.


Thank in advance.

Regards






Jetli
Constant Thing In World Is Change.
Generalversion numbering Pin
paulb20-Jul-05 18:57
paulb20-Jul-05 18:57 
GeneralRe: version numbering Pin
Christian Graus20-Jul-05 18:59
protectorChristian Graus20-Jul-05 18:59 
GeneralRe: version numbering Pin
Blake Miller21-Jul-05 5:04
Blake Miller21-Jul-05 5:04 
GeneralRe: version numbering Pin
paulb21-Jul-05 15:08
paulb21-Jul-05 15:08 
QuestionGet Client area dimensions in mm??? Pin
wasife20-Jul-05 18:48
wasife20-Jul-05 18:48 
AnswerRe: Get Client area dimensions in mm??? Pin
Christian Graus20-Jul-05 19:00
protectorChristian Graus20-Jul-05 19:00 
GeneralExpert Query on timing, threads, networking plz.... :S Pin
kevingpo20-Jul-05 18:43
kevingpo20-Jul-05 18:43 
GeneralRe: Expert Query on timing, threads, networking plz.... :S Pin
Marc Soleda20-Jul-05 20:00
Marc Soleda20-Jul-05 20:00 
Generalneed help in these que:( Pin
sunnymoe20-Jul-05 17:36
sunnymoe20-Jul-05 17:36 
GeneralRe: need help in these que:( Pin
Christian Graus20-Jul-05 17:43
protectorChristian Graus20-Jul-05 17:43 
GeneralRe: need help in these que:( Pin
sunnymoe20-Jul-05 20:12
sunnymoe20-Jul-05 20:12 
GeneralRe: need help in these que:( Pin
Cedric Moonen20-Jul-05 21:34
Cedric Moonen20-Jul-05 21:34 
GeneralRe: need help in these que:( Pin
Christian Graus21-Jul-05 13:28
protectorChristian Graus21-Jul-05 13:28 
GeneralRe: need help in these que:( Pin
Bob Stanneveld20-Jul-05 22:05
Bob Stanneveld20-Jul-05 22:05 
GeneralRe: need help in these que:( Pin
S Douglas21-Jul-05 1:25
professionalS Douglas21-Jul-05 1:25 
GeneralRe: need help in these que:( Pin
Bob Stanneveld21-Jul-05 2:46
Bob Stanneveld21-Jul-05 2:46 
GeneralRe: need help in these que:( Pin
S Douglas21-Jul-05 3:12
professionalS Douglas21-Jul-05 3:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.