User32PostThreadMessage(Int32, Int32, IntPtr, IntPtr) Method
Places (posts) a message to the message queue of the specified thread.
It returns without waiting for the thread to process the message.
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", SetLastError = true)]
public static bool PostThreadMessage(
int threadId,
int message,
IntPtr wparam,
IntPtr lparam
)
<DllImportAttribute("User32.dll", SetLastError := true>]
Public Shared Function PostThreadMessage (
threadId As Integer,
message As Integer,
wparam As IntPtr,
lparam As IntPtr
) As Boolean
Dim threadId As Integer
Dim message As Integer
Dim wparam As IntPtr
Dim lparam As IntPtr
Dim returnValue As Boolean
returnValue = User32.PostThreadMessage(threadId,
message, wparam, lparam)
public:
[DllImportAttribute(L"User32.dll", SetLastError = true)]
static bool PostThreadMessage(
int threadId,
int message,
IntPtr wparam,
IntPtr lparam
)
[<DllImportAttribute("User32.dll", SetLastError = true)>]
static member PostThreadMessage :
threadId : int *
message : int *
wparam : IntPtr *
lparam : IntPtr -> bool
No code example is currently available or this language may not be supported.
- threadId Int32
-
The identifier of the thread to which the message is to be posted.
The function fails if the specified thread does not have a message queue.
The system creates a thread's message queue when the thread makes its first call to one of the
User or GDI functions.
Message posting is subject to UIPI.
The thread of a process can post messages only to posted-message queues of
threads in processes of lesser or equal integrity level.
This thread must have the SE_TCB_NAME privilege to post a
message to a thread that belongs to a process with the same locally unique identifier (LUID)
but is in a different desktop. Otherwise, the function fails and returns ERROR_INVALID_THREAD_ID.
- message Int32
-
The type of message to be posted.
- wparam IntPtr
-
Specifies additional message-specific information.
- lparam IntPtr
-
Specifies additional message-specific information.
Boolean
If the function succeeds, the return value is
.
If the function fails, the return value is
.
To get extended error information, call
GetLastWin32Error.