Date: 02-16-2022
Return to Index
created by gbSnippets
'This listing is a subset of the notification messages which may be received within
'a Dialog callback function - those most commonly used in PowerBASIC applications.
'For more information on notification messages, visit these MSDN pages:
'Windows http://msdn.microsoft.com/en-us/library/ms632595(VS.85).aspx
'Dialog Boxes http://msdn.microsoft.com/en-us/library/ms632588(VS.85).aspx
'Here is a summary of the arguments in many commonly used messages.
'Message wParam lParam
------------------- ------------------- ----------------------
'WM_Activate Lo-Act/InAct Hi-MinState hDlg
'WM_ActiveApp T/F ThreadID
'WM_Char char code of key flags
'WM_Close not used not used
'WM_Command Lo-CtlID Hi-NotMsg Ctrl Handle
'WM_ContextMenu hWnd where clicked Lo-Xpos Hi_Ypos (screen coordinates)
'WM_Create not used ptr to CREATESTRUCT
'WM_CtlColorDlg handle of dialog DC handle of dialog
'WM_Destroy not used not used
'WM_DropFiles handle to file structure must be zero
'WM_EraseBkgnd hDC not used
'WM_GetDlgCode VK of key pressed ptr to MSG
'WM_GetMinMaxInfo not used ptr to MINMAXINFO
'WM_Help must be zero ptr to HELPINFO
'WM_HotKey hot key identifier Lo-keys Hi-SpecKey
'WM_InitDialog handle to control w/keyboard focus init data
'WM_InitMenuPopup hMenu item Lo-menu item pos Hi-T/F is window menu
'WM_MenuSelect Lo-menu item Hi-menu flags handle to menu
'WM_MouseMove special VK key status Lo-Xpo Hi-Ypos
'WM_NextDlgCtl instruct on which control gets focus instruct on using wParam
'WM_Notify CtrlID ptr to NMHDR
'WM_Paint not used not used
'WM_SetCursor hWnd where cursor is Lo-hit-test code Hi-Mouse Message
'WM_Size type of resizing Lo-clientW Hi-clientH
'WM_Sizing type of resizing Lo-clientW Hi-clientH
'WM_SysCommand flags Lo-CursorX Hi-CursorY (XY available only if Window menu is used)
'WM_Timer timer ID ptr to callback function
'This next list categorizes window messages to help understand when/how the
'messages are to be used.
'LIFE-CYCLE
%WM_Create 'when an application requests that a window be created
'after window is created, but before it becomes visible
%WM_InitDialog 'immediately before a dialog box is displayed
'typically used to initialize controls and carry out any other
'initialization tasks that affect the appearance of the dialog box.
%WM_Destroy 'window is being destroyed
'after windows is removed from screen (children still exist)
'CONTROL NOTIFICATIONS
%WM_Command 'user selects a command item from a menu
'control sends a notification message to its parent window
'accelerator keystroke is translated.
%WM_Notify 'by control to its parent window when an event has occurred
'RESIZE
%WM_Size 'after its size has changed.
%WM_Sizing 'before its size has changed.
%WM_GetMinMaxInfo 'size/position of window is about to change
'MOUSE CLICK
%WM_ParentNotify 'sent to parent when user clicks mouse button over child
%WM_SysCommand 'user choose command from Window menu, max/min/restore/close buttons
'MOUSE MOVEMENT
%WM_SetCursor 'sent if mouse causes cursor to move
%WM_MouseMove 'when cursor moves
'KEYBOARD
%WM_Char 'contains the character code of the key(s) that was pressed.
%WM_GetDlgCode 'intercept keyboard input to child control
%WM_HotKey 'detects when user presses registered hotky combinations
%WM_Help 'detects when user presses F1 for Help
WM_NextDlgCtl 'sets keyboard focus to a different control
'APPLICATION STATUS
%WM_ActivateApp 'focus returns to app from another app
%WM_Activate 'sent to both the window being activated and the window
'being deactivated.
'GRAPHIC/DRAWING EVENTS
%WM_EraseBkgnd 'sent when the window background must be erased (such as resizing)
%WM_Paint 'sent when request is made to paint a portion of an application's window.
%WM_CtlColorDlg 'sent to dialog box before system draws the dialog box
'RECURRING EVENTS
%WM_Timer 'when a timer expires
'MENU ACTIVITY
%WM_InitMenuPopup 'when pop-up menu is about to become active
%WM_ContextMenu 'user clicked the right mouse button (right-clicked) in a window.
%WM_MenuSelect 'sent when user selects a menu item
'USER ACTION
%WM_DropFile 'sent when user drops file on application that's is registered as file recipient
'And here are longer descriptions of these messages. These are in alphabetical order.
%WM_ACTIVATEAPP
'The WM_ACTIVATEAPP message is sent when a window belonging to a different
'application than the active window is about to be activated. The message is
'sent to the application whose window is being activated and to the application
'whose window is being deactivated.
%WM_ACTIVATE
'The WM_ACTIVATE message is sent to both the window being activated and the
'window being deactivated. If the windows use the same input queue, the message
'is sent synchronously, first to the window procedure of the top-level window
'being deactivated, then to the window procedure of the top-level window being
'activated. If the windows use different input queues, the message is sent
'asynchronously, so the window is activated immediately.
%WM_CHAR
'The WM_CHAR message is posted to the window with the keyboard focus when
'a WM_KEYDOWN message is translated by the TranslateMessage function. The
'WM_CHAR message contains the character code of the key that was pressed.
%WM_COMMAND
'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.
%WM_CONTEXTMENU
'The WM_CONTEXTMENU message notifies a window that the user clicked the right
'mouse button (right-clicked) in the window.
%WM_CREATE
'The WM_CREATE message is sent when an application requests that a window
'be created by calling the CreateWindowEx or CreateWindow function. (The
'message is sent before the function returns.) The window procedure of the
'new window receives this message after the window is created, but before
'the window becomes visible.
WM_CtlColorDlg
'The WM_CTLCOLORDLG message is sent to a dialog box before the system draws the
'dialog box. By responding to this message, the dialog box can set its text and background
'colors using the specified display device context handle.
%WM_DESTROY
'The WM_DESTROY message is sent when a window is being destroyed. It is
'sent to the window procedure of the window being destroyed after the
'window is removed from the screen. This message is sent first to the
'window being destroyed and then to the child windows (if any) as they
'are destroyed. During the processing of the message, it can be assumed
'that all child windows still exist.
%WM_DROPFILES
'WM_DROPFILES is Sent when the user drops a file on the window of an
'application that has registered itself as a recipient of dropped files.
%WM_ERASEBKGND
'The WM_ERASEBKGND message is sent when the window background must be erased
'(for example, when a window is resized). The message is sent to prepare an
'invalidated portion of a window for painting.
%WM_GETDLGCODE
'The WM_GETDLGCODE message is sent to the window procedure associated with
'a control. By default, the system handles all keyboard input to the control;
'the system interprets certain types of keyboard input as dialog box navigation
'keys. To override this default behavior, the control can respond to the
'WM_GETDLGCODE message to indicate the types of input it wants to process itself.
%WM_GETMINMAXINFO
'The WM_GETMINMAXINFO message is sent to a window when the size or position of
'the window is about to change. An application can use this message to override
'the window's default maximized size and position, or its default minimum or
'maximum tracking size.
%WM_HELP
'Indicates that the User pressed the F1 key.
%WM_HOTKEY
'The WM_HOTKEY message is posted when the User presses a hot key registered by the
'RegisterHotKey Function. The message is placed at the top of the message queue associated
'with the Thread that registered the hot key.
%WM_INITDIALOG
'The WM_INITDIALOG message is sent to the dialog box procedure immediately
'before a dialog box is displayed. Dialog box procedures typically use this
'message to initialize controls and carry out any other initialization tasks
'that affect the appearance of the dialog box.
%WM_INITMENUPOPUP
'WM_INITMENUPOPUP. This message is sent when a pop-up menu is about to become
'active. This enables an application to modify the pop-up menu before it is
'displayed, without changing the entire menu.
%WM_MENUSELECT
'The WM_MENUSELECT message is sent to a menu's owner window when the user selects a menu item.
%WM_MOUSEMOVE
'The WM_MOUSEMOVE message is posted to a window when the cursor moves. If
'the mouse is not captured, the message is posted to the window that
'contains the cursor. Otherwise, the message is posted to the window
'that has captured the mouse.
%WM_NextDlgCtl
'The WM_NEXTDLGCTL message is sent to a dialog box procedure to set the keyboard focus
'to a different control in the dialog box.
%WM_NOTIFY
'WM_NOTIFY Sent by a common control to its parent window when an event has
'occurred or the control requires some information.
%WM_PAINT
'WM_PAINT. Sent by an application when Windows or another application makes a
'request to paint a portion of an application's window.
%WM_SETCURSOR
'The WM_SETCURSOR message is sent to a window if the mouse causes the cursor
'to move within a window and mouse input is not captured.
%WM_SIZE
'The WM_SIZE message is sent to a window after its size has changed.
%WM_SIZING
'The WM_SIZE message is sent to a window that the user is resizing. While
'processing this message the size/position can be changed.
%WM_SYSCOMMAND
'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.
%WM_TIMER
'The WM_TIMER message is posted to the installing thread's message queue when a timer expires.
'gbs_00015
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm