I have included <winuser.h> for definitions to Windows Controls
and <winable.h> for definitions of Windows Events.
61456 was a code we want to decrypt
take the code and then AND the code with the hex mask 0xFFF0
this implies the lower four bits of code are zeroed out
Dec Bin
8 2^3
+4 2^2
+2 2^1
+1 2^0
Dec Bin Bin Hex
=15 2^4-1 1111 0xF
61456 AND 0xFFF0
61,456 >0xF010, roll right 4 bits >0xF01
------
0x10000=65,536 >0
0x01000= 4,096 >F 15* 4,096=61,440
0x00100= 256 >0
0x00010= 16 >1 1*16 = 16
0x00001= 1 >0 ======
61,456
0xF010 >1111 0000 0001 0000 = wParam
So the wParam we need to look up in <winuser.h>
is the hex value 0xF010... which turns up in
a line in the file for SC_MOVE.
#define SC_MOVE 0xF010
Example
-------
wParam is SC_KEYMENU,
lParam contains the character code of the key that is used with the ALT key
to display the popup menu.
For example, pressing ALT+F to display the File popup will cause a
WM_SYSCOMMAND with wParam equal to SC_KEYMENU and
lParam equal to 'f'.
http://msdn.microsoft.com/library/defau ... nui/winui/
windowsuserinterface/resources/menus/menureference/menumessages/wm_command.asp
WM_COMMAND Notification
--------------------------
The WM_COMMAND message is sent when the user selects a command item from a menu, when a
control sends a notification message to its parent window, or when an accelerator keystroke
is translated.
Syntax
------
WM_COMMAND
WPARAM wParam
LPARAM lParam;
Parameters
----------
wParam
The high-order word specifies the notification code if the message is from a control.
If the message is from an accelerator, this value is 1. If the message is from a menu,
this value is zero.
The low-order word specifies the identifier of the menu item, control, or accelerator.
lParam
Handle to the control sending the message if the message is from a control.
Otherwise, this parameter is NULL.
Return Value
------------
If an application processes this message, it should return zero.
Remarks
Accelerator keystrokes that select items from the window menu are translated into
WM_SYSCOMMAND messages.
If an accelerator keystroke occurs that corresponds to a menu item when the window
that owns the menu is minimized, no WM_COMMAND message is sent. However, if an
accelerator keystroke occurs that does not match any of the items in the window's
menu or in the window menu, a WM_COMMAND message is sent, even if the window is
minimized.
If an application enables a menu separator, the system sends a WM_COMMAND message
with the low-word of the wParam parameter set to zero when the user selects the
separator.
Windows 98/Me, Windows 2000/XP: If a menu is defined with a MENUINFO.dwStyle value
of MNS_NOTIFYBYPOS, WM_MENUCOMMAND is sent instead of WM_COMMAND.
http://msdn.microsoft.com/library/defau ... nui/winui/
windowsuserinterface/userinput/keyboardaccelerators/keyboardacceleratorreference/
keyboardacceleratormessages/wm_syscommand.asp
WM_SYSCOMMAND Notification
--------------------------
A window receives WM_SYSCOMMAND Notification when the user chooses a command from the Window
menu (formerly known as the system or control menu) or when the user chooses
the maximize button, minimize button, restore button, or close button.
Syntax
------
WM_SYSCOMMAND
WPARAM wParam
LPARAM lParam;
In WM_SYSCOMMAND messages, the four low-order bits of the wParam parameter are used
internally by the system. To obtain the correct result when testing the value of
wParam, an application must combine the value 0xFFF0 with the wParam value by
using the bitwise AND operator.
The menu items in a window menu can be modified by using the GetSystemMenu, AppendMenu,
InsertMenu, ModifyMenu, InsertMenuItem, and SetMenuItemInfo functions. Applications
that modify the window menu must process WM_SYSCOMMAND messages.
Accelerator keys that are defined to choose items from the window menu are translated
into WM_SYSCOMMAND messages; all other accelerator keystrokes are translated into
WM_COMMAND messages.
If the wParam is SC_KEYMENU, lParam contains the character code of the key that
is used with the ALT key to display the popup menu. For example, pressing ALT+F
to display the File popup will cause a WM_SYSCOMMAND with wParam equal to SC_KEYMENU
and lParam equal to 'f'.
Parameters
----------
wParam
Specifies the type of system command requested.
This parameter can be one of the following values.
SC_CLOSE
Closes the window.
SC_CONTEXTHELP
Changes the cursor to a question mark with a pointer. If the user then clicks
a control in the dialog box, the control receives a WM_HELP message.
SC_DEFAULT
Selects the default item; the user double-clicked the window menu.
SC_HOTKEY
Activates the window associated with the application-specified hot key.
The lParam parameter identifies the window to activate.
SC_HSCROLL
Scrolls horizontally.
SC_KEYMENU
Retrieves the window menu as a result of a keystroke. For more information, see
the Remarks section.
SC_MAXIMIZE
Maximizes the window.
SC_MINIMIZE
Minimizes the window.
SC_MONITORPOWER
Sets the state of the display. This command supports devices that have power-saving
features, such as a battery-powered personal computer.
The lParam parameter can have the following values:
1 - the display is going to low power
2 - the display is being shut off
SC_MOUSEMENU
Retrieves the window menu as a result of a mouse click.
SC_MOVE
Moves the window.
SC_NEXTWINDOW
Moves to the next window.
SC_PREVWINDOW
Moves to the previous window.
SC_RESTORE
Restores the window to its normal position and size.
SC_SCREENSAVE
Executes the screen saver application specified in the [boot] section of the System.ini file.
SC_SIZE
Sizes the window.
SC_TASKLIST
Activates the Start menu.
SC_VSCROLL
Scrolls vertically.
lParam
The low-order word specifies the horizontal position of the cursor, in screen coordinates,
if a window menu command is chosen with the mouse. Otherwise, this parameter is not used.
The high-order word specifies the vertical position of the cursor, in screen coordinates,
if a window menu command is chosen with the mouse. This parameter is –1 if the command
is chosen using a system accelerator, or zero if using a mnemonic.
http://msdn.microsoft.com/library/defau ... nui/winui/
windowsuserinterface/userinput/keyboardaccelerators.asp
Keyboard Accelerators
---------------------
A keyboard accelerator (or, simply, accelerator) is a keystroke or combination
of keystrokes that generates a WM_COMMAND or WM_SYSCOMMAND message for an application.
WM_SYSCOMMAND
A window receives this message when the user chooses a command from the
Window menu (formerly known as the system or control menu) or when the
user chooses the maximize button, minimize button, restore button, or
close button.
http://msdn.microsoft.com/library/defau ... nui/winui/
windowsuserinterface/windowui.asp
http://msdn.microsoft.com/library/defau ... d_21pv.asp
Winable.h C and C++ header file for using WinEvents
Winuser.h C and C++ header file for using Windows controls
/************************************************************
*
* winuser.h -- USER procedure declarations, constant definitions
* and macros
*
* Copyright (c) 1985-1995, Microsoft Corp. All rights reserved.
************************************************************/
#ifndef _WINUSER_
#define _WINUSER_
//
// Define API decoration for direct importing of DLL references.
//
#if !defined(_USER32_)
#define WINUSERAPI DECLSPEC_IMPORT
#else
#define WINUSERAPI
#endif
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#ifndef WINVER
#define WINVER 0x0400 /* version 4.0 */
#endif /* !WINVER */
#define WM_COMMAND 0x0111
#define WM_SYSCOMMAND 0x0112
----------
from winuser.h
--------------
#ifndef NOSYSCOMMANDS
/*
* System Menu Command Values
*/
#define SC_SIZE 0xF000
#define SC_MOVE 0xF010
#define SC_MINIMIZE 0xF020
#define SC_MAXIMIZE 0xF030
#define SC_NEXTWINDOW 0xF040
#define SC_PREVWINDOW 0xF050
#define SC_CLOSE 0xF060
#define SC_VSCROLL 0xF070
#define SC_HSCROLL 0xF080
#define SC_MOUSEMENU 0xF090
#define SC_KEYMENU 0xF100
#define SC_ARRANGE 0xF110
#define SC_RESTORE 0xF120
#define SC_TASKLIST 0xF130
#define SC_SCREENSAVE 0xF140
#define SC_HOTKEY 0xF150
#if(WINVER >= 0x0400)
#define SC_DEFAULT 0xF160
#define SC_MONITORPOWER 0xF170
#define SC_CONTEXTHELP 0xF180
#define SC_SEPARATOR 0xF00F
#endif /* WINVER >= 0x0400 */
/*
* Obsolete names
*/
#define SC_ICON SC_MINIMIZE
#define SC_ZOOM SC_MAXIMIZE
#endif /* !NOSYSCOMMANDS */