Appendix B message variables, ID's and constants

Top  Previous  Next

These are most of the predefined message variables, message ID's and general constants. Any windows message ID can be received by your handler, only the ones used the in the majority of programs are predefined.

Message variables

@MESSAGE / @CLASS

Contains the message ID when your window/dialog procedure is called.

@WPARAM / @CODE

Contains further information about the message. Equivalent to wparam in Windows

@LPARAM / @QUAL

Contains further information about the message. Equivalent to lparam in Windows

@MOUSEX

The mouse X position in the window when the message was sent

@MOUSEY

The mouse Y position in the window when the message was sent

@MENUNUM

Contains the menu number when a @IDMENUPICK message is sent

@CONTROLID

Contains the control ID

@HITWINDOW

Contains a pointer to the window that received the message

@NOTIFYCODE

Contains the notification code sent by a control.

Message ID's

These are the predefined message ID's that will be received by your window/dialog handler.

@IDLBUTTONDBLCLK

Left mouse button was double clicked

@IDLBUTTONUP

Left mouse button was released

@IDRBUTTONUP

Right mouse button was released

@IDMOUSEMOVE

Someone moved the mouse

@IDLBUTTONDN

Left mouse button was pressed

@IDRBUTTONDN

Right mouse button was pressed

@IDRBUTTONDBLCLK

Right mouse button was double clicked

@IDCONTROL

A control was clicked

@IDCLOSEWINDOW

Sent when the close window button or ‘close’ from the system menu selected

@IDMENUPICK

A menu item was selected. Check @MENUNUM for the ID

@IDMENUINIT

Sent when a menu is about to be displayed. Use CHECKMENUITEM and ENABLEMENUITEM in response to this message to modify the appearance of the menu before it is shown to the user.

@IDMOVE

Sent when a window/dialog has been moved

@IDMOVING

Sent while a window/dialog is moving

@IDSIZE

The window/dialog is sizing or has been resized.  This message is a combination of @IDSIZING and @IDSIZECHANGED

@IDSIZECHANGED

The window/dialog size has changed

@IDSIZING

The window/dialog is being resized

@IDHSCROLL

A horizontal scroll bar was clicked. Check @WPARAM for further information

@IDVSCROLL

A vertical scroll bar was clicked. Check @WPARAM for further information

@IDINITDIALOG

A Dialog is about to be displayed

@IDCANCEL

System dialogs return this to DOMODAL when the CANCEL button is pressed

@IDCHAR

A key was pressed and released on the keyboard. Check @WPARAM and @LPARAM for the ASCII value and the raw scan code

@IDKEYDOWN

A key was pressed on the keyboard. . Check @WPARAM and @LPARAM for the ASCII value and the raw scan code

@IDKEYUP

A key was released on the keyboard. . Check @WPARAM and @LPARAM for the ASCII value and the raw scan code

@IDTIMER

Sent when the timer elapses. See STARTTIMER in the user guide

@IDPAINT

Sent when the window needs refreshing and @NOAUTODRAW was used to create the window.

@IDCREATE

Sent when the window is first created but before it is displayed

@IDBEFORENAV

Sent when the embedded browser is about to navigate to a page

@IDNAVCOMPLETE

Sent when the embedded browser has finished loading a page.

@IDSTATUSTEXTUPDATE

Sent when the browser has updates status text to display

@IDERASEBACKGROUND

Sent when the background of a window needs to be painted. The window background is shown when transparent objects, such as toolbars with the @TBFLAT style, are visible.

@IDDESTROY

Sent when the window is about to be destroyed but before it is deleted.


LOADIMAGE constants

@IMGBITMAP

Loads a bitmap from a file or resource

@IMGICON

Loads an icon from a file or resource

@IMGCURSOR

Loads a cursor from a file or resource

@IMGEMF

Loads an enhanced meta file (EMF) from a disk file

@IMGSCALABLE

Loads a scalable bitmap, JPG, GIF or TIFF image from a file or resource

@IMGOEM

OR in with @IMGBITMAP, @IMGICON or @IMGCURSOR to load an OEM (system) image.

@IMGMAPCOLORS

OR in with @IMGBITMAP to have the system search the bitmap color table and map shades of gray to standard system 3D colors.


SHOWWINDOW constants

@SWRESTORE

Restore the window to its previous state

@SWMINIMIZED

Minimize the window

@SWMAXIMIZED

Maximize the window

@SWHIDE

Hides the window

@SWSHOW

Shows the window


Scrollbar messages returned in @WPARAM

@SBLEFT

Scroll to the far left.

@SBENDSCROLL

End scroll.

@SBLINELEFT

Scroll one line left

@SBLINERIGHT

Scroll one line right

@SBPAGELEFT

Scroll one page left

@SBPAGERIGHT

Scroll one page right

