读书人

WaitForIdle()这个函数的用法,该如何

发布时间: 2012-08-01 17:53:40 作者: rapoo

WaitForIdle()这个函数的用法
如题,麻烦具体一点!!谢谢!!

[解决办法]
去查msdn啊
[解决办法]
WaitForInputIdle?
[解决办法]
这个函数是谁写的...
[解决办法]
MSDN里有WaitForInputIdle
但没有WaitForIdle

WaitForInputIdle

The WaitForInputIdle function waits until the specified process is waiting for user input with no input pending, or until the time-out interval has elapsed.


DWORD WaitForInputIdle(
HANDLE hProcess,
DWORD dwMilliseconds
);

Parameters
hProcess
[in] Handle to the process. If this process is a console application or does not have a message queue, WaitForInputIdle returns immediately.
dwMilliseconds
[in] Time-out interval, in milliseconds. If dwMilliseconds is INFINITE, the function does not return until the process is idle.
Return Values
The following table shows the possible return values for this function.

Return code/value Description

0 The wait was satisfied successfully.
WAIT_TIMEOUT The wait was terminated because the time-out interval elapsed.
WAIT_FAILED An error occurred. To get extended error information, use the GetLastError function.

Remarks
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.

The WaitForInputIdle function can be used at any time, not just during application startup.

读书人网 >C++

热点推荐