Jump to content

WM SEM1

From EDM2
Revision as of 22:45, 13 April 2025 by Martini (talk | contribs) (Created page with "This message is sent or posted by an application. ==Syntax== <PRE> param1 ULONG flAccumBits; Semaphore value.: param2 ULONG ulReserved1; Reserved value, should be 0.: </PRE> ==Parameters== ;flAccumBits (ULONG) - Input : Semaphore value. The semaphore values from all the WM_SEM1 messages posted to a queue, are accumulated by a logical-OR operation. ;ulReserved1 (ULONG) - Input : Reserved value, should be 0. ==Returns== ;ulReserved2 (ULON...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This message is sent or posted by an application.

Syntax

param1
    ULONG   flAccumBits; /* Semaphore value. */

param2
    ULONG   ulReserved1; /* Reserved value, should be 0. */

Parameters

flAccumBits (ULONG) - Input
Semaphore value. The semaphore values from all the WM_SEM1 messages posted to a queue, are accumulated by a logical-OR operation.
ulReserved1 (ULONG) - Input
Reserved value, should be 0.

Returns

ulReserved2 (ULONG) - returns
Reserved value, should be 0.

Remarks

If the message is posted, it is merged with any existing WM_SEM1 message on the queue by combining the two flAccumBits values using a logical-OR operation.

The WM_SEM1 messages are queued higher than any other type of message.

Default Processing

The default window procedure takes no action on this message, other than to set ulReserved1 to 0.

Examples

In this example, a thread notifies the client window that it is about to terminate. It sends the constant THREAD3 as the flFlags parameter so that when the client window receives the message, it can tell which thread terminated.

#define THREAD1 1     /* bit #1 */
#define THREAD2 2     /* bit #2 */
#define THREAD3 4     /* bit #3 */
VOID FAR Thread3() {
    .
    .
    .
    WinPostMsg(hwndClient, WM_SEM1, (MPARAM) THREAD3, 0);
    DosExit(EXIT_THREAD, 0);
}