怎么把ShellExecute(Ex)创建的程序的窗口变成模态窗口

如何把ShellExecute(Ex)创建的程序的窗口变成模态窗口?
如何把ShellExecute(Ex)创建的程序的窗口变成模态窗口?
也就是要等新窗口关闭才能继续操作,用::WaitForSingleObject
有一个严重缺点,原窗口不能刷新,我想要的就是类似正常的模态窗口

------解决方案--------------------
用::WaitForSingleObject
有一个严重缺点,原窗口不能刷新,我想要的就是类似正常的模态窗口
=====================================================================
用MsgWaitForMultipleObjects,给你段代码参考一下
int MessageLoop (
HANDLE* lphObjects, // handles that need to be waited on
int cObjects // number of handles to wait on
)
{
// The message loop lasts until we get a WM_QUIT message,
// upon which we shall return from the function.
while (TRUE)
{
// block-local variable
DWORD result ;
MSG msg ;

// Read all of the messages in this next loop,
// removing each message as we read it.
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
// If it is a quit message, exit.
if (msg.message == WM_QUIT)
return 1;
// Otherwise, dispatch the message.
DispatchMessage(&msg);
} // End of PeekMessage while loop.

// Wait for any message sent or posted to this queue
// or for one of the passed handles be set to signaled.
result = MsgWaitForMultipleObjects(cObjects, lphObjects,
FALSE, INFINITE, QS_ALLINPUT);

// The result tells us the type of event we have.
if (result == (WAIT_OBJECT_0 + cObjects))
{
// New messages have arrived.
// Continue to the top of the always while loop to
// dispatch them and resume waiting.
continue;
}
else
{
// One of the handles became signaled.
DoStuff (result - WAIT_OBJECT_0) ;
} // End of else clause.
} // End of the always while loop.
} // End of function.

------解决方案--------------------
MsgWaitForMultipleObjects(...QS_PAINT...);