@SBRIGHT

Scroll to the far right

@SBTHUMBPOS

Scroll to absolute position. Check @LPARAM for the position, or use GETSCROLLPOSITION

@SBTHUMBTRACK

Drag scroll box to a position. Check @LPARAM for position, or use GETTHUMBPOSITION

@SBBOTTOM

Scroll to the bottom

@SBLINEDOWN

Scroll one line down

@SBLINEUP

Scroll one line up

@SBPAGEDOWN

Scroll one page down

@SBPAGEUP

Scroll one page up

@SBTOP

Scroll to the top


DRAWMODE flags

@TRANSPARENT

Text is drawn using the FRONTPEN color. No background is drawn.

@OPAQUE

Text is drawn using both the FRONTPEN and BACKPEN colors.


Menu creation flags

@MENUDISABLE

The menu item will be grayed out and not selectable

@MENUCHECK

Shows a checkmark next to the menu item


Button control styles

@CTLBTNBITMAP

Creates a bitmap button. The buttons caption text is the filename

@CTLBTNMULTI

Creates a multi line button control. Text is automatically word wrapped.

@CTLBTNDEFAULT

Identifies this as the default push button in a dialog

@CTLBTNFLAT

Creates a flat button


Static control styles

@CTLSTCBITMAP

Create a bitmap static control. The caption text is the filename

@CTLSTCMULTI

Creates a multi line static control

@CTLSTCSIMPLE

Creates a single line static control (default)


Edit / Rich edit control styles

@CTEDITLEFT

Text is left justified in the edit control

@CTEDITRIGHT

Text is right justified in the edit control

@CTEDITMULTI

Designates a multiline edit control. The default is single-line edit control. When the multiline edit control is in a dialog box, the default response to pressing the ENTER key is to activate the default button. To use the ENTER key as a carriage return, use the @CTEDITRETURN style. When the multiline edit control is not in a dialog box and the @CTEDITAUTOV style is specified, the edit control shows as many lines as possible and scrolls vertically when the user presses the ENTER key. If you do not specify @CTEDITAUTOV, the edit control shows as many lines as possible and beeps if the user presses the ENTER key when no more lines can be displayed. If you specify the @CTEDITAUTOH style, the multiline edit control automatically scrolls horizontally when the caret goes past the right edge of the control. To start a new line, the user must press the ENTER key. If you do not specify @CTEDITAUTOH, the control automatically wraps words to the beginning of the next line when necessary. A new line is also started if the user presses the ENTER key. The window size determines the position of the word wrap. If the window size changes, the word wrapping position changes and the text is redisplayed. Multiline edit controls can have scroll bars. An edit control with scroll bars processes its own scroll bar messages. Note that edit controls without scroll bars scroll as described in the previous paragraphs and process any scroll messages sent by the parent window.

@CTEDITPASS

Displays an asterisk (*) for each character typed into the edit control.

@CTEDITCENTER

Text is centered within the edit control

@CTEDITRO

The edit control is read only and text can be displayed but not entered

@CTEDITAUTOH

Automatically scrolls text to the right by 10 characters when the user types a character at the end of the line. When the user presses the ENTER key, the control scrolls all text back to position zero.

@CTEDITAUTOV

Automatically scrolls text up one page when the user presses the ENTER key on the last line.

@CTEDITRETURN

Specifies that a carriage return be inserted when the user presses the ENTER key while entering text into a multiline edit control in a dialog box. If you do not specify this style, pressing the ENTER key has the same effect as pressing the dialog box’s default push button. This style has no effect on a single-line edit control.

@CTEDITNUMBER

Specified that the edit control only accepts numerals as input (0-9). Any other character will be ignored


List box control styles

@CTLISTEXTENDED

The user can select multiple items using the SHIFT key and the mouse or special key combinations

@CTLISTMULTI

String selection is toggled each time the user clicks or double-clicks the string. Any number of strings can be selected

@CTLISTSORT

Strings in the list box are sorted alphabetically

@CTLISTSTANDARD

Strings in the list box are sorted alphabetically, and the parent window receives an input message whenever the user clicks or double-clicks a string. The list box contains borders on all sides

@CTLISTNOTIFY

Parent window receives an input message whenever the user clicks or double-clicks a string

@CTLISTTABS

Allows a list box to recognize and expand tab characters when drawing its strings

@CTLISTCOLUMNS

Specifies a multicolumn list box that is scrolled horizontally


Scrollbar control styles

@CTSCROLLHORIZ

Creates a horizontal scrollbar

@CTSCROLLVERT

Creates a vertical scrollbar


Combo box control styles

@CTCOMBODROPDOWN

Similar to @CTCOMBOSIMPLE, except that the list box is not displayed unless the user selects an icon next to the edit control.

@CTCOMBODROPLIST

