User32PeekMessage(NativeMessage, IntPtr, UInt32, UInt32, PeekMessageFlags) Method
Dispatches incoming sent messages, checks the thread message queue for a posted message, and retrieves the message (if any exist).
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)]
public static bool PeekMessage(
out NativeMessage refMsg,
[OptionalAttribute] IntPtr hWnd,
[OptionalAttribute] uint msgFilterMin,
[OptionalAttribute] uint msgFilterMax,
[OptionalAttribute] PeekMessageFlags flags
)
<DllImportAttribute("User32.dll", CharSet := CharSet.Auto>]
Public Shared Function PeekMessage (
<OutAttribute> ByRef refMsg As NativeMessage,
<OptionalAttribute> hWnd As IntPtr,
<OptionalAttribute> msgFilterMin As UInteger,
<OptionalAttribute> msgFilterMax As UInteger,
<OptionalAttribute> flags As PeekMessageFlags
) As Boolean
Dim refMsg As NativeMessage
Dim hWnd As IntPtr
Dim msgFilterMin As UInteger
Dim msgFilterMax As UInteger
Dim flags As PeekMessageFlags
Dim returnValue As Boolean
returnValue = User32.PeekMessage(refMsg,
hWnd, msgFilterMin, msgFilterMax,
flags)
public:
[DllImportAttribute(L"User32.dll", CharSet = CharSet::Auto)]
static bool PeekMessage(
[OutAttribute] NativeMessage% refMsg,
[OptionalAttribute] IntPtr hWnd,
[OptionalAttribute] unsigned int msgFilterMin,
[OptionalAttribute] unsigned int msgFilterMax,
[OptionalAttribute] PeekMessageFlags flags
)
[<DllImportAttribute("User32.dll", CharSet = CharSet.Auto)>]
static member PeekMessage :
refMsg : NativeMessage byref *
[<OptionalAttribute>] hWnd : IntPtr *
[<OptionalAttribute>] msgFilterMin : uint32 *
[<OptionalAttribute>] msgFilterMax : uint32 *
[<OptionalAttribute>] flags : PeekMessageFlags -> 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.
- hWnd IntPtr (Optional)
-
A handle to the window whose messages are to be retrieved. The window must belong to the current thread.
If hWnd is Zero,
PeekMessage(NativeMessage, IntPtr, UInt32, UInt32, PeekMessageFlags) 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, PeekMessage(NativeMessage, IntPtr, UInt32, UInt32, PeekMessageFlags) retrieves only messages on the
current thread's message queue whose Hwnd value is Zero,
that is, thread messages as posted by PostMessage (when the hWnd parameter is Zero)
or PostThreadMessage(Int32, WindowMessages, IntPtr, IntPtr).
- msgFilterMin UInt32 (Optional)
-
The value of the first message in the range of messages to be examined.
Use WM_KeyFirst to specify the first keyboard message
or WM_MouseFirst to specify the first mouse message.
If msgFilterMin and msgFilterMax are both zero,
PeekMessage(NativeMessage, IntPtr, UInt32, UInt32, PeekMessageFlags) returns all available messages (that is, no range filtering is performed).
- msgFilterMax UInt32 (Optional)
-
The value of the last message in the range of messages to be examined.
Use WM_KeyLast to specify the last keyboard message
or WM_MouseLast to specify the last mouse message.
If msgFilterMin and msgFilterMax are both zero,
PeekMessage(NativeMessage, IntPtr, UInt32, UInt32, PeekMessageFlags) returns all available messages (that is, no range filtering is performed).
- flags PeekMessageFlags (Optional)
-
Specifies how messages are to be handled.
Boolean
If the function succeeds, the return value is
.
If the function fails, the return value is
.
To get extended error information, call
GetLastWin32Error.