GetMessageSource

The GetMessageSource function determines the source of a keyboard message.

Syntax

UINT GetMessageSource( );

At a Glance

Header file: Winuser.h
Component: msgque
Platforms: H/PC
Windows CE versions: 2.0 and later

Return Values

This function returns one of the following values.

MSGSRC_SOFTWARE_POST
The message source was software.
MSGSRC_HARDWARE_KEYBOARD
The message source was the keyboard.
MSGSRC_UNKNOWN
The message source is unknown.

Remarks

When targeting devices that support both a hardware keyboard and a "soft" keyboard, you can use the GetMessageSource function to determine the source of a keyboard input message. Keyboard events that originate from the keyboard driver or keybd_event are marked as hardware. Messages generated from PostMessage are marked as software.

Use this function to determine the source of the following messages:

WM_KEYDOWN

WM_KEYUP

WM_SYSKEYDOWN

WM_SYSKEYUP

Note The GetMessageSource function is unique to Windows CE. It is not supported in other versions of Windows.

See Also

keybd_event, PostMessage