The WaitForInputIdle function waits until the given process is waiting for user input with no input pending, or until the time-out interval has elapsed.
The WaitForInputIdle function only works with GUI applications. If a console application calls the function, it returns immediately, with no wait.
DWORD WaitForInputIdle(
HANDLE hProcess, |
// handle to process |
DWORD dwMilliseconds |
// time-out interval in milliseconds |
); |
The following table shows the possible return values:
Value |
Meaning |
0 |
The wait was satisfied successfully. |
WAIT_TIMEOUT |
The wait was terminated because the time-out interval elapsed. |
0xFFFFFFFF |
An error occurred. To get extended error information, use the GetLastError function. |
The WaitForInputIdle function enables a thread to suspend its execution until a 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.
file: /Techref/os/win/api/win32/func/src/f91_1.htm, 3KB, , updated: 2000/4/7 11:19, local time: 2024/11/24 13:21,
3.16.69.243:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://sxlist.com/TECHREF/os/win/api/win32/func/src/f91_1.htm"> WaitForInputIdle</A> |
Did you find what you needed? |
Welcome to sxlist.com!sales, advertizing, & kind contributors just like you! Please don't rip/copy (here's why Copies of the site on CD are available at minimal cost. |
Welcome to sxlist.com! |
.