User32WaitForInputIdle Method

Waits until the specified process has finished processing its initial input and is waiting for user input with no input pending, or until the time-out interval has elapsed.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("User32.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static uint WaitForInputIdle(
	IntPtr hProcess,
	uint milliseconds
)

Parameters

hProcess  IntPtr
A handle to the process.

If this process is a console application or does not have a message queue, WaitForInputIdle(IntPtr, UInt32) returns immediately.

milliseconds  UInt32
The time-out interval, in milliseconds.

If milliseconds is INFINITE, the function does not return until the process is idle.

Return Value

UInt32
The following table shows the possible return values for this function:

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, call GetLastWin32Error.

Remarks

See Also