User32SendMessageTimeout(HandleRef, WindowMessages, IntPtr, String, SendMessageTimeoutFlags, Int32, IntPtr) Method
Sends the specified message to a window.
Namespace: DevCase.Win32.NativeMethodsAssembly: 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, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)]
public static IntPtr SendMessageTimeout(
HandleRef hWnd,
WindowMessages msg,
IntPtr wParam,
string lParam,
SendMessageTimeoutFlags fuFlags,
int uTimeout,
out IntPtr refResult
)
<DllImportAttribute("User32.dll", CharSet := CharSet.Auto, BestFitMapping := false,
ThrowOnUnmappableChar := true, SetLastError := true>]
Public Shared Function SendMessageTimeout (
hWnd As HandleRef,
msg As WindowMessages,
wParam As IntPtr,
lParam As String,
fuFlags As SendMessageTimeoutFlags,
uTimeout As Integer,
<OutAttribute> ByRef refResult As IntPtr
) As IntPtr
Dim hWnd As HandleRef
Dim msg As WindowMessages
Dim wParam As IntPtr
Dim lParam As String
Dim fuFlags As SendMessageTimeoutFlags
Dim uTimeout As Integer
Dim refResult As IntPtr
Dim returnValue As IntPtr
returnValue = User32.SendMessageTimeout(hWnd,
msg, wParam, lParam, fuFlags, uTimeout,
refResult)
public:
[DllImportAttribute(L"User32.dll", CharSet = CharSet::Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)]
static IntPtr SendMessageTimeout(
HandleRef hWnd,
WindowMessages msg,
IntPtr wParam,
String^ lParam,
SendMessageTimeoutFlags fuFlags,
int uTimeout,
[OutAttribute] IntPtr% refResult
)
[<DllImportAttribute("User32.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)>]
static member SendMessageTimeout :
hWnd : HandleRef *
msg : WindowMessages *
wParam : IntPtr *
lParam : string *
fuFlags : SendMessageTimeoutFlags *
uTimeout : int *
refResult : IntPtr byref -> IntPtr
No code example is currently available or this language may not be supported.
- hWnd HandleRef
-
A handle to the window whose window procedure will receive the message.
If this parameter is HWND_Broadcast,
the message is sent to all top-level windows in the system, including disabled or invisible unowned windows.
The function does not return until each window has timed out.
Therefore, the total wait time can be up to the value of uTimeout multiplied by the number of top-level windows.
- msg WindowMessages
-
The message to be sent.
For lists of the system-provided messages, see System-Defined Messages:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms644927%28v=vs.85%29.aspx#system_defined
- wParam IntPtr
-
Any additional message-specific information.
- lParam String
-
Any additional message-specific information.
- fuFlags SendMessageTimeoutFlags
-
The behavior of this function.
- uTimeout Int32
-
The duration of the time-out period, in milliseconds.
If the message is a broadcast message, each window can use the full time-out period.
For example, if you specify a five second time-out period and there are three top-level windows that fail to process the message,
you could have up to a 15 second delay.
- refResult IntPtr
-
The result of the message processing.
The value of this parameter depends on the message that is specified.
IntPtr
If the function succeeds, the return value is nonzero.
If the function fails or times out, the return value is 0.
SendMessageTimeout(IntPtr, EditControlMessages, IntPtr, IntPtr, SendMessageTimeoutFlags, Int32, IntPtr) does not provide information about
individual windows timing out if
HWND_Broadcast is used.
To get extended error information, call
GetLastWin32Error.
If
GetLastWin32Error returns
ERROR_TIMEOUT, then the function timed out.