User32GetMessage(NativeMessage, HandleRef, UInt32, UInt32) Method
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, SetLastError = true)]
public static bool GetMessage(
out NativeMessage refMsg,
[OptionalAttribute] HandleRef hWnd,
[OptionalAttribute] uint msgFilterMin,
[OptionalAttribute] uint msgFilterMax
)
<DllImportAttribute("User32.dll", CharSet := CharSet.Auto, SetLastError := true>]
Public Shared Function GetMessage (
<OutAttribute> ByRef refMsg As NativeMessage,
<OptionalAttribute> hWnd As HandleRef,
<OptionalAttribute> msgFilterMin As UInteger,
<OptionalAttribute> msgFilterMax As UInteger
) As Boolean
Dim refMsg As NativeMessage
Dim hWnd As HandleRef
Dim msgFilterMin As UInteger
Dim msgFilterMax As UInteger
Dim returnValue As Boolean
returnValue = User32.GetMessage(refMsg,
hWnd, msgFilterMin, msgFilterMax)
public:
[DllImportAttribute(L"User32.dll", CharSet = CharSet::Auto, SetLastError = true)]
static bool GetMessage(
[OutAttribute] NativeMessage% refMsg,
[OptionalAttribute] HandleRef hWnd,
[OptionalAttribute] unsigned int msgFilterMin,
[OptionalAttribute] unsigned int msgFilterMax
)
[<DllImportAttribute("User32.dll", CharSet = CharSet.Auto, SetLastError = true)>]
static member GetMessage :
refMsg : NativeMessage byref *
[<OptionalAttribute>] hWnd : HandleRef *
[<OptionalAttribute>] msgFilterMin : uint32 *
[<OptionalAttribute>] msgFilterMax : uint32 -> bool
No code example is currently available or this language may not be supported.
- refMsg NativeMessage
-
A pointer to a structure that receives message information from the thread's message queue.
- hWnd HandleRef (Optional)
-
A handle to the window whose messages are to be retrieved. The window must belong to the current thread.
If hWnd is Zero, GetMessage(NativeMessage, IntPtr, UInt32, UInt32) retrieves messages for
any window that belongs to the current thread, and any messages on the current thread's message queue whose
Hwnd value is Zero.
Therefore if hWnd is Zero, both window messages and thread messages are processed.
If hWnd is -1, GetMessage(NativeMessage, IntPtr, UInt32, UInt32) retrieves only messages on the
current thread's message queue whose Hwnd value is Zero,
that is, thread messages as posted by PostMessage(IntPtr, EditControlMessages, IntPtr, IntPtr) (when the hWnd parameter is Zero)
or PostThreadMessage(Int32, WindowMessages, IntPtr, IntPtr).
- msgFilterMin UInt32 (Optional)
-
The integer value of the lowest message value to be retrieved.
Use WM_KeyFirst to specify the first keyboard message
or WM_MouseFirst to specify the first mouse message.
Use WM_Input here and in msgFilterMax to
specify only the WM_Input messages.
If msgFilterMin and msgFilterMax are both zero,
GetMessage(NativeMessage, IntPtr, UInt32, UInt32) returns all available messages (that is, no range filtering is performed).
- msgFilterMax UInt32 (Optional)
-
The integer value of the highest message value to be retrieved.
Use WM_KeyLast to specify the last keyboard message
or WM_MouseLast to specify the last mouse message.
Use WM_Input here and in msgFilterMin to
specify only the WM_Input messages.
If msgFilterMin and msgFilterMax are both zero,
GetMessage(NativeMessage, IntPtr, UInt32, UInt32) returns all available messages (that is, no range filtering is performed).
Boolean
If the function retrieves a message other than
WM_Quit, the return value is
.
If the function retrieves the
WM_Quit message, the return value is
.
If there is an error, the return value is -1.
For example, the function fails if
hWnd is an invalid window handle or
refMsg is an invalid pointer.
To get extended error information, call
GetLastWin32Error.