Similar to @CTCOMBODROPDOWN, except that the edit control is replaced by a static text item that displays the current selection in the list box.

@CTCOMBOSIMPLE

Displays the list box at all times. The current selection in the list box is displayed in the edit control.

@CTCOMBOSORT

Automatically sorts strings added to the list box.

@CTCOMBOAUTOHSCROLL

Automatically scrolls the text in an edit control to the right when the user types a character at the end of the line. If this style is not set, only text that fits within the rectangular boundary is allowed.


List view styles

@LVSALIGNLEFT

Specifies that items are left-aligned in icon and small icon view.

@LVSALIGNTOP

Specifies that items are aligned with the top of the control in icon and small icon view.

@LVSAUTOARRANGE

Specifies that icons are automatically kept arranged in icon view and small icon view.

@LVSEDITLABELS

Allows item text to be edited in place. The parent window must process the LVN_ENDLABELEDIT notification message.

@LVSICON

Specifies icon view.

@LVSLIST

Specifies list view.

@LVSNOCOLUMNHEADER

Specifies that a column header is not displayed in report view. By default, columns have headers in report view.

@LVSNOLABELWRAP

Displays item text on a single line in icon view. By default, item text can wrap in icon view.

@LVSNOSCROLL

Disables scrolling. All items must be within the client area.

@LVSNOSORTHEADER

Specifies that column headers do not work like buttons. This style is useful if clicking a column header in report view does not carry out an action, such as sorting.

@LVSREPORT

Specifies report view.

@LVSSHOWSELALWAYS

Always show the selection, if any, even if the control does not have the focus.

@LVSSINGLESEL

Allows only one item at a time to be selected. By default, multiple items can be selected.

@LVSSMALLICON

Specifies small icon view.

@LVSSORTASCENDING

Sorts items based on item text in ascending order.

@LVSSORTDESCENDING

Sorts items based on item text in descending order.


SETLINESTYLE flags

@LSSOLID

Draw a solid line

@LSDASH

Draw a dashed line

@LSDASHDOT

Draw an alternating dashed dotted line

@LSDASHDOTDOT

Draw an alternating dashed dot dot line

@LSDOT

Draw a dotted line

@LSINSIDE

Draws lines around objects on the inside instead of out.


SETFONT flags

@SFITALIC

Creates an italicized font

@SFUNDERLINE

Creates an underlined font

@SFSTRIKEOUT

Creates a striked out font


SETCURSOR constants

@CSWAIT

Displays the hourglass wait cursor

@CSARROW

Displays the standard arrow pointer

@CSCUSTOM

Display a custom cursor loaded with the LOADIMAGE function.


PLAYWAVE constants

@SNDASYNC

PLAYWAVE returns immediately without waiting for the sound to finish playing.

@SNDSYNC

PLAYWAVE waits for the sound to finish playing

@SNDLOOP

The sound loops continuously until PLAYWAVE is called with a filename of "" or another sound is started. This must also be combined with @SNDASYNC

@SNDNOSTOP

If another sound is playing, PLAYWAVE returns without playing the new sound.


RASTERMODE flags

@RMBLACK

Pixel is always black

@RMWHITE

Pixel is always white

@RMNOP

Pixel remains unchanged

@RMNOT

Pixel is the inverse of the screen color

@RMCOPYPEN

Pixel is pen color

@RMNOTCOPYPEN

Pixel is the inverse of the pen color

@RMMERGEPENNOT

Pixel is a combination of the pen color and the inverse of the screen color (final pixel = (NOT screen pixel) OR pen).

@RMMASKPENNOT

Pixel is a combination of the colors common to both the pen and the inverse of the screen (final pixel = (NOT screen pixel) AND pen).

@RMMERGENOTPEN

Pixel is a combination of the screen color and the inverse of the pen color (final pixel = (NOT pen) OR screen pixel).

@RMMASKNOTPEN

Pixel is a combination of the colors common to both the screen and the inverse of the pen (final pixel = (NOT pen) AND screen pixel).

@RMMERGEPEN

Pixel is a combination of the pen color and the screen color (final pixel = pen OR screen pixel).

@RMNOTMERGEPEN

Pixel is the inverse of the RMMERGEPEN color (final pixel = NOT(pen OR screen pixel)).

@RMMASKPEN

Pixel is a combination of the colors common to both the pen and the screen (final pixel = pen AND screen pixel).

@RMNOTMASKPEN

Pixel is the inverse of the RMMASKPEN color (final pixel = NOT(pen AND screen pixel)).

@RMXORPEN

Pixel is a combination of the colors that are in the pen or in the screen, but not in both (final pixel = pen XOR screen pixel).

@RMNOTXORPEN

Pixel is the inverse of the RMXORPEN color (final pixel = NOT(pen XOR screen pixel)).


