Click here to Skip to main content
15,916,293 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: material1 Pin
GDavy21-Jul-05 0:21
GDavy21-Jul-05 0:21 
GeneralRe: material1 Pin
Blake Miller21-Jul-05 4:55
Blake Miller21-Jul-05 4:55 
QuestionHow can I use exported function from EXE, not DLL Pin
plowstar20-Jul-05 21:31
plowstar20-Jul-05 21:31 
AnswerRe: How can I use exported function from EXE, not DLL Pin
Themis20-Jul-05 21:45
Themis20-Jul-05 21:45 
AnswerRe: How can I use exported function from EXE, not DLL Pin
Alexander M.,21-Jul-05 1:27
Alexander M.,21-Jul-05 1:27 
QuestionWhen does a window appear? Pin
Themis20-Jul-05 21:31
Themis20-Jul-05 21:31 
AnswerRe: When does a window appear? Pin
Cool Ju20-Jul-05 22:46
Cool Ju20-Jul-05 22:46 
AnswerRe: When does a window appear? Pin
Bob Stanneveld21-Jul-05 2:58
Bob Stanneveld21-Jul-05 2:58 
GeneralRe: When does a window appear? Pin
Themis21-Jul-05 5:01
Themis21-Jul-05 5:01 
AnswerRe: When does a window appear? Pin
John R. Shaw21-Jul-05 7:01
John R. Shaw21-Jul-05 7:01 
QuestionHow to send data to DDEML Server and get it processed. Pin
shyam sharma20-Jul-05 20:20
shyam sharma20-Jul-05 20:20 
Questionhow to get the notify which all of child process has exit? Pin
yqzq20-Jul-05 20:10
yqzq20-Jul-05 20:10 
AnswerRe: how to get the notify which all of child process has exit? Pin
Halawlaws20-Jul-05 20:47
Halawlaws20-Jul-05 20:47 
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 

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.