Notification codes

Edit Controls

@ENKILLFOCUS

Control has lost input focus

@ENSETFOCUS

Control has been given the input focus

@ENERRSPACE

Control could not complete an operation because there was not enough memory available

@ENMAXTEXT

While inserting text, the user has exceeded the specified number of characters for the edit control. Insertion has been truncated. This message is also sent either when an edit control does not have the @CTEDITAUTOH style and the number of characters to be inserted exceeds the width of the edit control or when an edit control does not have the @CTEDITAUTOV style and the total number of lines to be inserted exceeds the height of the edit control.

@ENUPDATE

The contents of the control are about to change

@ENCHANGE

The contents of the control have changed.

@ENHSCROLL

The user has clicked the edit control’s horizontal scroll bar. Windows sends this message before updating the control.

@ENVSCROLL

The user has clicked the edit control’s vertical scroll bar. Windows sends this message before updating the control.

Rich edit controls

@ENKILLFOCUS

Control has lost input focus

@ENSETFOCUS

Control has been given the input focus

@ENERRSPACE

Control could not complete an operation because there was not enough memory available

@ENMAXTEXT

The limit set by @RTSETLIMITTEXT has been reached,

@ENUPDATE

The contents of the control are about to change

Must be enabled with @RTSETEVENTMASK

@ENSELCHANGE

The current selection has changed.

Must be enabled with @RTSETEVENTMASK

@ENCHANGE

The contents of the control have changed.

Must be enabled with @RTSETEVENTMASK

@ENHSCROLL

The user has clicked the edit control’s horizontal scroll bar. Windows sends this message before updating the control.

Must be enabled with @RTSETEVENTMASK

@ENVSCROLL

The user has clicked the edit control’s vertical scroll bar. Windows sends this message before updating the control.

Must be enabled with @RTSETEVENTMASK

@ENREQUESTRESIZE

The control’s contents are either smaller or larger than the control’s window size.

Must be enabled with @RTSETEVENTMASK

List view controls

@NMCLICK

User has left clicked in the control

@NMDBLCLK

User has double clicked in the control

@NMKILLFOCUS

The control has lost the input focus

@NMSETFOCUS

The control has received the input focus

@NMRCLICK

User has right clicked in the control

@LVNCOLUMNCLICK

Indicates that the user clicked a column header in report view.

@LPARAM contains a memory handle to a NMLISTVIEW data type.

@LVNKEYDOWN

Signals a keyboard event

@LPARAM contains a memory handle to a LVKEYDOWN data type

@LVNBEGINLABELEDIT

Signals the start of in-place label editing

@LVNENDLABELEDIT

Signals the end of label editing

@LVNITEMCHANGED

Indicates that an item has changed.

@LPARAM contains a memory handle to a NMLISTVIEW data type.

@LVNITEMCHANGING

Indicates that an item is in the process of changing

@LPARAM contains a memory handle to a NMLISTVIEW data type.

@LVNINSERTITEM

Signals the insertion of a new list view item.

@LPARAM contains a memory handle to a NMLISTVIEW data type.

@LVNDELETEITEM

Signals the deletion of a specific item

@LPARAM contains a memory handle to a NMLISTVIEW data type.

List box controls

@LBNDBLCLK

The user double-clicks an item in the list box.

@LBNERRSPACE

The list box cannot allocate enough memory to fulfill a request.

@LBNKILLFOCUS

The list box loses the keyboard focus.

@LBNSETFOCUS

The list box receives the keyboard focus.

@LBNSELCHANGE

The selection in a list box is about to change.

@LBNSELCANCEL

The user cancels the selection of an item in the list box.

Combo box controls

@CBNDBLCLICK

Indicates the user has double-clicked a list item in a simple combo box.

@CBNERRSPACE

Indicates the combo box cannot allocate enough memory to carry out a request, such as adding a list item.

@CBNKILLFOCUS

Indicates the combo box is about to lose the input focus.

@CBNSETFOCUS

Indicates the combo box has received the input focus.

@CBNDROPDOWN

Indicates the list in a drop-down combo box or drop-down list box is about to open.

@CBNCLOSEUP

Indicates the list in a drop-down combo box or drop-down list box is about to close.

@CBNEDITCHANGE

Indicates the user has changed the text in the edit control of a simple or drop-down combo box. This notification message is sent after the altered text is displayed.

@CBNEDITUPATE

Indicates the user has changed the text in the edit control of a simple or drop-down combo box. This notification message is sent before the altered text is displayed.

@CBNSELCHANGE

Indicates the current selection has changed.

@CBNSELENDOK

Indicates that the selection made drop down list, while it was dropped down, should be accepted.

@CBNSELENDCANCEL

Indicates that the selection made in the drop down list, while it was dropped down, should be ignored.