<messages>
<message value="0x6">
<name>ABM_ACTIVATE</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc>ABM_ACTIVATE Message
Notifies the system that an appbar has been activated. An appbar should call this message in response to the WM_ACTIVATE message.
Syntax
SHAppBarMessage(ABM_ACTIVATE, pabd);
Parameters
pabd
A pointer to an APPBARDATA structure that identifies the appbar to activate. You must specify the cbSize and hWnd members when sending this message; all other members are ignored.
Return Value
Remarks
This message is ignored if the hWnd member of the structure pointed to by pabd identifies an autohide appbar. The system automatically sets the z-order for autohide appbars.
Message Information
Header shellapi.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x7">
<name>ABM_GETAUTOHIDEBAR</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc>ABM_GETAUTOHIDEBAR Message
Retrieves the handle to the autohide appbar associated with an edge of the screen.
Syntax
hwndAutoHide = (HWND) SHAppBarMessage(ABM_GETAUTOHIDEBAR, pabd);
Parameters
pabd
A pointer to an APPBARDATA structure that specifies the screen edge. You must specify the cbSize, hWnd, and uEdge members when sending this message; all other members are ignored.
Return Value
Message Information
Header shellapi.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x4">
<name>ABM_GETSTATE</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
Returns zero if the taskbar is neither in the autohide nor always-on-top state. Otherwise, the return value is one or both of the following:
ABS_ALWAYSONTOP The taskbar is in the always-on-top state.
ABS_AUTOHIDE The taskbar is in the autohide state.</returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc>ABM_GETSTATE Message
Retrieves the autohide and always-on-top states of the Windows taskbar.
Syntax
uState = (UINT) SHAppBarMessage(ABM_GETSTATE, pabd);
Parameters
pabd
Pointer to an APPBARDATA structure. You must specify the cbSize member when sending this message; all other members are ignored.
Return Value
Returns zero if the taskbar is neither in the autohide nor always-on-top state. Otherwise, the return value is one or both of the following:
ABS_ALWAYSONTOP The taskbar is in the always-on-top state.
ABS_AUTOHIDE The taskbar is in the autohide state.
Message Information
Header shellapi.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x5">
<name>ABM_GETTASKBARPOS</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc>ABM_GETTASKBARPOS Message
Retrieves the bounding rectangle of the Windows taskbar.
Syntax
fResult = (BOOL) SHAppBarMessage(ABM_GETTASKBARPOS, pabd);
Parameters
pabd
A pointer to an APPBARDATA structure whose rc member receives the bounding rectangle, in screen coordinates, of the taskbar. You must specify the cbSize and hWnd when sending this message; all other members are ignored.
Return Value
Message Information
Header shellapi.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x0">
<name>ABM_NEW</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc>ABM_NEW Message
Registers a new appbar and specifies the message identifier that the system should use to send it notification messages. An appbar should send this message before sending any other appbar messages.
Syntax
fRegistered = (BOOL) SHAppBarMessage(ABM_NEW, pabd);
Parameters
pabd
A pointer to an APPBARDATA structure that contains the new appbar's window handle and message identifier. You must specify the cbSize, hWnd, and uCallbackMessage members when sending this message; all other members are ignored.
Return Value
Message Information
Header shellapi.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x2">
<name>ABM_QUERYPOS</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc>ABM_QUERYPOS Message
Requests a size and screen position for an appbar. When the request is made, the message proposes a screen edge and a bounding rectangle for the appbar. The system adjusts the bounding rectangle so that the appbar does not interfere with the Windows taskbar or any other appbars.
Syntax
SHAppBarMessage(ABM_QUERYPOS, pabd);
Parameters
pabd
A pointer to an APPBARDATA structure. The uEdge member specifies a screen edge, and the rc member contains the proposed bounding rectangle. When the SHAppBarMessage function returns, rc contains the approved bounding rectangle. You must specify the cbSize, hWnd, uEdge, and rc members when sending this message; all other members are ignored.
Return Value
Remarks
An appbar should send this message before sending the ABM_SETPOS message.
Message Information
Header shellapi.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1">
<name>ABM_REMOVE</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc>ABM_REMOVE Message
Unregisters an appbar by removing it from the system's internal list. The system no longer sends notification messages to the appbar or prevents other applications from using the screen area occupied by the appbar.
Syntax
SHAppBarMessage(ABM_REMOVE, pabd);
Parameters
pabd
A pointer to an APPBARDATA structure that contains the handle to the appbar to unregister. You must specify the cbSize and hWnd members when sending this message; all other members are ignored.
Return Value
Remarks
This message causes the system to send the ABN_POSCHANGED notification message to all appbars.
Message Information
Header shellapi.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x8">
<name>ABM_SETAUTOHIDEBAR</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc>ABM_SETAUTOHIDEBAR Message
Registers or unregisters an autohide appbar for an edge of the screen.
Syntax
fSuccess = (BOOL) SHAppBarMessage(ABM_SETAUTOHIDEBAR, pabd);
Parameters
pabd
A pointer to an APPBARDATA structure. The uEdge member specifies the screen edge. The lParam member is set to TRUE to register the appbar or FALSE to unregister it. You must specify the cbSize, hWnd, uEdge, and lParam members when sending this message; all other members are ignored.
Return Value
Remarks
The system allows only one autohide appbar for each edge of the screen. This is determined when the member uEdge of the APPBARDATA structure is set.
Message Information
Header shellapi.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x3">
<name>ABM_SETPOS</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc>ABM_SETPOS Message
Sets the size and screen position of an appbar. The message specifies a screen edge and the bounding rectangle for the appbar. The system may adjust the bounding rectangle so that the appbar does not interfere with the Microsoft Windows taskbar or any other appbars.
Syntax
SHAppBarMessage(ABM_SETPOS, pabd);
Parameters
pabd
A pointer to an APPBARDATA structure. The uEdge member specifies a screen edge, and the rc member contains the bounding rectangle. When the SHAppBarMessage function returns, rc contains the approved bounding rectangle. You must specify the cbSize, hWnd, uEdge, and rc members when sending this message; all other members are ignored.
Return Value
Remarks
This message causes the system to send the ABN_POSCHANGED notification message to all appbars.
Message Information
Header shellapi.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x9">
<name>ABM_WINDOWPOSCHANGED</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc>ABM_WINDOWPOSCHANGED Message
Notifies the system when an appbar's position has changed. An appbar should call this message in response to the WM_WINDOWPOSCHANGED message.
Syntax
SHAppBarMessage(ABM_WINDOWPOSCHANGED, pabd);
Parameters
pabd
A pointer to an APPBARDATA structure that identifies the appbar to activate. You must specify the cbSize and hWnd members when sending this message; all other members are ignored.
Return Value
Remarks
This message is ignored if the hWnd member of the structure pointed to by pabd identifies an autohide appbar.
Message Information
Header shellapi.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1600">
<name>BCM_FIRST</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x1601">
<name>BCM_GETIDEALSIZE</name>
<return value="BOOL">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
If the message succeeds, it returns TRUE. Otherwise it returns FALSE.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
Not used; must be zero. </wmisc>
</wparam>
<lparam value="SIZE">
<lname>pSize</lname>
<lmisc>pSize
A pointer to a SIZE structure that receives the desired size of the button, including text and image list, if present. The calling application is responsible for allocating this structure. Set the cx and cy members to zero to have the ideal height and width returned in the SIZE structure. To specify a button width, set the cx member to the desired button width. The system will calculate the ideal height for this width and return it in the cy member.
Windows XP and earlier: A pointer to a SIZE structure that receives the ideal height and width of the button, including text and image list if present. The calling process is responsible for allocating this structure.</lmisc>
</lparam>
<misc>BCM_GETIDEALSIZE Message
Gets the size of the button that best fits its text and image, if an image list is present. You can send this message explicitly or use the Button_GetIdealSize macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) BCM_GETIDEALSIZE, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (SIZE*) pSize;
);
Parameters
wParam
Not used; must be zero.
pSize
A pointer to a SIZE structure that receives the desired size of the button, including text and image list, if present. The calling application is responsible for allocating this structure. Set the cx and cy members to zero to have the ideal height and width returned in the SIZE structure. To specify a button width, set the cx member to the desired button width. The system will calculate the ideal height for this width and return it in the cy member.
Windows XP and earlier: A pointer to a SIZE structure that receives the ideal height and width of the button, including text and image list if present. The calling process is responsible for allocating this structure.
Return Value
If the message succeeds, it returns TRUE. Otherwise it returns FALSE.
Remarks
Note Windows Vista and later: If no special button width is desired, then you must set both members of SIZE to zero to calculate and return the ideal height and width. If the value of the cx member is greater than zero, then this value is considered the desired button width, and the ideal height for this width is calculated and returned in the cy member. The functionality of returning an ideal height for a specified button width is not available in Microsoft Windows XP.
This message is most applicable to PushButtons. When sent to a PushButton, the message retrieves the bounding rectangle required to display the button's text. Additionally, if the PushButton has an image list, the bounding rectangle is also sized to include the button's image.
When sent to a button of any other type, the size of the control's window rectangle is retrieved.
Note To use this message, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.
Message Information
Header Declared in Commctrl.h
Minimum operating systems Windows XP</misc>
</message>
<message value="0x1603">
<name>BCM_GETIMAGELIST</name>
<return value="BOOL">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
If the message succeeds, it returns TRUE. Otherwise it returns FALSE.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
Not used; must be zero. </wmisc>
</wparam>
<lparam value="PBUTTON_IMAGELIST">
<lname>pbuttonimagelist</lname>
<lmisc> pbuttonimagelist
A pointer to a BUTTON_IMAGELIST structure that contains image list information. </lmisc>
</lparam>
<misc>BCM_GETIMAGELIST Message
Gets the BUTTON_IMAGELIST structure that describes the image list assigned to a button control. You can send this message explicitly or use the Button_GetImageList macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) BCM_GETIMAGELIST, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (PBUTTON_IMAGELIST) pbuttonimagelist;
);
Parameters
wParam
Not used; must be zero.
pbuttonimagelist
A pointer to a BUTTON_IMAGELIST structure that contains image list information.
Return Value
If the message succeeds, it returns TRUE. Otherwise it returns FALSE.
Remarks
Note To use this message, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.
Message Information
Header Declared in Commctrl.h
Minimum operating systems Windows XP</misc>
</message>
<message value="0x1605">
<name>BCM_GETTEXTMARGIN</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
Not used; must be zero. </wmisc>
</wparam>
<lparam value="RECT">
<lname>pmargin</lname>
<lmisc> pmargin
A pointer to a RECT structure that contains the margins to use for drawing text. </lmisc>
</lparam>
<misc>BCM_GETTEXTMARGIN Message
Gets the margins used to draw text in a button control. You can send this message explicitly or use the Button_GetTextMargin macro.
Syntax
To send this message, call the SendMessage function as follows.
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) BCM_GETTEXTMARGIN, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (RECT*) pmargin;
);
Parameters
wParam
Not used; must be zero.
pmargin
A pointer to a RECT structure that contains the margins to use for drawing text.
Return Value
Remarks
Note To use this message, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.
Message Information
Header Declared in Commctrl.h
Minimum operating systems Windows XP</misc>
</message>
<message value="0x1602">
<name>BCM_SETIMAGELIST</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
Not used; must be zero.</wmisc>
</wparam>
<lparam value="PBUTTON_IMAGELIST">
<lname>pbuttonimagelist</lname>
<lmisc> pbuttonimagelist
A pointer to a BUTTON_IMAGELIST structure that contains image list information.</lmisc>
</lparam>
<misc>BCM_SETIMAGELIST Message
Assigns an image list to a button control. You can send this message explicitly or use the Button_SetImageList macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) BCM_SETIMAGELIST, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (PBUTTON_IMAGELIST) pbuttonimagelist;
);
Parameters
wParam
Not used; must be zero.
pbuttonimagelist
A pointer to a BUTTON_IMAGELIST structure that contains image list information.
Return Value
Remarks
Note To use this message, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.
The image list referred to in the himl member of the BUTTON_IMAGELIST structure should contain either a single image to be used for all states or individual images for each state. The following states are defined in vssym32.h.
Copy Code
enum PUSHBUTTONSTATES {
PBS_NORMAL = 1,
PBS_HOT = 2,
PBS_PRESSED = 3,
PBS_DISABLED = 4,
PBS_DEFAULTED = 5,
PBS_STYLUSHOT = 6,
};
Note that PBS_STYLUSHOT is used only on tablet computers.
Each value is an index to the appropriate image in the image list. If only one image is present, it is used for all states. If the image list contains more than one image, each index corresponds to one state of the button. If an image is not provided for each state, nothing is drawn for those states without images.
Message Information
Header Declared in Commctrl.h
Minimum operating systems Windows XP</misc>
</message>
<message value="0x1604">
<name>BCM_SETTEXTMARGIN</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
Not used; must be zero. </wmisc>
</wparam>
<lparam value="RECT">
<lname>pmargin</lname>
<lmisc> pmargin
A pointer to a RECT structure that specifies the margins to use for drawing text. </lmisc>
</lparam>
<misc>BCM_SETTEXTMARGIN Message
The BCM_SETTEXTMARGIN message sets the margins for drawing text in a button control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) BCM_SETTEXTMARGIN, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (RECT*) pmargin;
);
Parameters
wParam
Not used; must be zero.
pmargin
A pointer to a RECT structure that specifies the margins to use for drawing text.
Return Value
Remarks
Note To use this API, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.
Message Information
Header Declared in Commctrl.h
Minimum operating systems Windows XP</misc>
</message>
<message value="0xF5">
<name>BM_CLICK</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
Not used; must be zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc> lParam
Not used; must be zero. </lmisc>
</lparam>
<misc>BM_CLICK Message
Simulates the user clicking a button. This message causes the button to receive the WM_LBUTTONDOWN and WM_LBUTTONUP messages, and the button's parent window to receive a BN_CLICKED notification message.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) BM_CLICK, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
Remarks
If the button is in a dialog box and the dialog box is not active, the BM_CLICK message might fail. To ensure success in this situation, call the SetActiveWindow function to activate the dialog box before sending the BM_CLICK message to the button.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.5</misc>
</message>
<message value="0xF0">
<name>BM_GETCHECK</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
Not used; must be zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc> lParam
Not used; must be zero. </lmisc>
</lparam>
<misc>BM_GETCHECK Message
Gets the check state of a radio button or check box. You can send this message explicitly or use the Button_GetCheck macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) BM_GETCHECK, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
The return value from a button created with the BS_AUTOCHECKBOX, BS_AUTORADIOBUTTON, BS_AUTO3STATE, BS_CHECKBOX, BS_RADIOBUTTON, or BS_3STATE style can be one of the following.
BST_CHECKED Button is checked.
BST_INDETERMINATE Button is grayed, indicating an indeterminate state (applies only if the button has the BS_3STATE or BS_AUTO3STATE style).
BST_UNCHECKED Button is cleared
Remarks
If the button has a style other than those listed, the return value is zero.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0xF6">
<name>BM_GETIMAGE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
The type of image to associate with the button. This parameter can be one of the following values.
IMAGE_BITMAP
IMAGE_ICON</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc> lParam
This parameter is not used. </lmisc>
</lparam>
<misc>BM_GETIMAGE Message
Retrieves a handle to the image (icon or bitmap) associated with the button.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) BM_GETIMAGE, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
The type of image to associate with the button. This parameter can be one of the following values.
IMAGE_BITMAP
IMAGE_ICON
lParam
This parameter is not used.
Return Value
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0xF2">
<name>BM_GETSTATE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
The return value specifies the current state of the button. It is a combination of the following values.
BST_CHECKED The button is checked.
BST_FOCUS The button has the keyboard focus.
BST_HOT The button is hot; that is, the mouse is hovering over it.
BST_INDETERMINATE The state of the button is indeterminate. Applies only if the button has the BS_3STATE or BS_AUTO3STATE style.
BST_PUSHED The button is being shown in the pushed state.
BST_UNCHECKED No special state. Equivalent to zero.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
Not used; must be zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc> lParam
Not used; must be zero. </lmisc>
</lparam>
<misc>BM_GETSTATE Message
Retrieves the state of a button or check box. You can send this message explicitly or use the Button_GetState macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) BM_GETSTATE, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
The return value specifies the current state of the button. It is a combination of the following values.
BST_CHECKED The button is checked.
BST_FOCUS The button has the keyboard focus.
BST_HOT The button is hot; that is, the mouse is hovering over it.
BST_INDETERMINATE The state of the button is indeterminate. Applies only if the button has the BS_3STATE or BS_AUTO3STATE style.
BST_PUSHED The button is being shown in the pushed state.
BST_UNCHECKED No special state. Equivalent to zero.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0xF1">
<name>BM_SETCHECK</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
The check state. This parameter can be one of the following values.
BST_CHECKED
Sets the button state to checked.
BST_INDETERMINATE
Sets the button state to grayed, indicating an indeterminate state. Use this value only if the button has the BS_3STATE or BS_AUTO3STATE style.
BST_UNCHECKED
Sets the button state to cleared.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc> lParam
This parameter is not used. </lmisc>
</lparam>
<misc>BM_SETCHECK Message
Sets the check state of a radio button or check box. You can send this message explicitly or by using the Button_SetCheck macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) BM_SETCHECK, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
The check state. This parameter can be one of the following values.
BST_CHECKED
Sets the button state to checked.
BST_INDETERMINATE
Sets the button state to grayed, indicating an indeterminate state. Use this value only if the button has the BS_3STATE or BS_AUTO3STATE style.
BST_UNCHECKED
Sets the button state to cleared.
lParam
This parameter is not used.
Return Value
Remarks
The BM_SETCHECK message has no effect on push buttons.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0xF7">
<name>BM_SETIMAGE</name>
<return value="">
<returninfo> returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
The type of image to associate with the button. This parameter can be one of the following values:
* IMAGE_BITMAP
* IMAGE_ICON
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc> lParam
A handle to the image to associate with the button. </lmisc>
</lparam>
<misc>BM_SETIMAGE Message
Associates a new image (icon or bitmap) with the button.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) BM_SETIMAGE, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
The type of image to associate with the button. This parameter can be one of the following values:
* IMAGE_BITMAP
* IMAGE_ICON
lParam
A handle to the image to associate with the button.
Return Value
Remarks
The appearance of text, an icon, or both on a button control depends on the BS_ICON and BS_BITMAP styles, and whether the BM_SETIMAGE message is called. The possible results are as follows:
BS_ICON or BS_BITMAP Set? BM_SETIMAGE Called? Result
Yes Yes Show icon only.
No Yes Show icon and text.
Yes No Show text only.
No No Show text only
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0xF3">
<name>BM_SETSTATE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies whether the button is highlighted. A value of TRUE highlights the button. A value of FALSE removes any highlighting.
lParam</wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc> lParam
This parameter is not used. </lmisc>
</lparam>
<misc>BM_SETSTATE Message
Sets the highlight state of a button. The highlight state indicates whether the button is highlighted as if the user had pushed it. You can send this message explicitly or use the Button_SetState macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) BM_SETSTATE, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Specifies whether the button is highlighted. A value of TRUE highlights the button. A value of FALSE removes any highlighting.
lParam
Not used.
Return Value
Remarks
Highlighting affects only the appearance of a button. It has no effect on the check state of a radio button or check box.
A button is automatically highlighted when the user positions the cursor over it and presses and holds the left mouse button. The highlighting is removed when the user releases the mouse button.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0xF4">
<name>BM_SETSTYLE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
The button style. This parameter can be a combination of button styles. For a table of button styles, see Button Styles. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc> lParam
The LOWORD of lParam specifies whether the button is to be redrawn. A value of TRUE redraws the button; a value of FALSE does not redraw the button. </lmisc>
</lparam>
<misc>BM_SETSTYLE Message
Sets the style of a button. You can send this message explicitly or use the Button_SetStyle macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) BM_SETSTYLE, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
The button style. This parameter can be a combination of button styles. For a table of button styles, see Button Styles.
lParam
The LOWORD of lParam specifies whether the button is to be redrawn. A value of TRUE redraws the button; a value of FALSE does not redraw the button.
Return Value
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x143">
<name>CB_ADDSTRING</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
This parameter is not used. </wmisc>
</wparam>
<lparam value="LPCTSTR">
<lname>lParam</lname>
<lmisc>lParam
A pointer to the null-terminated string to be added. If you create the combo box with an owner-drawn style but without the CBS_HASSTRINGS style, the value of the lParam parameter is stored as item data rather than the string it would otherwise point to. The item data can be retrieved or modified by sending the CB_GETITEMDATA or CB_SETITEMDATA message. </lmisc>
</lparam>
<misc>CB_ADDSTRING Message
Adds a string to the list box of a combo box. If the combo box does not have the CBS_SORT style, the string is added to the end of the list. Otherwise, the string is inserted into the list, and the list is sorted.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) CB_ADDSTRING, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPCTSTR) lParam;
);
Parameters
wParam
This parameter is not used.
lParam
A pointer to the null-terminated string to be added. If you create the combo box with an owner-drawn style but without the CBS_HASSTRINGS style, the value of the lParam parameter is stored as item data rather than the string it would otherwise point to. The item data can be retrieved or modified by sending the CB_GETITEMDATA or CB_SETITEMDATA message.
Return Value
Remarks
If you create an owner-drawn combo box with the CBS_SORT style but without the CBS_HASSTRINGS style, the WM_COMPAREITEM message is sent one or more times to the owner of the combo box so the new item can be properly placed in the list.
To insert a string at a specific location within the list, use the CB_INSERTSTRING message.
If the combo box has WS_HSCROLL style and you add a string wider than the combo box, send a LB_SETHORIZONTALEXTENT message to ensure the horizontal scrollbar appears.
Comclt32.dll version 5.0 or later: If CBS_LOWERCASE or CBS_UPPERCASE is set, the Unicode version of CB_ADDSTRING alters the string. If using read-only global memory, this causes the application to fail.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x144">
<name>CB_DELETESTRING</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
The zero-based index of the string to delete. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc> lParam
This parameter is not used. </lmisc>
</lparam>
<misc>CB_DELETESTRING Message
Deletes a string in the list box of a combo box.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) CB_DELETESTRING, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
The zero-based index of the string to delete.
lParam
This parameter is not used.
Return Value
The return value is a count of the strings remaining in the list. If the wParam parameter specifies an index greater than the number of items in the list, the return value is CB_ERR.
Remarks
If you create the combo box with an owner-drawn style but without the CBS_HASSTRINGS style, the system sends a WM_DELETEITEM message to the owner of the combo box so the application can free any additional data associated with the item.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x145">
<name>CB_DIR</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
If the message succeeds, the return value is the zero-based index of the last name added to the list.
If an error occurs, the return value is CB_ERR. If there is insufficient space to store the new strings, the return value is CB_ERRSPACE.
</returnmisc>
</return>
<wparam value="UINT">
<wname>wParam</wname>
<wmisc> wParam
The attributes of the files or directories to be added to the combo box. This parameter can be one or more of the following values.
DDL_ARCHIVE
Includes archived files.
DDL_DIRECTORY
Includes subdirectories, which are enclosed in square brackets ([ ]).
DDL_DRIVES
All mapped drives are added to the list. Drives are listed in the form [-x-], where x is the drive letter.
DDL_EXCLUSIVE
Includes only files with the specified attributes. By default, read-write files are listed even if DDL_READWRITE is not specified.
DDL_HIDDEN
Includes hidden files.
DDL_READONLY
Includes read-only files.
DDL_READWRITE
Includes read-write files with no additional attributes. This is the default.
DDL_SYSTEM
Includes system files.</wmisc>
</wparam>
<lparam value="LPCTSTR">
<lname>lParam</lname>
<lmisc> lParam
A pointer to a null-terminated string that specifies an absolute path, relative path, or file name. An absolute path can begin with a drive letter (for example, d:\) or a Universal Naming Convention (UNC) name (for example, \\machinename\sharename). If the string specifies a file name or directory that has the attributes specified by the wParam parameter, the file name or directory is added to the list. If the file name or directory name contains wildcard characters (? or *), all files or directories that match the wildcard expression and have the attributes specified by the wParam parameter are added to the list displayed in the combo box.</lmisc>
</lparam>
<misc>CB_DIR Message
Adds names to the list displayed by the combo box. The message adds the names of directories and files that match a specified string and set of file attributes. CB_DIR can also add mapped drive letters to the list.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) CB_DIR, // message ID
(WPARAM) wParam, // = (WPARAM) (UINT) wParam;
(LPARAM) lParam // = (LPARAM) (LPCTSTR) lParam;
);
Parameters
wParam
The attributes of the files or directories to be added to the combo box. This parameter can be one or more of the following values.
DDL_ARCHIVE
Includes archived files.
DDL_DIRECTORY
Includes subdirectories, which are enclosed in square brackets ([ ]).
DDL_DRIVES
All mapped drives are added to the list. Drives are listed in the form [-x-], where x is the drive letter.
DDL_EXCLUSIVE
Includes only files with the specified attributes. By default, read-write files are listed even if DDL_READWRITE is not specified.
DDL_HIDDEN
Includes hidden files.
DDL_READONLY
Includes read-only files.
DDL_READWRITE
Includes read-write files with no additional attributes. This is the default.
DDL_SYSTEM
Includes system files.
lParam
A pointer to a null-terminated string that specifies an absolute path, relative path, or file name. An absolute path can begin with a drive letter (for example, d:\) or a Universal Naming Convention (UNC) name (for example, \\machinename\sharename). If the string specifies a file name or directory that has the attributes specified by the wParam parameter, the file name or directory is added to the list. If the file name or directory name contains wildcard characters (? or *), all files or directories that match the wildcard expression and have the attributes specified by the wParam parameter are added to the list displayed in the combo box.
Return Value
If the message succeeds, the return value is the zero-based index of the last name added to the list.
If an error occurs, the return value is CB_ERR. If there is insufficient space to store the new strings, the return value is CB_ERRSPACE.
Remarks
Windows NT 4.0 and later: If wParam includes the DDL_DIRECTORY flag and lParam specifies all the subdirectories of a first-level directory, such as C:\TEMP\*, the list box will always include a ".." entry for the root directory. This is true even if the root directory has hidden or system attributes and the DDL_HIDDEN and DDL_SYSTEM flags are not specified. The root directory of an NTFS volume has hidden and system attributes.
Windows NT/2000/XP: The list displays long file names, if any.
Windows 95/98/Me: The list displays short file names (the 8.3 form). You can use the SHGetFileInfo or GetFullPathName function to get the corresponding long file name.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0xFFFFFFFFFFFFFFFF">
<name>CB_ERR</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0xFFFFFFFFFFFFFFFE">
<name>CB_ERRSPACE</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x14C">
<name>CB_FINDSTRING</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
The zero-based index of the item preceding the first item to be searched. When the search reaches the bottom of the list box, it continues from the top of the list box back to the item specified by the wParam parameter. If wParam is 1, the entire list box is searched from the beginning. </wmisc>
</wparam>
<lparam value="LPCSTR">
<lname>lParam</lname>
<lmisc>lParam
A pointer to the null-terminated string that contains the characters for which to search. The search is not case sensitive, so this string can contain any combination of uppercase and lowercase letters.
</lmisc>
</lparam>
<misc>CB_FINDSTRING Message
Searches the list box of a combo box for an item beginning with the characters in a specified string.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) CB_FINDSTRING, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) (LPCSTR) lParam;
);
Parameters
wParam
The zero-based index of the item preceding the first item to be searched. When the search reaches the bottom of the list box, it continues from the top of the list box back to the item specified by the wParam parameter. If wParam is 1, the entire list box is searched from the beginning.
lParam
A pointer to the null-terminated string that contains the characters for which to search. The search is not case sensitive, so this string can contain any combination of uppercase and lowercase letters.
Return Value
Remarks
If you create the combo box with an owner-drawn style but without the CBS_HASSTRINGS style, what the CB_FINDSTRING message does depends on whether your application uses the CBS_SORT style. If you use the CBS_SORT style, WM_COMPAREITEM messages are sent to the owner of the combo box to determine which item matches the specified string. If you do not use the CBS_SORT style, the CB_FINDSTRING message searches for a list item that matches the value of the lParam parameter.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x158">
<name>CB_FINDSTRINGEXACT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
The zero-based index of the item preceding the first item to be searched. When the search reaches the bottom of the list box, it continues from the top of the list box back to the item specified by the wParam parameter. If wParam is 1, the entire list box is searched from the beginning. </wmisc>
</wparam>
<lparam value="LPCSTR">
<lname>lParam</lname>
<lmisc> lParam
A pointer to the null-terminated string for which to search. This string can contain a complete file name, including the extension. The search is not case sensitive, so this string can contain any combination of uppercase and lowercase letters.
</lmisc>
</lparam>
<misc>CB_FINDSTRINGEXACT Message
Finds the first list box string in a combo box that matches the string specified in the lParam parameter.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) CB_FINDSTRINGEXACT, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) (LPCSTR) lParam;
);
Parameters
wParam
The zero-based index of the item preceding the first item to be searched. When the search reaches the bottom of the list box, it continues from the top of the list box back to the item specified by the wParam parameter. If wParam is 1, the entire list box is searched from the beginning.
lParam
A pointer to the null-terminated string for which to search. This string can contain a complete file name, including the extension. The search is not case sensitive, so this string can contain any combination of uppercase and lowercase letters.
Return Value
Remarks
This function is successful only if the specified string and a combo box item have the same length (except for the terminating null character) and the same characters.
If you create the combo box with an owner-drawn style but without the CBS_HASSTRINGS style, the functionality of CB_FINDSTRINGEXACT message depends on whether your application uses the CBS_SORT style. If you use the CBS_SORT style, WM_COMPAREITEM messages are sent to the owner of the combo box to determine which item matches the specified string. If you do not use the CBS_SORT style, the CB_FINDSTRINGEXACT message searches for a list item that matches the value of the lParam parameter.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x164">
<name>CB_GETCOMBOBOXINFO</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
This parameter is not used. </wmisc>
</wparam>
<lparam value="COMBOBOXINFO">
<lname>pcbi</lname>
<lmisc> pcbi
[out] A pointer to a COMBOBOXINFO structure that receives the information. </lmisc>
</lparam>
<misc>CB_GETCOMBOBOXINFO Message
Gets information about the specified combo box.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) CB_GETCOMBOBOXINFO, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (COMBOBOXINFO*) pcbi;
);
Parameters
wParam
This parameter is not used.
pcbi
[out] A pointer to a COMBOBOXINFO structure that receives the information.
Return Value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
This message is equivalent to GetComboBoxInfo.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows XP</misc>
</message>
<message value="0x146">
<name>CB_GETCOUNT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
The return value is the number of items in the list box. If an error occurs, it is CB_ERR. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
Not used; must be zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc> lParam
Not used; must be zero. </lmisc>
</lparam>
<misc>CB_GETCOUNT Message
Gets the number of items in the list box of a combo box.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) CB_GETCOUNT, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
The return value is the number of items in the list box. If an error occurs, it is CB_ERR.
Remarks
The index is zero-based, so the returned count is one greater than the index value of the last item.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x147">
<name>CB_GETCURSEL</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
The return value is the zero-based index of the currently selected item. If no item is selected, it is CB_ERR. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
Not used; must be zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc> lParam
Not used; must be zero.</lmisc>
</lparam>
<misc>CB_GETCURSEL Message
An application sends a CB_GETCURSEL message to retrieve the index of the currently selected item, if any, in the list box of a combo box.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) CB_GETCURSEL, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
The return value is the zero-based index of the currently selected item. If no item is selected, it is CB_ERR.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x152">
<name>CB_GETDROPPEDCONTROLRECT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
If the message succeeds, the return value is nonzero.
If the message fails, the return value is zero.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
This parameter is not used. </wmisc>
</wparam>
<lparam value="RECT">
<lname>lParam</lname>
<lmisc> lParam
A pointer to the RECT structure that receives the coordinates of the combo box in its dropped-down state.
</lmisc>
</lparam>
<misc>CB_GETDROPPEDCONTROLRECT Message
An application sends a CB_GETDROPPEDCONTROLRECT message to retrieve the screen coordinates of a combo box in its dropped-down state.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) CB_GETDROPPEDCONTROLRECT, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (RECT*) lParam;
);
Parameters
wParam
This parameter is not used.
lParam
A pointer to the RECT structure that receives the coordinates of the combo box in its dropped-down state.
Return Value
If the message succeeds, the return value is nonzero.
If the message fails, the return value is zero.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x157">
<name>CB_GETDROPPEDSTATE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
Not used; must be zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc> lParam
Not used; must be zero. </lmisc>
</lparam>
<misc>CB_GETDROPPEDSTATE Message
Determines whether the list box of a combo box is dropped down.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) CB_GETDROPPEDSTATE, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x15f">
<name>CB_GETDROPPEDWIDTH</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
If the message succeeds, the return value is the width, in pixels.
If the message fails, the return value is CB_ERR.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
Not used; must be zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc> lParam
Not used; must be zero. </lmisc>
</lparam>
<misc>CB_GETDROPPEDWIDTH Message
Gets the minimum allowable width, in pixels, of the list box of a combo box with the CBS_DROPDOWN or CBS_DROPDOWNLIST style.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) CB_GETDROPPEDWIDTH, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
If the message succeeds, the return value is the width, in pixels.
If the message fails, the return value is CB_ERR.
Remarks
By default, the minimum allowable width of the drop-down list box is zero. The width of the list box is either the minimum allowable width or the combo box width, whichever is larger.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0x140">
<name>CB_GETEDITSEL</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
The return value is a zero-based DWORD value with the starting position of the selection in the low-order word and with the ending position of the first character after the last selected character in the high-order word.
</returnmisc>
</return>
<wparam value="LPDWORD">
<wname>wParam</wname>
<wmisc>wParam
A pointer to a DWORD value that receives the starting position of the selection. This parameter can be NULL. </wmisc>
</wparam>
<lparam value="LPDWORD">
<lname>lParam</lname>
<lmisc> lParam
A pointer to a DWORD value that receives the ending position of the selection. This parameter can be NULL.
</lmisc>
</lparam>
<misc>CB_GETEDITSEL Message
Gets the starting and ending character positions of the current selection in the edit control of a combo box.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) CB_GETEDITSEL, // message ID
(WPARAM) wParam, // = (WPARAM) (LPDWORD) wParam;
(LPARAM) lParam // = (LPARAM) (LPDWORD) lParam;
);
Parameters
wParam
A pointer to a DWORD value that receives the starting position of the selection. This parameter can be NULL.
lParam
A pointer to a DWORD value that receives the ending position of the selection. This parameter can be NULL.
Return Value
The return value is a zero-based DWORD value with the starting position of the selection in the low-order word and with the ending position of the first character after the last selected character in the high-order word.
Example
The following code example shows two ways of retrieving the current selection range.
Copy Code
DWORD start, end;
// Get the range from [out] parameters.
// hwnd is the handle of the combo box control.
SendMessage(hwnd, CB_GETEDITSEL, (WPARAM)start, (LPARAM)end
// Get the range from the return value.
DWORD range = SendMessage(hwnd, CB_GETEDITSEL, NULL, NULL);
start = LOWORD(range);
end = HIWORD(range);
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x156">
<name>CB_GETEXTENDEDUI</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
Not used; must be zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc> lParam
Not used; must be zero. </lmisc>
</lparam>
<misc>CB_GETEXTENDEDUI Message
Determines whether a combo box has the default user interface or the extended user interface.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) CB_GETEXTENDEDUI, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
Remarks
By default, the F4 key opens or closes the list and the DOWN ARROW changes the current selection. In a combo box with the extended user interface, the F4 key is disabled and pressing the DOWN ARROW key opens the drop-down list.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x15d">
<name>CB_GETHORIZONTALEXTENT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
Not used; must be zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc> lParam
Not used; must be zero.
</lmisc>
</lparam>
<misc>CB_GETHORIZONTALEXTENT Message
Gets the width, in pixels, that the list box can be scrolled horizontally (the scrollable width). This is applicable only if the list box has a horizontal scroll bar.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) CB_GETHORIZONTALEXTENT, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0x150">
<name>CB_GETITEMDATA</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>
Return Value
The return value is the value associated with the item. If an error occurs, it is CB_ERR.
If the item is in an owner-drawn combo box created without the CBS_HASSTRINGS style, the return value is the value contained in the lParam parameter of the CB_ADDSTRING or CB_INSERTSTRING message, that added the item to the combo box. If the CBS_HASSTRINGS style was not used, the return value is the lParam parameter contained in a CB_SETITEMDATA message.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
The zero-based index of the item. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc> lParam
This parameter is not used. </lmisc>
</lparam>
<misc>CB_GETITEMDATA Message
An application sends a CB_GETITEMDATA message to a combo box to retrieve the application-supplied value associated with the specified item in the combo box.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) CB_GETITEMDATA, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
The zero-based index of the item.
lParam
This parameter is not used.
Return Value
The return value is the value associated with the item. If an error occurs, it is CB_ERR.
If the item is in an owner-drawn combo box created without the CBS_HASSTRINGS style, the return value is the value contained in the lParam parameter of the CB_ADDSTRING or CB_INSERTSTRING message, that added the item to the combo box. If the CBS_HASSTRINGS style was not used, the return value is the lParam parameter contained in a CB_SETITEMDATA message.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x154">
<name>CB_GETITEMHEIGHT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
The return value is the height, in pixels, of the list items in a combo box. If the combo box has the CBS_OWNERDRAWVARIABLE style, it is the height of the item specified by the wParam parameter. If wParam is 1, the return value is the height of the edit control (or static-text) portion of the combo box. If an error occurs, the return value is CB_ERR.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
The combo box component whose height is to be retrieved. This parameter must be 1 to retrieve the height of the selection field. It must be zero to retrieve the height of list items, unless the combo box has the CBS_OWNERDRAWVARIABLE style. In that case, the wParam parameter is the zero-based index of a specific list item. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc> lParam
This parameter is not used.
</lmisc>
</lparam>
<misc>CB_GETITEMHEIGHT Message
Determines the height of list items or the selection field in a combo box.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) CB_GETITEMHEIGHT, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
The combo box component whose height is to be retrieved. This parameter must be 1 to retrieve the height of the selection field. It must be zero to retrieve the height of list items, unless the combo box has the CBS_OWNERDRAWVARIABLE style. In that case, the wParam parameter is the zero-based index of a specific list item.
lParam
This parameter is not used.
Return Value
The return value is the height, in pixels, of the list items in a combo box. If the combo box has the CBS_OWNERDRAWVARIABLE style, it is the height of the item specified by the wParam parameter. If wParam is 1, the return value is the height of the edit control (or static-text) portion of the combo box. If an error occurs, the return value is CB_ERR.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x148">
<name>CB_GETLBTEXT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
The return value is the length of the string, in TCHARs, excluding the terminating null character. If wParam does not specify a valid index, the return value is CB_ERR.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
The zero-based index of the string to retrieve. </wmisc>
</wparam>
<lparam value="LPTSTR">
<lname>lParam</lname>
<lmisc>lParam
A pointer to the buffer that receives the string. The buffer must have sufficient space for the string and a terminating null character. You can send a CB_GETLBTEXTLEN message prior to the CB_GETLBTEXT message to retrieve the length, in TCHARs, of the string. If it is an ANSI string this is the number of bytes, but if it is a Unicode string this is the number of characters.
</lmisc>
</lparam>
<misc>CB_GETLBTEXT Message
Gets a string from the list of a combo box.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) CB_GETLBTEXT, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) (LPTSTR) lParam;
);
Parameters
wParam
The zero-based index of the string to retrieve.
lParam
A pointer to the buffer that receives the string. The buffer must have sufficient space for the string and a terminating null character. You can send a CB_GETLBTEXTLEN message prior to the CB_GETLBTEXT message to retrieve the length, in TCHARs, of the string. If it is an ANSI string this is the number of bytes, but if it is a Unicode string this is the number of characters.
Return Value
The return value is the length of the string, in TCHARs, excluding the terminating null character. If wParam does not specify a valid index, the return value is CB_ERR.
Remarks
security note Security Alert Using this message incorrectly can compromise the security of your program. This message does not provide a way for you to know the size of the buffer. If you use this message, first call CB_GETLBTEXTLEN to get the number of characters that are required and then call the message to retrieve the string. You should review the Security Considerations: Microsoft Windows Controls before continuing.
If you create the combo box with an owner-drawn style but without the CBS_HASSTRINGS style, the buffer pointed to by lParam receives the data associated with the item.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x149">
<name>CB_GETLBTEXTLEN</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
The return value is the length of the string, in TCHARs, excluding the terminating null character. If wParam does not specify a valid index, the return value is CB_ERR.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
The zero-based index of the string to retrieve. </wmisc>
</wparam>
<lparam value="LPTSTR">
<lname>lParam</lname>
<lmisc> lParam
A pointer to the buffer that receives the string. The buffer must have sufficient space for the string and a terminating null character. You can send a CB_GETLBTEXTLEN message prior to the CB_GETLBTEXT message to retrieve the length, in TCHARs, of the string. If it is an ANSI string this is the number of bytes, but if it is a Unicode string this is the number of characters.
</lmisc>
</lparam>
<misc>CB_GETLBTEXT Message
Gets a string from the list of a combo box.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) CB_GETLBTEXT, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) (LPTSTR) lParam;
);
Parameters
wParam
The zero-based index of the string to retrieve.
lParam
A pointer to the buffer that receives the string. The buffer must have sufficient space for the string and a terminating null character. You can send a CB_GETLBTEXTLEN message prior to the CB_GETLBTEXT message to retrieve the length, in TCHARs, of the string. If it is an ANSI string this is the number of bytes, but if it is a Unicode string this is the number of characters.
Return Value
The return value is the length of the string, in TCHARs, excluding the terminating null character. If wParam does not specify a valid index, the return value is CB_ERR.
Remarks
security note Security Alert Using this message incorrectly can compromise the security of your program. This message does not provide a way for you to know the size of the buffer. If you use this message, first call CB_GETLBTEXTLEN to get the number of characters that are required and then call the message to retrieve the string. You should review the Security Considerations: Microsoft Windows Controls before continuing.
If you create the combo box with an owner-drawn style but without the CBS_HASSTRINGS style, the buffer pointed to by lParam receives the data associated with the item.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x15A">
<name>CB_GETLOCALE</name>
<return value="LCID">
<returninfo>returns LCID in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
Not used; must be zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc> lParam
Not used; must be zero. </lmisc>
</lparam>
<misc>CB_GETLOCALE Message
Gets the current locale of the combo box. The locale is used to determine the correct sorting order of displayed text for combo boxes with the CBS_SORT style and text added by using the CB_ADDSTRING message.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LCID in lResult
(HWND) hWndControl, // handle to destination control
(UINT) CB_GETLOCALE, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
Remarks
The language identifier is made up of a sublanguage identifier and a primary language identifier. The PRIMARYLANGID macro obtains the primary language identifier and the SUBLANGID macro obtains the sublanguage identifier.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x15b">
<name>CB_GETTOPINDEX</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
If the message is successful, the return value is the index of the first visible item in the list box of the combo box.
If the message fails, the return value is CB_ERR.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
Not used; must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc> lParam
Not used; must be zero.</lmisc>
</lparam>
<misc>CB_GETTOPINDEX Message
An application sends the CB_GETTOPINDEX message to retrieve the zero-based index of the first visible item in the list box portion of a combo box. Initially, the item with index 0 is at the top of the list box, but if the list box contents have been scrolled, another item may be at the top.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) CB_GETTOPINDEX, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
If the message is successful, the return value is the index of the first visible item in the list box of the combo box.
If the message fails, the return value is CB_ERR.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0x161">
<name>CB_INITSTORAGE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
If the message is successful, the return value is the total number of items for which memory has been pre-allocated, that is, the total number of items added by all successful CB_INITSTORAGE messages.
If the message fails, the return value is CB_ERRSPACE.
Windows NT 4.0: This message does not allocate the specified amount of memory; however, it always returns the value specified in the wParam parameter.
Windows 2000/XP: The message allocates memory and returns the success and error values described above.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
The number of items to add. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc> lParam
The amount of memory to allocate for item strings, in bytes. </lmisc>
</lparam>
<misc>CB_INITSTORAGE Message
An application sends the CB_INITSTORAGE message before adding a large number of items to the list box portion of a combo box. This message allocates memory for storing list box items.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) CB_INITSTORAGE, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
The number of items to add.
lParam
The amount of memory to allocate for item strings, in bytes.
Return Value
If the message is successful, the return value is the total number of items for which memory has been pre-allocated, that is, the total number of items added by all successful CB_INITSTORAGE messages.
If the message fails, the return value is CB_ERRSPACE.
Windows NT 4.0: This message does not allocate the specified amount of memory; however, it always returns the value specified in the wParam parameter.
Windows 2000/XP: The message allocates memory and returns the success and error values described above.
Remarks
The CB_INITSTORAGE message helps speed up the initialization of combo boxes that have a large number of items (over 100). It reserves the specified amount of memory so that subsequent CB_ADDSTRING, CB_INSERTSTRING, and CB_DIR messages take the shortest possible time. You can use estimates for the wParam and lParam parameters. If you overestimate, the extra memory is allocated, if you underestimate, the normal allocation is used for items that exceed the requested amount.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0x14A">
<name>CB_INSERTSTRING</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
The return value is the index of the position at which the string was inserted. If an error occurs, the return value is CB_ERR. If there is insufficient space available to store the new string, it is CB_ERRSPACE.
If the combo box has WS_HSCROLL style and you insert a string wider than the combo box, you should send a LB_SETHORIZONTALEXTENT message to ensure the horizontal scrollbar appears.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
The zero-based index of the position at which to insert the string. If this parameter is 1, the string is added to the end of the list. </wmisc>
</wparam>
<lparam value="LPCTSTR">
<lname>lParam</lname>
<lmisc>lParam
A pointer to the null-terminated string to be inserted. If you create the combo box with an owner-drawn style but without the CBS_HASSTRINGS style, the value of the lParam parameter is stored rather than the string to which it would otherwise point.
</lmisc>
</lparam>
<misc>CB_INSERTSTRING Message
Inserts a string or item data into the list of a combo box. Unlike the CB_ADDSTRING message, the CB_INSERTSTRING message does not cause a list with the CBS_SORT style to be sorted.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) CB_INSERTSTRING, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) (LPCTSTR) lParam;
);
Parameters
wParam
The zero-based index of the position at which to insert the string. If this parameter is 1, the string is added to the end of the list.
lParam
A pointer to the null-terminated string to be inserted. If you create the combo box with an owner-drawn style but without the CBS_HASSTRINGS style, the value of the lParam parameter is stored rather than the string to which it would otherwise point.
Return Value
The return value is the index of the position at which the string was inserted. If an error occurs, the return value is CB_ERR. If there is insufficient space available to store the new string, it is CB_ERRSPACE.
If the combo box has WS_HSCROLL style and you insert a string wider than the combo box, you should send a LB_SETHORIZONTALEXTENT message to ensure the horizontal scrollbar appears.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x141">
<name>CB_LIMITTEXT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
The maximum number of TCHARs the user can enter, not including the terminating null character. If this parameter is zero, the text length is limited to 0x7FFFFFFE characters. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc> lParam
This parameter is not used.
</lmisc>
</lparam>
<misc>CB_LIMITTEXT Message
Limits the length of the text the user may type into the edit control of a combo box.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) CB_LIMITTEXT, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
The maximum number of TCHARs the user can enter, not including the terminating null character. If this parameter is zero, the text length is limited to 0x7FFFFFFE characters.
lParam
This parameter is not used.
Return Value
Remarks
If the combo box does not have the CBS_AUTOHSCROLL style, setting the text limit to be larger than the size of the edit control has no effect.
The CB_LIMITTEXT message limits only the text the user can enter. It has no effect on any text already in the edit control when the message is sent, nor does it affect the length of the text copied to the edit control when a string in the list box is selected.
The default limit to the text a user can enter in the edit control is 30,000 TCHARs.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x100">
<name>CB_MAX_CAB_PATH</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x100">
<name>CB_MAX_CABINET_NAME</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x8000">
<name>CB_MAX_CHUNK</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x7FFFFFFF">
<name>CB_MAX_DISK</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x100">
<name>CB_MAX_DISK_NAME</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x100">
<name>CB_MAX_FILENAME</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x15B">
<name>CB_MSGMAX</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x163">
<name>CB_MULTIPLEADDSTRING</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x9">
<name>CB_OID_1</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0xa">
<name>CB_OID_2</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0xb">
<name>CB_OID_3</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0xc">
<name>CB_OID_4</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x0">
<name>CB_OKAY</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x14B">
<name>CB_RESETCONTENT</name>
<return value="CB_OKAY">
<returninfo>returns CB_OKAY in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
Not used; must be zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used; must be zero.
</lmisc>
</lparam>
<misc>CB_RESETCONTENT Message
Removes all items from the list box and edit control of a combo box.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns CB_OKAY in lResult
(HWND) hWndControl, // handle to destination control
(UINT) CB_RESETCONTENT, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
Remarks
If you create the combo box with an owner-drawn style but without the CBS_HASSTRINGS style, the owner of the combo box receives a WM_DELETEITEM message for each item in the combo box.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x14D">
<name>CB_SELECTSTRING</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
The zero-based index of the item preceding the first item to be searched. When the search reaches the bottom of the list, it continues from the top of the list back to the item specified by the wParam parameter. If wParam is 1, the entire list is searched from the beginning. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc> lParam
A pointer to the null-terminated string that contains the characters for which to search. The search is not case sensitive, so this string can contain any combination of uppercase and lowercase letters.
</lmisc>
</lparam>
<misc>CB_SELECTSTRING Message
Searches the list of a combo box for an item that begins with the characters in a specified string. If a matching item is found, it is selected and copied to the edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) CB_SELECTSTRING, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
The zero-based index of the item preceding the first item to be searched. When the search reaches the bottom of the list, it continues from the top of the list back to the item specified by the wParam parameter. If wParam is 1, the entire list is searched from the beginning.
lParam
A pointer to the null-terminated string that contains the characters for which to search. The search is not case sensitive, so this string can contain any combination of uppercase and lowercase letters.
Return Value
Remarks
A string is selected only if the characters from the starting point match the characters in the prefix string.
If you create the combo box with an owner-drawn style but without the CBS_HASSTRINGS style, what the CB_SELECTSTRING message does depends on whether you use the CBS_SORT style. If the CBS_SORT style is used, the system sends WM_COMPAREITEM messages to the owner of the combo box to determine which item matches the specified string. If you do not use the CBS_SORT style, CB_SELECTSTRING attempts to match the DWORD value against the value of the lParam parameter.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x14E">
<name>CB_SETCURSEL</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
If the message is successful, the return value is the index of the item selected. If wParam is greater than the number of items in the list or if wParam is 1, the return value is CB_ERR and the selection is cleared.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the zero-based index of the string to select. If this parameter is 1, any current selection in the list is removed and the edit control is cleared. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc> lParam
This parameter is not used. </lmisc>
</lparam>
<misc>CB_SETCURSEL Message
An application sends a CB_SETCURSEL message to select a string in the list of a combo box. If necessary, the list scrolls the string into view. The text in the edit control of the combo box changes to reflect the new selection, and any previous selection in the list is removed.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) CB_SETCURSEL, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Specifies the zero-based index of the string to select. If this parameter is 1, any current selection in the list is removed and the edit control is cleared.
lParam
This parameter is not used.
Return Value
If the message is successful, the return value is the index of the item selected. If wParam is greater than the number of items in the list or if wParam is 1, the return value is CB_ERR and the selection is cleared.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x160">
<name>CB_SETDROPPEDWIDTH</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
If the message is successful, The return value is the new width of the list box.
If the message fails, the return value is CB_ERR.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
Specifies the width of the list box, in pixels. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc> lParam
This parameter is not used. </lmisc>
</lparam>
<misc>CB_SETDROPPEDWIDTH Message
An application sends the CB_SETDROPPEDWIDTH message to set the maximum allowable width, in pixels, of the list box of a combo box with the CBS_DROPDOWN or CBS_DROPDOWNLIST style.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) CB_SETDROPPEDWIDTH, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Specifies the width of the list box, in pixels.
lParam
This parameter is not used.
Return Value
If the message is successful, The return value is the new width of the list box.
If the message fails, the return value is CB_ERR.
Remarks
By default, the minimum allowable width of the drop-down list box is zero. The width of the list box is either the minimum allowable width or the combo box width, whichever is larger.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0x142">
<name>CB_SETEDITSEL</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
This parameter is not used. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
[in] The low-order word of lParam specifies the starting position. If the low-order word is 1, the selection, if any, is removed.
The high-order word of lParam specifies the ending position. If the high-order word is 1, all text from the starting position to the last character in the edit control is selected.
</lmisc>
</lparam>
<misc>CB_SETEDITSEL Message
An application sends a CB_SETEDITSEL message to select characters in the edit control of a combo box.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) CB_SETEDITSEL, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
This parameter is not used.
lParam
[in] The low-order word of lParam specifies the starting position. If the low-order word is 1, the selection, if any, is removed.
The high-order word of lParam specifies the ending position. If the high-order word is 1, all text from the starting position to the last character in the edit control is selected.
Return Value
Remarks
The positions are zero-based. The first character of the edit control is in the zero position. The first character after the last selected character is in the ending position. For example, to select the first four characters of the edit control, use a starting position of 0 and an ending position of 4.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x155">
<name>CB_SETEXTENDEDUI</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="BOOL">
<wname>wParam</wname>
<wmisc> wParam
Specifies whether the combo box uses the extended UI (TRUE) or the default UI (FALSE).</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc> lParam
This parameter is not used. </lmisc>
</lparam>
<misc>CB_SETEXTENDEDUI Message
An application sends a CB_SETEXTENDEDUI message to select either the default user interface (UI) or the extended UI for a combo box that has the CBS_DROPDOWN or CBS_DROPDOWNLIST style.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) CB_SETEXTENDEDUI, // message ID
(WPARAM) wParam, // = (WPARAM) (BOOL) wParam;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Specifies whether the combo box uses the extended UI (TRUE) or the default UI (FALSE).
lParam
This parameter is not used.
Return Value
Remarks
By default, the F4 key opens or closes the list and the DOWN ARROW changes the current selection. In the extended UI, the F4 key is disabled and the DOWN ARROW key opens the drop-down list. The mouse wheel, which normally scrolls through the items in the list, has no effect when the extended UI is set.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x15e">
<name>CB_SETHORIZONTALEXTENT</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
No return value.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
Specifies the scrollable width of the list box, in pixels. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used. </lmisc>
</lparam>
<misc>CB_SETHORIZONTALEXTENT Message
An application sends the CB_SETHORIZONTALEXTENT message to set the width, in pixels, by which a list box can be scrolled horizontally (the scrollable width). If the width of the list box is smaller than this value, the horizontal scroll bar horizontally scrolls items in the list box. If the width of the list box is equal to or greater than this value, the horizontal scroll bar is hidden or, if the combo box has the CBS_DISABLENOSCROLL style, disabled.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage(
(HWND) hWndControl, // handle to destination control
(UINT) CB_SETHORIZONTALEXTENT, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Specifies the scrollable width of the list box, in pixels.
lParam
This parameter is not used.
Return Value
No return value.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0x151">
<name>CB_SETITEMDATA</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
Specifies the item's zero-based index. </wmisc>
</wparam>
<lparam value="DWORD">
<lname>lParam</lname>
<lmisc> lParam
Specifies the new value to be associated with the item. </lmisc>
</lparam>
<misc>CB_SETITEMDATA Message
An application sends a CB_SETITEMDATA message to set the value associated with the specified item in a combo box.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) CB_SETITEMDATA, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) (DWORD) lParam;
);
Parameters
wParam
Specifies the item's zero-based index.
lParam
Specifies the new value to be associated with the item.
Return Value
Remarks
If the specified item is in an owner-drawn combo box created without the CBS_HASSTRINGS style, this message replaces the value in the lParam parameter of the CB_ADDSTRING or CB_INSERTSTRING message that added the item to the combo box.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x153">
<name>CB_SETITEMHEIGHT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
Specifies the component of the combo box for which to set the height.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Specifies the height, in pixels, of the combo box component identified by wParam. </lmisc>
</lparam>
<misc>CB_SETITEMHEIGHT Message
An application sends a CB_SETITEMHEIGHT message to set the height of list items or the selection field in a combo box.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) CB_SETITEMHEIGHT, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Specifies the component of the combo box for which to set the height.
This parameter must be 1 to set the height of the selection field. It must be zero to set the height of list items, unless the combo box has the CBS_OWNERDRAWVARIABLE style. In that case, the wParam parameter is the zero-based index of a specific list item.
lParam
Specifies the height, in pixels, of the combo box component identified by wParam.
Return Value
Remarks
The selection field height in a combo box is set independently of the height of the list items. An application must ensure that the height of the selection field is not smaller than the height of a particular list item.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x159">
<name>CB_SETLOCALE</name>
<return value="LCID">
<returninfo>returns LCID in lResult</returninfo>
<returnmisc>Return Value
The return value is the previous locale identifier. If wParam specifies a locale not installed on the system, the return value is CB_ERR and the current combo box locale is not changed.
</returnmisc>
</return>
<wparam value="LCID">
<wname>wParam</wname>
<wmisc> wParam
Specifies the locale identifier for the combo box to use for sorting when adding text. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used. </lmisc>
</lparam>
<misc>CB_SETLOCALE Message
An application sends a CB_SETLOCALE message to set the current locale of the combo box. If the combo box has the CBS_SORT style and strings are added using CB_ADDSTRING, the locale of a combo box affects how list items are sorted.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LCID in lResult
(HWND) hWndControl, // handle to destination control
(UINT) CB_SETLOCALE, // message ID
(WPARAM) wParam, // = (WPARAM) (LCID) wParam;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Specifies the locale identifier for the combo box to use for sorting when adding text.
lParam
This parameter is not used.
Return Value
The return value is the previous locale identifier. If wParam specifies a locale not installed on the system, the return value is CB_ERR and the current combo box locale is not changed.
Remarks
Use the MAKELCID macro to construct a locale identifier and the MAKELANGID macro to construct a language identifier. The language identifier is made up of a primary language identifier and a sublanguage identifier.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x15c">
<name>CB_SETTOPINDEX</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
If the message is successful, the return value is zero.
If the message fails, the return value is CB_ERR.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the zero-based index of the list item. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used.
</lmisc>
</lparam>
<misc>CB_SETTOPINDEX Message
An application sends the CB_SETTOPINDEX message to ensure that a particular item is visible in the list box of a combo box. The system scrolls the list box contents so that either the specified item appears at the top of the list box or the maximum scroll range has been reached.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) CB_SETTOPINDEX, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Specifies the zero-based index of the list item.
lParam
This parameter is not used.
Return Value
If the message is successful, the return value is zero.
If the message fails, the return value is CB_ERR.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0x14F">
<name>CB_SHOWDROPDOWN</name>
<return value="BOOL">
<returninfo>returns BOOL in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="BOOL">
<wname>wParam</wname>
<wmisc> wParam
Specifies whether the drop-down list box is to be shown or hidden. A value of TRUE shows the list box; a value of FALSE hides it. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc> lParam
This parameter is not used. </lmisc>
</lparam>
<misc>CB_SHOWDROPDOWN Message
An application sends a CB_SHOWDROPDOWN message to show or hide the list box of a combo box that has the CBS_DROPDOWN or CBS_DROPDOWNLIST style.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns BOOL in lResult
(HWND) hWndControl, // handle to destination control
(UINT) CB_SHOWDROPDOWN, // message ID
(WPARAM) wParam, // = (WPARAM) (BOOL) wParam;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Specifies whether the drop-down list box is to be shown or hidden. A value of TRUE shows the list box; a value of FALSE hides it.
lParam
This parameter is not used.
Return Value
Remarks
This message has no effect on a combo box created with the CBS_SIMPLE style.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x2000">
<name>CCM_FIRST</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x2003">
<name>CCM_GETCOLORSCHEME</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x2004">
<name>CCM_GETDROPTARGET</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x2006">
<name>CCM_GETUNICODEFORMAT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc> lParam
Must be zero.</lmisc>
</lparam>
<misc>CCM_GETUNICODEFORMAT Message
Gets the Unicode character format flag for the control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) CCM_GETUNICODEFORMAT, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Remarks
The Unicode format flag is used by Microsoft Windows NT systems with version 4.71 of Comctl32.dll or later. This message is supported by Windows 2000 and later, and by Windows NT 4 with Microsoft Internet Explorer 4.0 or later. It is only useful on Windows 95 or Windows 98 systems with version 5.80 or later of Comctl32.dll. This means that they must have Internet Explorer 5 or later installed. Windows 95 and Windows 98 systems with earlier versions of Internet Explorer ignore the Unicode format flag, and its value has no bearing on whether a control supports Unicode. With these systems, you will instead need to test something that requires Unicode support.
The following function can be used with a Microsoft Windows 95 or Windows 98 system to test whether or not a property sheet control supports Unicode.
Copy Code
BOOL IsComctl32Unicode(void)
{
PROPSHEETPAGEW pspW = { PROPSHEETPAGEW_V1_SIZE };
HPROPSHEETPAGE hpage = CreatePropertySheetW(pspW);
if (hpage) {
DestroyPropertySheetPage(hpage);
return TRUE;
}
else {
return FALSE;
}
)
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x2008">
<name>CCM_GETVERSION</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc> lParam
Must be zero.
</lmisc>
</lparam>
<misc>CCM_GETVERSION Message
Gets the version number for a control set by the most recent CCM_SETVERSION message.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) CCM_GETVERSION, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Returns the version number set by the most recent CCM_SETVERSION message. If no such message has been sent, it returns zero.
Remarks
This message does not return the DLL version. See Shell Versions for a discussion of how to use DllGetVersion to retrieve the current DLL version.
Note The version number is set on a control by control basis, and may not be the same for all controls.
Message Information
Minimum DLL Version comctl32.dll version 5.80 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 5, Windows 98</misc>
</message>
<message value="0x2200">
<name>CCM_LAST</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x2001">
<name>CCM_SETBKCOLOR</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x2002">
<name>CCM_SETCOLORSCHEME</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x2009">
<name>CCM_SETNOTIFYWINDOW</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x2005">
<name>CCM_SETUNICODEFORMAT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns the previous Unicode format flag for the control. </returnmisc>
</return>
<wparam value="BOOL">
<wname>fUnicode</wname>
<wmisc>fUnicode
A value that determines the character set that is used by the control. If this value is TRUE, the control will use Unicode characters. If this value is FALSE, the control will use ANSI characters. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc> lParam
Must be zero.</lmisc>
</lparam>
<misc>CCM_SETUNICODEFORMAT Message
Sets the Unicode character format flag for the control. This message enables you to change the character set used by the control at run time rather than having to re-create the control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) CCM_SETUNICODEFORMAT, // message ID
(WPARAM) wParam, // = (WPARAM) (BOOL) fUnicode;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
fUnicode
A value that determines the character set that is used by the control. If this value is TRUE, the control will use Unicode characters. If this value is FALSE, the control will use ANSI characters.
lParam
Must be zero.
Return Value
Returns the previous Unicode format flag for the control.
Remarks
The Unicode format flag is used by Microsoft Windows NT systems with version 4.71 of Comctl32.dll or later. Therefore this message is supported by Windows 2000 and later, and by Windows NT 4 with Microsoft Internet Explorer 4.0 or later. It is only useful on Microsoft Windows 95 or Microsoft Windows 98 systems with version 5.80 or later of Comctl32.dll. This means that they must have Internet Explorer 5 or later installed. Windows 95 and Windows 98 systems with earlier versions of Internet Explorer ignore the Unicode format flag, and its value has no bearing on whether or not a control supports Unicode. For a discussion about how to test whether a control supports Unicode, see CCM_GETUNICODEFORMAT.
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x2007">
<name>CCM_SETVERSION</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns the version specified in the previous CCM_SETVERSION message. If iVersion is set to a value greater than the current DLL version, it returns -1.
</returnmisc>
</return>
<wparam value="DWORD">
<wname>iVersion</wname>
<wmisc> iVersion
The version number. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc> lParam
Must be zero.</lmisc>
</lparam>
<misc>CCM_SETVERSION Message
This message is used to inform the control that you are expecting a behavior associated with a particular version.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) CCM_SETVERSION, // message ID
(WPARAM) wParam, // = (WPARAM) (DWORD) iVersion;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
iVersion
The version number.
lParam
Must be zero.
Return Value
Returns the version specified in the previous CCM_SETVERSION message. If iVersion is set to a value greater than the current DLL version, it returns -1.
Remarks
In a few cases, a control may behave differently, depending on the version. This primarily applies to bugs that were fixed in later versions. The CCM_SETVERSION enables you to inform the control which behavior is expected. You can determine which version you have specified by sending a CCM_GETVERSION message. For an example of how to use this message, see Custom Draw With List-View and Tree-View Controls.
If you have ComCtl32.dll version 6 installed, regardless of what value you set in iVersion, the CCM_SETVERSION message returns version 6.
Note This message only sets the version number for the control to which it is sent.
Message Information
Minimum DLL Version comctl32.dll version 5.80 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 5, Windows 98</misc>
</message>
<message value="0x200B">
<name>CCM_SETWINDOWTHEME</name>
<return value="">
<returninfo>returns nothing in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPWSTR">
<lname>pwStr</lname>
<lmisc> pwStr
A pointer to a Unicode string that contains the control visual style to set.
</lmisc>
</lparam>
<misc>CCM_SETWINDOWTHEME Message
Sets the visual style of a control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns nothing in lResult
(HWND) hWndControl, // handle to destination control
(UINT) CCM_SETWINDOWTHEME, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPWSTR) pwStr;
);
Parameters
wParam
Must be zero.
pwStr
A pointer to a Unicode string that contains the control visual style to set.
Return Value
Remarks
Note To use this API, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.
Message Information
Header commctrl.h
Minimum operating systems Windows XP</misc>
</message>
<message value="0x45b">
<name>EM_AUTOURLDETECT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
If the message succeeds, the return value is zero.
If the message fails, the return value is a nonzero value. For example, the message may fail due to insufficient memory.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
Specify TRUE to enable automatic URL detection or FALSE to disable it. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc> lParam
This parameter is not used; it must be zero. </lmisc>
</lparam>
<misc>EM_AUTOURLDETECT Message
An EM_AUTOURLDETECT message enables or disables automatic detection of URLs by a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_AUTOURLDETECT, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Specify TRUE to enable automatic URL detection or FALSE to disable it.
lParam
This parameter is not used; it must be zero.
Return Value
If the message succeeds, the return value is zero.
If the message fails, the return value is a nonzero value. For example, the message may fail due to insufficient memory.
Remarks
If automatic URL detection is enabled, the rich edit control scans any modified text to determine whether the text matches the format of a URL. The control detects URLs that begin with the following prefixes:
* http:
* file:
* mailto:
* ftp:
* https:
* gopher:
* nntp:
* prospero:
* telnet:
* news:
* wais:
When it detects a URL, the control sets the CFE_LINK effect bit for all characters in the URL string. The control highlights the URL string by underlining it and setting the text color.
Note When automatic URL detection is enabled, the rich edit control removes the CFE_LINK effect from modified text that does not have a URL format recognized by the control. If your application uses the CFE_LINK effect to mark other types of text, do not enable automatic URL detection.
A rich edit control sends the EN_LINK notification when it receives various messages while the mouse pointer is over text that has the CFE_LINK effect.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95 with Rich Edit 2.0, Windows 98, Windows NT 4.0</misc>
</message>
<message value="0x432">
<name>EM_CANPASTE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
If the clipboard format can be pasted, the return value is a nonzero value.
If the clipboard format cannot be pasted, the return value is zero.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the Clipboard Formats to try. To try any format currently on the clipboard, set this parameter to zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used; it must be zero.
</lmisc>
</lparam>
<misc>EM_CANPASTE Message
The EM_CANPASTE message determines whether a rich edit control can paste a specified clipboard format.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_CANPASTE, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Specifies the Clipboard Formats to try. To try any format currently on the clipboard, set this parameter to zero.
lParam
This parameter is not used; it must be zero.
Return Value
If the clipboard format can be pasted, the return value is a nonzero value.
If the clipboard format cannot be pasted, the return value is zero.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0x455">
<name>EM_CANREDO</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
If there are actions in the control redo queue, the return value is a nonzero value.
If the redo queue is empty, the return value is zero.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
Not used; must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc> lParam
Not used; must be zero.</lmisc>
</lparam>
<misc>EM_CANREDO Message
The EM_CANREDO message determines whether there are any actions in the control redo queue.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_CANREDO, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
If there are actions in the control redo queue, the return value is a nonzero value.
If the redo queue is empty, the return value is zero.
Remarks
To redo the most recent undo operation, send the EM_REDO message.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95 with Rich Edit 2.0, Windows 98, Windows NT 4.0</misc>
</message>
<message value="0xC6">
<name>EM_CANUNDO</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
If there are actions in the control's undo queue, the return value is nonzero.
If the undo queue is empty, the return value is zero.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
Not used; must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used; must be zero.</lmisc>
</lparam>
<misc>EM_CANUNDO Message
Determines whether there are any actions in an edit control's undo queue. You can send this message to either an edit control or a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_CANUNDO, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
If there are actions in the control's undo queue, the return value is nonzero.
If the undo queue is empty, the return value is zero.
Remarks
If the undo queue is not empty, you can send the EM_UNDO message to the control to undo the most recent operation.
Edit controls and Rich Edit 1.0: The undo queue contains only the most recent operation.
Rich Edit 2.0 and later: The undo queue can contain multiple operations.
Rich Edit: Supported in Microsoft Rich Edit 1.0 and later. For information about the compatibility of rich edit versions with the various system versions, see About Rich Edit Controls.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0xD7">
<name>EM_CHARFROMPOS</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Rich edit controls: The return value specifies the zero-based character index of the character nearest the specified point. The return value indicates the last character in the edit control if the specified point is beyond the last character in the control.
Edit controls: The low-order word specifies the zero-based index of the character nearest the specified point. This index is relative to the beginning of the control, not the beginning of the line. If the specified point is beyond the last character in the edit control, the return value indicates the last character in the control. The high-order word specifies the zero-based index of the line that contains the character. For single-line edit controls, this value is zero. The index indicates the line delimiter if the specified point is beyond the last visible character in a line.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
The coordinates of a point in the control's client area. The coordinates are in screen units and are relative to the upper-left corner of the control's client area.
Rich edit controls: A pointer to a POINTL structure that contains the horizontal and vertical coordinates.
Edit controls: The low-order word contains the horizontal coordinate. The high-order word contains the vertical coordinate.
</lmisc>
</lparam>
<misc>EM_CHARFROMPOS Message
Gets information about the character closest to a specified point in the client area of an edit control. You can send this message to either an edit control or a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_CHARFROMPOS, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
This parameter is not used.
lParam
The coordinates of a point in the control's client area. The coordinates are in screen units and are relative to the upper-left corner of the control's client area.
Rich edit controls: A pointer to a POINTL structure that contains the horizontal and vertical coordinates.
Edit controls: The low-order word contains the horizontal coordinate. The high-order word contains the vertical coordinate.
Return Value
Rich edit controls: The return value specifies the zero-based character index of the character nearest the specified point. The return value indicates the last character in the edit control if the specified point is beyond the last character in the control.
Edit controls: The low-order word specifies the zero-based index of the character nearest the specified point. This index is relative to the beginning of the control, not the beginning of the line. If the specified point is beyond the last character in the edit control, the return value indicates the last character in the control. The high-order word specifies the zero-based index of the line that contains the character. For single-line edit controls, this value is zero. The index indicates the line delimiter if the specified point is beyond the last visible character in a line.
Remarks
Rich Edit: Supported in Microsoft Rich Edit 1.0 and later. For information about the compatibility of rich edit versions with the various system versions, see About Rich Edit Controls.
If a point is passed to EM_CHARFROMPOS as the lParam and the point is outside the bounds of the edit control, then the lResult is (65535, 65535).
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0x46c">
<name>EM_CONVPOSITION</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x433">
<name>EM_DISPLAYBAND</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
If the operation succeeds, the return value is TRUE.
If the operation fails, the return value is FALSE.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
This parameter is not used; it must be zero. </wmisc>
</wparam>
<lparam value="RECT">
<lname>lParam</lname>
<lmisc> lParam
Pointer to a RECT structure specifying the display area of the device. </lmisc>
</lparam>
<misc>EM_DISPLAYBAND Message
The EM_DISPLAYBAND message displays a portion of the contents of a rich edit control, as previously formatted for a device using the EM_FORMATRANGE message.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_DISPLAYBAND, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
This parameter is not used; it must be zero.
lParam
Pointer to a RECT structure specifying the display area of the device.
Return Value
If the operation succeeds, the return value is TRUE.
If the operation fails, the return value is FALSE.
Remarks
Text and Component Object Model (COM) objects are clipped by the rectangle. The application does not need to set the clipping region.
Banding is the process by which a single page of output is generated using one or more separate rectangles, or bands. When all bands are placed on the page, a complete image results. This approach is often used by raster printers that do not have sufficient memory or ability to image a full page at one time. Banding devices include most dot matrix printers as well as some laser printers.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0xCD">
<name>EM_EMPTYUNDOBUFFER</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
Not used; must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc> lParam
Not used; must be zero. </lmisc>
</lparam>
<misc>EM_EMPTYUNDOBUFFER Message
Resets the undo flag of an edit control. The undo flag is set whenever an operation within the edit control can be undone. You can send this message to either an edit control or a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_EMPTYUNDOBUFFER, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
Remarks
The undo flag is automatically reset whenever the edit control receives a WM_SETTEXT or EM_SETHANDLE message.
Edit controls and Rich Edit 1.0: The control can only undo or redo the most recent operation.
Rich Edit 2.0 and later: The EM_EMPTYUNDOBUFFER message empties all undo and redo buffers. Rich edit controls enable the user to undo or redo multiple operations.
Rich Edit: Supported in Microsoft Rich Edit 1.0 and later. For information about the compatibility of rich edit versions with the various system versions, see About Rich Edit Controls.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x434">
<name>EM_EXGETSEL</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
This message does not return a value.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
This parameter is not used; it must be zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc> lParam
Pointer to a CHARRANGE structure that receives the selection range. </lmisc>
</lparam>
<misc>EM_EXGETSEL Message
The EM_EXGETSEL message retrieves the starting and ending character positions of the selection in a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_EXGETSEL, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
This parameter is not used; it must be zero.
lParam
Pointer to a CHARRANGE structure that receives the selection range.
Return Value
This message does not return a value.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0x435">
<name>EM_EXLIMITTEXT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
This message does not return a value.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
This parameter is not used; it must be zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc> lParam
Specifies the maximum amount of text that can be entered. If this parameter is zero, the default maximum is used, which is 64K characters. A Component Object Model (COM) object counts as a single character.
</lmisc>
</lparam>
<misc>EM_EXLIMITTEXT Message
The EM_EXLIMITTEXT message sets an upper limit to the amount of text the user can type or paste into a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_EXLIMITTEXT, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
This parameter is not used; it must be zero.
lParam
Specifies the maximum amount of text that can be entered. If this parameter is zero, the default maximum is used, which is 64K characters. A Component Object Model (COM) object counts as a single character.
Return Value
This message does not return a value.
Remarks
The text limit set by the EM_EXLIMITTEXT message does not limit the amount of text that you can stream into a rich edit control using the EM_STREAMIN message with lParam set to SF_TEXT. However, it does limit the amount of text that you can stream into a rich edit control using the EM_STREAMIN message with lParam set to SF_RTF.
Before EM_EXLIMITTEXT is called, the default limit to the amount of text a user can enter is 32,767 characters.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0x436">
<name>EM_EXLINEFROMCHAR</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
This message returns the zero-based index of the line.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
This parameter is not used; it must be zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc> lParam
Zero-based index of the character.
</lmisc>
</lparam>
<misc>EM_EXLINEFROMCHAR Message
The EM_EXLINEFROMCHAR message determines which line contains the specified character in a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_EXLINEFROMCHAR, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
This parameter is not used; it must be zero.
lParam
Zero-based index of the character.
Return Value
This message returns the zero-based index of the line.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0x437">
<name>EM_EXSETSEL</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used; it must be zero.</wmisc>
</wparam>
<lparam value="CHARRANGE">
<lname>lParam</lname>
<lmisc>lParam
Pointer to a CHARRANGE structure that specifies the selection range. </lmisc>
</lparam>
<misc>EM_EXSETSEL Message
The EM_EXSETSEL message selects a range of characters or Component Object Model (COM) objects in a Microsoft Rich Edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_EXSETSEL, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
This parameter is not used; it must be zero.
lParam
Pointer to a CHARRANGE structure that specifies the selection range.
Return Value
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0x438">
<name>EM_FINDTEXT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
If the target string is found, the return value is the zero-based position of the first character of the match. If the target is not found, the return value is 1.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specify the parameters of the search operation. This parameter can be one or more of the following values.
FR_DOWN
Microsoft Rich Edit 2.0 and later: If set, the search is from the end of the current selection to the end of the document. If not set, the search is from the end of the current selection to the beginning of the document.
Rich Edit 1.0: The FR_DOWN flag is ignored. The search is always from the end of the current selection to the end of the document.
FR_MATCHALEFHAMZA
Rich Edit 3.0 and later: If set, the search differentiates between Arabic alefs with different accents. If not set, all alefs are matched by the alef character alone.
FR_MATCHCASE
If set, the search operation is case-sensitive. If not set, the search operation is case-insensitive.
FR_MATCHDIAC
Rich Edit 3.0 and later: If set, the search operation considers Arabic and Hebrew diacritical marks. If not set, diacritical marks are ignored.
FR_MATCHKASHIDA
Rich Edit 3.0 and later: If set, the search operation considers Arabic kashidas. If not set, kashidas are ignored.
FR_WHOLEWORD
If set, the operation searches only for whole words that match the search string. If not set, the operation also searches for word fragments that match the search string.
</wmisc>
</wparam>
<lparam value="FINDTEXT">
<lname>lParam</lname>
<lmisc> lParam
Pointer to a FINDTEXT structure containing information about the find operation. </lmisc>
</lparam>
<misc>EM_FINDTEXT Message
The EM_FINDTEXT message finds text within a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_FINDTEXT, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Specify the parameters of the search operation. This parameter can be one or more of the following values.
FR_DOWN
Microsoft Rich Edit 2.0 and later: If set, the search is from the end of the current selection to the end of the document. If not set, the search is from the end of the current selection to the beginning of the document.
Rich Edit 1.0: The FR_DOWN flag is ignored. The search is always from the end of the current selection to the end of the document.
FR_MATCHALEFHAMZA
Rich Edit 3.0 and later: If set, the search differentiates between Arabic alefs with different accents. If not set, all alefs are matched by the alef character alone.
FR_MATCHCASE
If set, the search operation is case-sensitive. If not set, the search operation is case-insensitive.
FR_MATCHDIAC
Rich Edit 3.0 and later: If set, the search operation considers Arabic and Hebrew diacritical marks. If not set, diacritical marks are ignored.
FR_MATCHKASHIDA
Rich Edit 3.0 and later: If set, the search operation considers Arabic kashidas. If not set, kashidas are ignored.
FR_WHOLEWORD
If set, the operation searches only for whole words that match the search string. If not set, the operation also searches for word fragments that match the search string.
lParam
Pointer to a FINDTEXT structure containing information about the find operation.
Return Value
If the target string is found, the return value is the zero-based position of the first character of the match. If the target is not found, the return value is 1.
Remarks
The cpMin member of FINDTEXT.chrg always specifies the starting-point of the search, and cpMax specifies the end point. When searching backward, cpMin must be equal to or greater than cpMax. When searching forward, a value of 1 in cpMax extends the search range to the end of the text.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95, Windows NT 4.0
Unicode Implemented as ANSI and Unicode versions. </misc>
</message>
<message value="0x44f">
<name>EM_FINDTEXTEX</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
If the target string is found, the return value is the zero-based position of the first character of the match. If the target is not found, the return value is 1.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
Specifies the behavior of the search operation. This parameter can be one or more of the following values.
FR_DOWN
Microsoft Rich Edit 2.0 and later: If set, the search is forward from FINDTEXTEX.chrg.cpMin; if not set, the search is backward from FINDTEXTEX.chrg.cpMin.
Rich Edit 1.0: The FR_DOWN flag is ignored. The search is always forward.
FR_MATCHALEFHAMZA
Rich Edit 3.0 and later: If set, the search differentiates between Arabic and Hebrew alefs with different accents. If not set, all alefs are matched by the alef character alone.
FR_MATCHCASE
If set, the search operation is case-sensitive. If not set, the search operation is case-insensitive.
FR_MATCHDIAC
Rich Edit 3.0 and later: If set, the search operation considers Arabic and Hebrew diacritical marks. If not set, diacritical marks are ignored.
FR_MATCHKASHIDA
Rich Edit 3.0 and later: If set, the search operation considers Arabic and Hebrew kashidas. If not set, kashidas are ignored.
FR_WHOLEWORD
If set, the operation searches only for whole words that match the search string. If not set, the operation also searches for word fragments that match the search string.
</wmisc>
</wparam>
<lparam value="FINDTEXTEX">
<lname>lParam</lname>
<lmisc> lParam
Pointer to a FINDTEXTEX structure containing information about the find operation.
</lmisc>
</lparam>
<misc>EM_FINDTEXTEX Message
The EM_FINDTEXTEX message finds text within a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_FINDTEXTEX, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Specifies the behavior of the search operation. This parameter can be one or more of the following values.
FR_DOWN
Microsoft Rich Edit 2.0 and later: If set, the search is forward from FINDTEXTEX.chrg.cpMin; if not set, the search is backward from FINDTEXTEX.chrg.cpMin.
Rich Edit 1.0: The FR_DOWN flag is ignored. The search is always forward.
FR_MATCHALEFHAMZA
Rich Edit 3.0 and later: If set, the search differentiates between Arabic and Hebrew alefs with different accents. If not set, all alefs are matched by the alef character alone.
FR_MATCHCASE
If set, the search operation is case-sensitive. If not set, the search operation is case-insensitive.
FR_MATCHDIAC
Rich Edit 3.0 and later: If set, the search operation considers Arabic and Hebrew diacritical marks. If not set, diacritical marks are ignored.
FR_MATCHKASHIDA
Rich Edit 3.0 and later: If set, the search operation considers Arabic and Hebrew kashidas. If not set, kashidas are ignored.
FR_WHOLEWORD
If set, the operation searches only for whole words that match the search string. If not set, the operation also searches for word fragments that match the search string.
lParam
Pointer to a FINDTEXTEX structure containing information about the find operation.
Return Value
If the target string is found, the return value is the zero-based position of the first character of the match. If the target is not found, the return value is 1.
Remarks
Use this message to find ANSI strings. For Unicode, use EM_FINDTEXTEXW.
The cpMin member of FINDTEXTEX.chrg always specifies the starting-point of the search, and cpMax specifies the end point. When searching backward, cpMin must be equal to or greater than cpMax. When searching forward, a value of 1 in cpMax extends the search range to the end of the text.
If the search operation finds a match, the chrgText member of the FINDTEXTEX structure returns the range of character positions that contains the matching text.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95, Windows NT 4.0
Unicode Implemented as ANSI and Unicode versions. </misc>
</message>
<message value="0x47c">
<name>EM_FINDTEXTEXW</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
If the target string is found, the return value is the zero-based position of the first character of the match. If the target is not found, the return value is 1.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the behavior of the search operation. This parameter can be one or more of the following values.
FR_DOWN
Microsoft Rich Edit 2.0 and later: If set, the search is forward from FINDTEXTEX.chrg.cpMin; if not set, the search is backward from FINDTEXTEX.chrg.cpMin.
Rich Edit 1.0: The FR_DOWN flag is ignored. The search is always forward.
FR_WHOLEWORD
If set, the operation searches only for whole words that match the search string. If not set, the operation also searches for word fragments that match the search string.
FR_MATCHCASE
If set, the search operation is case-sensitive. If not set, the search operation is case-insensitive.
FR_MATCHALEFHAMZA
If set, the search differentiates between alefs with different accents. If not set, Arabic and Hebrew alefs with different accents are all matched by the alef character.
FR_MATCHDIAC
If set, the search operation considers diacritical marks. If not set, Arabic and Hebrew diacritical marks are ignored.
FR_MATCHKASHIDA
If set, the search operation considers kashidas. If not set, Arabic and Hebrew kashidas are ignored.
</wmisc>
</wparam>
<lparam value="FINDTEXTEXW">
<lname>lParam</lname>
<lmisc>lParam
Pointer to a FINDTEXTEXW structure containing information about the find operation.
</lmisc>
</lparam>
<misc>EM_FINDTEXTEXW Message
The EM_FINDTEXTEXW message finds Unicode text within a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_FINDTEXTEXW, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Specifies the behavior of the search operation. This parameter can be one or more of the following values.
FR_DOWN
Microsoft Rich Edit 2.0 and later: If set, the search is forward from FINDTEXTEX.chrg.cpMin; if not set, the search is backward from FINDTEXTEX.chrg.cpMin.
Rich Edit 1.0: The FR_DOWN flag is ignored. The search is always forward.
FR_WHOLEWORD
If set, the operation searches only for whole words that match the search string. If not set, the operation also searches for word fragments that match the search string.
FR_MATCHCASE
If set, the search operation is case-sensitive. If not set, the search operation is case-insensitive.
FR_MATCHALEFHAMZA
If set, the search differentiates between alefs with different accents. If not set, Arabic and Hebrew alefs with different accents are all matched by the alef character.
FR_MATCHDIAC
If set, the search operation considers diacritical marks. If not set, Arabic and Hebrew diacritical marks are ignored.
FR_MATCHKASHIDA
If set, the search operation considers kashidas. If not set, Arabic and Hebrew kashidas are ignored.
lParam
Pointer to a FINDTEXTEXW structure containing information about the find operation.
Return Value
If the target string is found, the return value is the zero-based position of the first character of the match. If the target is not found, the return value is 1.
Remarks
Use this message to find Unicode strings. For ANSI;, use EM_FINDTEXTEX.
The cpMin member of FINDTEXTEX.chrg always specifies the starting-point of the search, and cpMax specifies the end point. When searching backward, cpMin must be equal to or greater than cpMax. When searching forward, a value of 1 in cpMax extends the search range to the end of the text.
If the search operation finds a match, the chrgText member of the FINDTEXTEX structure returns the range of character positions that contains the matching text.
EM_FINDTEXTEXW uses the FINDTEXTEXW structure, while EM_FINDTEXTW uses the FINDTEXTW structure. The difference is that EM_FINDTEXTEXW reports the range of text that was found.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95 with Rich Edit 2.0, Windows 98, Windows NT 4.0</misc>
</message>
<message value="0x47b">
<name>EM_FINDTEXTW</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
If the target string is found, the return value is the zero-based position of the first character of the match. If the target is not found, the return value is 1.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
Specifies the parameters of the search operation. This parameter can be one or more of the following values.
FR_DOWN
If set, the operation searches from the end of the current selection to the end of the document. If not set, the operation searches from the end of the current selection to the beginning of the document.
FR_WHOLEWORD
If set, the operation searches only for whole words that match the search string. If not set, the operation also searches for word fragments that match the search string.
FR_MATCHCASE
If set, the search operation is case-sensitive. If not set, the search operation is case-insensitive.
FR_MATCHALEFHAMZA
By default, Arabic and Hebrew alefs with different accents are all matched by the alef character. Set this flag if you want the search to differentiate between alefs with different accents.
FR_MATCHDIAC
By default, Arabic and Hebrew diacritical marks are ignored. Set this flag if you want the search operation to consider diacritical marks.
FR_MATCHKASHIDA
By default, Arabic and Hebrew kashidas are ignored. Set this flag if you want the search operation to consider kashidas.
</wmisc>
</wparam>
<lparam value="FINDTEXTW">
<lname>lParam</lname>
<lmisc> lParam
Pointer to a FINDTEXTW structure containing information about the find operation. </lmisc>
</lparam>
<misc>EM_FINDTEXTW Message
The EM_FINDTEXTW message finds Unicode text within a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_FINDTEXTW, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Specifies the parameters of the search operation. This parameter can be one or more of the following values.
FR_DOWN
If set, the operation searches from the end of the current selection to the end of the document. If not set, the operation searches from the end of the current selection to the beginning of the document.
FR_WHOLEWORD
If set, the operation searches only for whole words that match the search string. If not set, the operation also searches for word fragments that match the search string.
FR_MATCHCASE
If set, the search operation is case-sensitive. If not set, the search operation is case-insensitive.
FR_MATCHALEFHAMZA
By default, Arabic and Hebrew alefs with different accents are all matched by the alef character. Set this flag if you want the search to differentiate between alefs with different accents.
FR_MATCHDIAC
By default, Arabic and Hebrew diacritical marks are ignored. Set this flag if you want the search operation to consider diacritical marks.
FR_MATCHKASHIDA
By default, Arabic and Hebrew kashidas are ignored. Set this flag if you want the search operation to consider kashidas.
lParam
Pointer to a FINDTEXTW structure containing information about the find operation.
Return Value
If the target string is found, the return value is the zero-based position of the first character of the match. If the target is not found, the return value is 1.
Remarks
EM_FINDTEXTW uses the FINDTEXTW structure, while EM_FINDTEXTEXW uses the FINDTEXTEXW structure. The difference is that FINDTEXTEXW reports back the range of text that was found.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95 with Rich Edit 2.0, Windows 98, Windows NT 4.0</misc>
</message>
<message value="0x44c">
<name>EM_FINDWORDBREAK</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
The message returns a value based on the wParam parameter.
wParam Return Value
WB_CLASSIFY Returns the character class and word-break flags of the character at the specified position.
WB_ISDELIMITER Returns TRUE if the character at the specified position is a delimiter; otherwise it returns FALSE.
Others Returns the character index of the word break.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
Specifies the find operation. This parameter can be one of the following values.
WB_CLASSIFY
Returns the character class and word-break flags of the character at the specified position.
WB_ISDELIMITER
Returns TRUE if the character at the specified position is a delimiter, or FALSE otherwise.
WB_LEFT
Finds the nearest character before the specified position that begins a word.
WB_LEFTBREAK
Finds the next word end before the specified position. This value is the same as WB_PREVBREAK.
WB_MOVEWORDLEFT
Finds the next character that begins a word before the specified position. This value is used during CTRL+LEFT ARROW key processing. This value is the similar to WB_MOVEWORDPREV. See Remarks for more information.
WB_MOVEWORDRIGHT
Finds the next character that begins a word after the specified position. This value is used during CTRL+right key processing. This value is similar to WB_MOVEWORDNEXT. See Remarks for more information.
WB_RIGHT
Finds the next character that begins a word after the specified position.
WB_RIGHTBREAK
Finds the next end-of-word delimiter after the specified position. This value is the same as WB_NEXTBREAK.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc> lParam
Zero-based character starting position.
</lmisc>
</lparam>
<misc>EM_FINDWORDBREAK Message
The EM_FINDWORDBREAK message finds the next word break before or after the specified character position or retrieves information about the character at that position.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_FINDWORDBREAK, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Specifies the find operation. This parameter can be one of the following values.
WB_CLASSIFY
Returns the character class and word-break flags of the character at the specified position.
WB_ISDELIMITER
Returns TRUE if the character at the specified position is a delimiter, or FALSE otherwise.
WB_LEFT
Finds the nearest character before the specified position that begins a word.
WB_LEFTBREAK
Finds the next word end before the specified position. This value is the same as WB_PREVBREAK.
WB_MOVEWORDLEFT
Finds the next character that begins a word before the specified position. This value is used during CTRL+LEFT ARROW key processing. This value is the similar to WB_MOVEWORDPREV. See Remarks for more information.
WB_MOVEWORDRIGHT
Finds the next character that begins a word after the specified position. This value is used during CTRL+right key processing. This value is similar to WB_MOVEWORDNEXT. See Remarks for more information.
WB_RIGHT
Finds the next character that begins a word after the specified position.
WB_RIGHTBREAK
Finds the next end-of-word delimiter after the specified position. This value is the same as WB_NEXTBREAK.
lParam
Zero-based character starting position.
Return Value
The message returns a value based on the wParam parameter.
wParam Return Value
WB_CLASSIFY Returns the character class and word-break flags of the character at the specified position.
WB_ISDELIMITER Returns TRUE if the character at the specified position is a delimiter; otherwise it returns FALSE.
Others Returns the character index of the word break.
Remarks
If wParam is WB_LEFT and WB_RIGHT, the word-break procedure finds word breaks only after delimiters. This matches the functionality of an edit control. If wParam is WB_MOVEWORDLEFT or WB_MOVEWORDRIGHT, the word-break procedure also compares character classes and word-break flags.
For information about character classes and word-break flags, see Word and Line Breaks.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0xC8">
<name>EM_FMTLINES</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
The return value is identical to the wParam parameter.</returnmisc>
</return>
<wparam value="BOOL">
<wname>wParam</wname>
<wmisc>wParam
Specifies whether soft line-break characters are to be inserted. A value of TRUE inserts the characters; a value of FALSE removes them. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc> lParam
This parameter is not used.
</lmisc>
</lparam>
<misc>EM_FMTLINES Message
Sets a flag that determines whether a multiline edit control includes soft line-break characters. A soft line break consists of two carriage returns and a line feed and is inserted at the end of a line that is broken because of wordwrapping.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_FMTLINES, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Specifies whether soft line-break characters are to be inserted. A value of TRUE inserts the characters; a value of FALSE removes them.
lParam
This parameter is not used.
Return Value
The return value is identical to the wParam parameter.
Remarks
This message affects only the buffer returned by the EM_GETHANDLE message and the text returned by the WM_GETTEXT message. It has no effect on the display of the text within the edit control.
The EM_FMTLINES message does not affect a line that ends with a hard line break. A hard line break consists of one carriage return and a line feed.
Note The size of the text changes when this message is processed.
Rich Edit: The EM_FMTLINES message is not supported.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x439">
<name>EM_FORMATRANGE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
This message returns the index of the last character that fits in the region, plus 1.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies whether to render the text. If this parameter is not zero, the text is rendered. Otherwise, the text is just measured.
</wmisc>
</wparam>
<lparam value="FORMATRANGE">
<lname>lParam</lname>
<lmisc>lParam
Pointer to a FORMATRANGE structure containing information about the output device, or NULL to free information cached by the control.
</lmisc>
</lparam>
<misc>EM_FORMATRANGE Message
The EM_FORMATRANGE message formats a range of text in a rich edit control for a specific device.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_FORMATRANGE, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Specifies whether to render the text. If this parameter is not zero, the text is rendered. Otherwise, the text is just measured.
lParam
Pointer to a FORMATRANGE structure containing information about the output device, or NULL to free information cached by the control.
Return Value
This message returns the index of the last character that fits in the region, plus 1.
Remarks
This message is typically used to format the content of rich edit control for an output device such as a printer.
It is very important to free cached information after the last time you use this message by specifying NULL in lParam. In addition, after using this message for one device, you must free cached information before using it again for a different device.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0x45c">
<name>EM_GETAUTOURLDETECT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
If auto-URL detection is active, the return value is 1.
If auto-URL detection is inactive, the return value is 0.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used; must be zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc> lParam
Not used; must be zero. </lmisc>
</lparam>
<misc>EM_GETAUTOURLDETECT Message
The EM_GETAUTOURLDETECT message indicates whether the auto URL detection is turned on in the rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_GETAUTOURLDETECT, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
If auto-URL detection is active, the return value is 1.
If auto-URL detection is inactive, the return value is 0.
Remarks
When auto URL detection is on, Microsoft Rich Edit is constantly checking typed text for a valid URL. Rich Edit recognizes URLs that start with these prefixes:
* http:
* file:
* mailto:
* ftp:
* https:
* gopher:
* nntp:
* prospero:
* telnet:
* news:
* wais:
* outlook:
Rich Edit also recognizes standard path names that start with \\. When Rich Edit locates a URL, it changes the URL text color, underlines the text, and notifies the client using EN_LINK.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95 with Rich Edit 2.0, Windows 98, Windows NT 4.0</misc>
</message>
<message value="0x4c9">
<name>EM_GETBIDIOPTIONS</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
This message does not return a value.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used; it must be zero.</wmisc>
</wparam>
<lparam value="BIDIOPTIONS">
<lname>lParam</lname>
<lmisc>lParam
Pointer to a BIDIOPTIONS structure that receives the current state of the bidirectional options in the rich edit control.
</lmisc>
</lparam>
<misc>EM_GETBIDIOPTIONS Message
The EM_GETBIDIOPTIONS message indicates the current state of the bidirectional options in the rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_GETBIDIOPTIONS, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
This parameter is not used; it must be zero.
lParam
Pointer to a BIDIOPTIONS structure that receives the current state of the bidirectional options in the rich edit control.
Return Value
This message does not return a value.
Remarks
This message sets the values of the wMask and wEffects members to the value of the current state of the bidirectional options in the rich edit control.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95 (Middle Eastern) with Rich Edit 3.0, Windows NT 4.0 (Middle Eastern) with Rich Edit 3.0, Windows Millennium Edition (Middle Eastern), Windows 2000 (Middle Eastern)</misc>
</message>
<message value="0x43a">
<name>EM_GETCHARFORMAT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
This message returns the value of the dwMask member of the CHARFORMAT structure.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the range of text from which to retrieve formatting. It can be one of the following values.
SCF_DEFAULT
The default character formatting.
SCF_SELECTION
The current selection's character formatting.</wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc>lParam
Pointer to a CHARFORMAT structure that receives the attributes of the first character. The dwMask member specifies which attributes are consistent throughout the entire selection. For example, if the entire selection is either in italics or not in italics, CFM_ITALIC is set; if the selection is partly in italics and partly not, CFM_ITALIC is not set.
Microsoft Rich Edit 2.0 and later: This parameter can be a pointer to a CHARFORMAT2 structure, which is an extension of the CHARFORMAT structure. Before sending the EM_GETCHARFORMAT message, set the structure's cbSize member to indicate the version of the structure.
</lmisc>
</lparam>
<misc>EM_GETCHARFORMAT Message
The EM_GETCHARFORMAT message determines the character formatting in a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_GETCHARFORMAT, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Specifies the range of text from which to retrieve formatting. It can be one of the following values.
SCF_DEFAULT
The default character formatting.
SCF_SELECTION
The current selection's character formatting.
lParam
Pointer to a CHARFORMAT structure that receives the attributes of the first character. The dwMask member specifies which attributes are consistent throughout the entire selection. For example, if the entire selection is either in italics or not in italics, CFM_ITALIC is set; if the selection is partly in italics and partly not, CFM_ITALIC is not set.
Microsoft Rich Edit 2.0 and later: This parameter can be a pointer to a CHARFORMAT2 structure, which is an extension of the CHARFORMAT structure. Before sending the EM_GETCHARFORMAT message, set the structure's cbSize member to indicate the version of the structure.
Return Value
This message returns the value of the dwMask member of the CHARFORMAT structure.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0x4cd">
<name>EM_GETEDITSTYLE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
The return value can be one or more of the following values.
SES_EMULATESYSEDIT When this bit is on, Microsoft Rich Edit attempts to emulate the system edit control.
SES_BEEPONMAXTEXT Rich Edit calls the system beeper if the user attempts to input more than the maximum characters.
SES_EXTENDBACKCOLOR Extends the background color all the way to the edges of the client rectangle.
SES_USEAIMM Uses the Active Input Method Manager (IMM) input method component that ships with Microsoft Internet Explorer 4.0 or later.
SES_UPPERCASE Converts all input characters to upper case.
SES_LOWERCASE Converts all input characters to lower case.
SES_NOINPUTSEQUENCECHK When this bit is on, rich edit does not verify the sequence of typed text. Some languages (such as Thai and Vietnamese) must verify the input sequence order before submitting it to the backing store.
SES_XLTCRCRLFTOCR Turns on translation of CRCRLFs to CRs. When this bit is on and a file is read in, all instances of CRCRLF are converted to hard CRs internally. This affects the text wrapping. Note that if such a file is saved as plain text, the CRs are replaced by CRLFs. This is the .txt standard for plain text.
SES_NOIME Disallows IMEs for this control instance.
SES_BIDI Turns on bidirectional processing. This is automatically turned on by Rich Edit if any of the following window styles are active: WS_EX_RIGHT, WS_EX_RTLREADING, WS_EX_LEFTSCROLLBAR. However, this setting is useful for handling these window styles when using a custom implementation of ITextHost.
SES_SCROLLONKILLFOCUS When KillFocus occurs, scroll to the beginning of the text (cp=0).
SES_DRAFTMODE Windows XP SP1: Uses draftmode fonts to display text. Draft mode is an accessibility option where the control displays the text with a single font; the font is determined by the system setting for the font used in message boxes. For example, accessible users may read text easier if it is uniform, rather than a mix of fonts and styles.
SES_USECTF Windows XP SP1: Turns on Text Services Framework (TSF) support.
SES_HIDEGRIDLINES Windows XP SP1: If the table gridlines width is zero, gridlines are not displayed. This is equivalent to the hide gridlines feature in Microsoft Word's table menu.
SES_USEATFONT Windows XP SP1: Uses an @ font, which is designed for vertical text; this is used with the ES_VERTICAL window style. The name of an @ font begins with the @ symbol, for example, "@Batang".
SES_CTFALLOWEMBED Windows XP SP1: Allows embedded objects to be inserted using TSF.
SES_CTFALLOWSMARTTAG Windows XP SP1: Allows TSF SmartTag tips.
SES_CTFALLOWPROOFING Windows XP SP1: Allows TSF proofing tips.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used; must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used; must be zero.</lmisc>
</lparam>
<misc>EM_GETEDITSTYLE Message
The EM_GETEDITSTYLE message retrieves the current edit style flags.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_GETEDITSTYLE, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
The return value can be one or more of the following values.
SES_EMULATESYSEDIT When this bit is on, Microsoft Rich Edit attempts to emulate the system edit control.
SES_BEEPONMAXTEXT Rich Edit calls the system beeper if the user attempts to input more than the maximum characters.
SES_EXTENDBACKCOLOR Extends the background color all the way to the edges of the client rectangle.
SES_USEAIMM Uses the Active Input Method Manager (IMM) input method component that ships with Microsoft Internet Explorer 4.0 or later.
SES_UPPERCASE Converts all input characters to upper case.
SES_LOWERCASE Converts all input characters to lower case.
SES_NOINPUTSEQUENCECHK When this bit is on, rich edit does not verify the sequence of typed text. Some languages (such as Thai and Vietnamese) must verify the input sequence order before submitting it to the backing store.
SES_XLTCRCRLFTOCR Turns on translation of CRCRLFs to CRs. When this bit is on and a file is read in, all instances of CRCRLF are converted to hard CRs internally. This affects the text wrapping. Note that if such a file is saved as plain text, the CRs are replaced by CRLFs. This is the .txt standard for plain text.
SES_NOIME Disallows IMEs for this control instance.
SES_BIDI Turns on bidirectional processing. This is automatically turned on by Rich Edit if any of the following window styles are active: WS_EX_RIGHT, WS_EX_RTLREADING, WS_EX_LEFTSCROLLBAR. However, this setting is useful for handling these window styles when using a custom implementation of ITextHost.
SES_SCROLLONKILLFOCUS When KillFocus occurs, scroll to the beginning of the text (cp=0).
SES_DRAFTMODE Windows XP SP1: Uses draftmode fonts to display text. Draft mode is an accessibility option where the control displays the text with a single font; the font is determined by the system setting for the font used in message boxes. For example, accessible users may read text easier if it is uniform, rather than a mix of fonts and styles.
SES_USECTF Windows XP SP1: Turns on Text Services Framework (TSF) support.
SES_HIDEGRIDLINES Windows XP SP1: If the table gridlines width is zero, gridlines are not displayed. This is equivalent to the hide gridlines feature in Microsoft Word's table menu.
SES_USEATFONT Windows XP SP1: Uses an @ font, which is designed for vertical text; this is used with the ES_VERTICAL window style. The name of an @ font begins with the @ symbol, for example, "@Batang".
SES_CTFALLOWEMBED Windows XP SP1: Allows embedded objects to be inserted using TSF.
SES_CTFALLOWSMARTTAG Windows XP SP1: Allows TSF SmartTag tips.
SES_CTFALLOWPROOFING Windows XP SP1: Allows TSF proofing tips.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95 with Rich Edit 3.0, Windows NT 4.0 with Rich Edit 3.0, Windows Millennium Edition, Windows 2000</misc>
</message>
<message value="0x43b">
<name>EM_GETEVENTMASK</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
This message returns the event mask for the rich edit control.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used; must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used; must be zero. </lmisc>
</lparam>
<misc>EM_GETEVENTMASK Message
The EM_GETEVENTMASK message retrieves the event mask for a rich edit control. The event mask specifies which notification messages the control sends to its parent window.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_GETEVENTMASK, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
This message returns the event mask for the rich edit control.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0xCE">
<name>EM_GETFIRSTVISIBLELINE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
The return value is the zero-based index of the uppermost visible line in a multiline edit control.
Edit controls: For single-line edit controls, the return value is the zero-based index of the first visible character.
Rich edit controls: For single-line rich edit controls, the return value is zero. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used; must be zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used; must be zero. </lmisc>
</lparam>
<misc>EM_GETFIRSTVISIBLELINE Message
Gets the zero-based index of the uppermost visible line in a multiline edit control. You can send this message to either an edit control or a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_GETFIRSTVISIBLELINE, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
The return value is the zero-based index of the uppermost visible line in a multiline edit control.
Edit controls: For single-line edit controls, the return value is the zero-based index of the first visible character.
Rich edit controls: For single-line rich edit controls, the return value is zero.
Remarks
The number of lines and the length of the lines in an edit control depend on the width of the control and the current Wordwrap setting.
Rich Edit: Supported in Microsoft Rich Edit 1.0 and later. For information about the compatibility of rich edit versions with the various system versions, see About Rich Edit Controls.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0xBD">
<name>EM_GETHANDLE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
Not used; must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used; must be zero. </lmisc>
</lparam>
<misc>EM_GETHANDLE Message
Gets a handle of the memory currently allocated for a multiline edit control's text.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_GETHANDLE, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
Remarks
If the function succeeds, the application can access the contents of the edit control by casting the return value to HLOCAL and passing it to LocalLock. LocalLock returns a pointer to a buffer that is a null-terminated array of CHARs or WCHARs, depending on whether an ANSI or Unicode function created the control. For example, if CreateWindowExA was used the buffer is an array of CHARs, but if CreateWindowExW was used the buffer is an array of WCHARs. The application may not change the contents of the buffer. To unlock the buffer, the application calls LocalUnlock before allowing the edit control to receive new messages.
If your application cannot abide by the restrictions imposed by EM_GETHANDLE, use the GetWindowTextLength and GetWindowText functions to copy the contents of the edit control into an application-provided buffer.
Windows 95/98/Me: Although this message returns a nonzero value, the resulting value is not useful to a 32-bit application.
Rich Edit: The EM_GETHANDLE message is not supported. Rich edit controls do not store text as a simple array of characters.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x469">
<name>EM_GETIMECOLOR</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
If the operation succeeds, the return value is a nonzero value.
If the operation fails, the return value is zero.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used; it must be zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Pointer to a four-element array of COMPCOLOR structures that receives the composition color.
</lmisc>
</lparam>
<misc>EM_GETIMECOLOR Message
The EM_GETIMECOLOR message retrieves the Input Method Editor (IME) composition color. This message is available only in Asian-language versions of the operating system.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_GETIMECOLOR, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
This parameter is not used; it must be zero.
lParam
Pointer to a four-element array of COMPCOLOR structures that receives the composition color.
Return Value
If the operation succeeds, the return value is a nonzero value.
If the operation fails, the return value is zero.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95 (Asian version), Windows NT 4.0 (Asian version)</misc>
</message>
<message value="0x47a">
<name>EM_GETIMECOMPMODE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>
Return Value
The return value is one of the following values.
ICM_NOTOPEN Input Method Editor (IME) is not open.
ICM_LEVEL3 True inline mode.
ICM_LEVEL2 Level 2.
ICM_LEVEL2_5 Level 2.5
ICM_LEVEL2_SUI Special user interface (UI).
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used; must be zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used; must be zero. </lmisc>
</lparam>
<misc>EM_GETIMECOMPMODE Message
An application sends an EM_GETIMECOMPMODE message to get the current IME mode for a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_GETIMECOMPMODE, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
The return value is one of the following values.
ICM_NOTOPEN Input Method Editor (IME) is not open.
ICM_LEVEL3 True inline mode.
ICM_LEVEL2 Level 2.
ICM_LEVEL2_5 Level 2.5
ICM_LEVEL2_SUI Special user interface (UI).
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95 with Rich Edit 2.0, Windows 98, Windows NT 4.0</misc>
</message>
<message value="0x47f">
<name>EM_GETIMEMODEBIAS</name>
<return value="DWORD">
<returninfo>returns DWORD in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
Not used; must be zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used; must be zero.</lmisc>
</lparam>
<misc>EM_GETIMEMODEBIAS Message
An application sends an EM_GETIMEMODEBIAS message to get the Input Method Editor (IME) mode bias for a Microsoft Rich Edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns DWORD in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_GETIMEMODEBIAS, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
Remarks
To get the Text Services Framework mode bias, use EM_GETCTFMODEBIAS.
The application should call EM_ISIME before calling this function.
Message Information
Minimum DLL Version msftedit.dll
Header Declared in Richedit.h
Minimum operating systems Windows XP SP1</misc>
</message>
<message value="0x46b">
<name>EM_GETIMEOPTIONS</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
This message returns one or more of the IME option flag values described in the EM_SETIMEOPTIONS message.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used; must be zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used; must be zero. </lmisc>
</lparam>
<misc>EM_GETIMEOPTIONS Message
The EM_GETIMEOPTIONS message retrieves the current Input Method Editor (IME) options. This message is available only in Asian-language versions of the operating system.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_GETIMEOPTIONS, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
This message returns one or more of the IME option flag values described in the EM_SETIMEOPTIONS message.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95 (Asian version), Windows NT 4.0 (Asian version)</misc>
</message>
<message value="0xD9">
<name>EM_GETIMESTATUS</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Data specific to the type of status to retrieve. With the EMSIS_COMPOSITIONSTRING value for status, this return value is one or more of the following values.
EIMES_GETCOMPSTRATONCE If this flag is set, the edit control hooks the WM_IME_COMPOSITION message with fFlags set to GCS_RESULTSTR and returns the result string immediately. If this flag is not set, the edit control passes the WM_IME_COMPOSITION message to the default window procedure and processes the result string from the WM_CHAR message; this is the default behavior of the edit control.
EIMES_CANCELCOMPSTRINFOCUS If this flag is set, the edit control cancels the composition string when it receives the WM_SETFOCUS message. If this flag is not set, the edit control does not cancel the composition string; this is the default behavior of the edit control.
EIMES_COMPLETECOMPSTRKILLFOCUS If this flag is set, the edit control completes the composition string upon receiving the WM_KILLFOCUS message. If this flag is not set, the edit control does not complete the composition string; this is the default behavior of the edit control.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
The type of status to retrieve. This parameter can be the following value.
EMSIS_COMPOSITIONSTRING
Sets behavior for handling the composition string.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used.
</lmisc>
</lparam>
<misc>EM_GETIMESTATUS Message
Gets a set of status flags that indicate how the edit control interacts with the Input Method Editor (IME).
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_GETIMESTATUS, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
The type of status to retrieve. This parameter can be the following value.
EMSIS_COMPOSITIONSTRING
Sets behavior for handling the composition string.
lParam
This parameter is not used.
Return Value
Data specific to the type of status to retrieve. With the EMSIS_COMPOSITIONSTRING value for status, this return value is one or more of the following values.
EIMES_GETCOMPSTRATONCE If this flag is set, the edit control hooks the WM_IME_COMPOSITION message with fFlags set to GCS_RESULTSTR and returns the result string immediately. If this flag is not set, the edit control passes the WM_IME_COMPOSITION message to the default window procedure and processes the result string from the WM_CHAR message; this is the default behavior of the edit control.
EIMES_CANCELCOMPSTRINFOCUS If this flag is set, the edit control cancels the composition string when it receives the WM_SETFOCUS message. If this flag is not set, the edit control does not cancel the composition string; this is the default behavior of the edit control.
EIMES_COMPLETECOMPSTRKILLFOCUS If this flag is set, the edit control completes the composition string upon receiving the WM_KILLFOCUS message. If this flag is not set, the edit control does not complete the composition string; this is the default behavior of the edit control.
Remarks
Rich Edit: The EM_GETIMESTATUS message is not supported.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 98, Windows 2000</misc>
</message>
<message value="0x479">
<name>EM_GETLANGOPTIONS</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
The return value is one or more of the following values, which indicate the current language option settings.
IMF_AUTOFONT If this flag is set, the control automatically changes fonts when the user explicitly changes to a different keyboard layout.
IMF_AUTOFONTSIZEADJUST Font-bound font sizes are scaled from insertion point size according to a script. For example, Asian fonts are slightly larger than Western. This is the default.
IMF_AUTOKEYBOARD If this flag is set, the control automatically changes the keyboard layout when the user explicitly changes to a different font, or when the user explicitly changes the insertion point to a new location in the text.
IMF_DUALFONT Sets the control to dual-font mode. Used for Asian language text. The control uses an English font for ASCII text and an Asian font for Asian text.
IMF_IMEALWAYSSENDNOTIFY Controls how Rich Edit notifies the client during IME composition:
0: No EN_CHANGE or EN_SELCHANGE notifications during undetermined state. Send notification when final string comes in. (default)
1: Send EN_CHANGE and EN_SELCHANGE events during undetermined state.
IMF_IMECANCELCOMPLETE This flag determines how the control uses the composition string of an IME if the user cancels it. If this flag is set, the control discards the composition string. If this flag is not set, the control uses the composition string as the result string.
IMF_UIFONTS Use UI default fonts. This option is turned off by default.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
Not used; must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used; must be zero. </lmisc>
</lparam>
<misc>EM_GETLANGOPTIONS Message
An application sends an EM_GETLANGOPTIONS message to get a rich edit control's option settings for Input Method Editor (IME) and Asian language support.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_GETLANGOPTIONS, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
The return value is one or more of the following values, which indicate the current language option settings.
IMF_AUTOFONT If this flag is set, the control automatically changes fonts when the user explicitly changes to a different keyboard layout.
IMF_AUTOFONTSIZEADJUST Font-bound font sizes are scaled from insertion point size according to a script. For example, Asian fonts are slightly larger than Western. This is the default.
IMF_AUTOKEYBOARD If this flag is set, the control automatically changes the keyboard layout when the user explicitly changes to a different font, or when the user explicitly changes the insertion point to a new location in the text.
IMF_DUALFONT Sets the control to dual-font mode. Used for Asian language text. The control uses an English font for ASCII text and an Asian font for Asian text.
IMF_IMEALWAYSSENDNOTIFY Controls how Rich Edit notifies the client during IME composition:
0: No EN_CHANGE or EN_SELCHANGE notifications during undetermined state. Send notification when final string comes in. (default)
1: Send EN_CHANGE and EN_SELCHANGE events during undetermined state.
IMF_IMECANCELCOMPLETE This flag determines how the control uses the composition string of an IME if the user cancels it. If this flag is set, the control discards the composition string. If this flag is not set, the control uses the composition string as the result string.
IMF_UIFONTS Use UI default fonts. This option is turned off by default.
Remarks
The IMF_AUTOFONT flag is set by default. The IMF_AUTOKEYBOARD and IMF_IMECANCELCOMPLETE flags are cleared by default.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95 with Rich Edit 2.0, Windows 98, Windows NT 4.0</misc>
</message>
<message value="0x425">
<name>EM_GETLIMITTEXT</name>
<return value="">
<returninfo></returninfo>
<returnmisc>returns LRESULT in lResult</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used; must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used; must be zero.</lmisc>
</lparam>
<misc>EM_GETLIMITTEXT Message
Gets the current text limit for an edit control. You can send this message to either an edit control or a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_GETLIMITTEXT, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
Remarks
Edit controls, Rich Edit 2.0 and later: The text limit is the maximum amount of text, in TCHARs, that the control can contain. For ANSI text, this is the number of bytes; for Unicode text, this is the number of characters. Two documents with the same character limit will yield the same text limit, even if one is ANSI and the other is Unicode.
Rich Edit 1.0: The text limit is the maximum amount of text, in bytes, that the rich edit control can contain.
Rich Edit: Supported in Microsoft Rich Edit 1.0 and later. For information about the compatibility of rich edit versions with the various system versions, see About Rich Edit Controls.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0xC4">
<name>EM_GETLINE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
The return value is the number of TCHARs copied. The return value is zero if the line number specified by the wParam parameter is greater than the number of lines in the edit control.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
The zero-based index of the line to retrieve from a multiline edit control. A value of zero specifies the topmost line. This parameter is ignored by a single-line edit control.
</wmisc>
</wparam>
<lparam value="LPCTSTR">
<lname>lParam</lname>
<lmisc>lParam
A pointer to the buffer that receives a copy of the line. Before sending the message, set the first word of this buffer to the size, in TCHARs, of the buffer. For ANSI text, this is the number of bytes; for Unicode text, this is the number of characters. The size in the first word is overwritten by the copied line.
</lmisc>
</lparam>
<misc>EM_GETLINE Message
Copies a line of text from an edit control and places it in a specified buffer. You can send this message to either an edit control or a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_GETLINE, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) (LPCTSTR) lParam;
);
Parameters
wParam
The zero-based index of the line to retrieve from a multiline edit control. A value of zero specifies the topmost line. This parameter is ignored by a single-line edit control.
lParam
A pointer to the buffer that receives a copy of the line. Before sending the message, set the first word of this buffer to the size, in TCHARs, of the buffer. For ANSI text, this is the number of bytes; for Unicode text, this is the number of characters. The size in the first word is overwritten by the copied line.
Return Value
The return value is the number of TCHARs copied. The return value is zero if the line number specified by the wParam parameter is greater than the number of lines in the edit control.
Remarks
Edit controls: The copied line does not contain a terminating null character.
Rich edit controls: Supported in Microsoft Rich Edit 1.0 and later. The copied line does not contain a terminating null character, unless no text was copied. If no text was copied, the message places a null character at the beginning of the buffer. For information about the compatibility of rich edit versions with the various system versions, see About Rich Edit Controls.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0xBA">
<name>EM_GETLINECOUNT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used; must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used; must be zero. </lmisc>
</lparam>
<misc>EM_GETLINECOUNT Message
Gets the number of lines in a multiline edit control. You can send this message to either an edit control or a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_GETLINECOUNT, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
Remarks
The EM_GETLINECOUNT message retrieves the total number of text lines, not just the number of lines that are currently visible.
If the Wordwrap feature is enabled, the number of lines can change when the dimensions of the editing window change.
Rich Edit: Supported in Microsoft Rich Edit 1.0 and later. For information about the compatibility of rich edit versions with the various system versions, see About Rich Edit Controls.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0xD4">
<name>EM_GETMARGINS</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used; must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used; must be zero.</lmisc>
</lparam>
<misc>EM_GETMARGINS Message
Gets the widths of the left and right margins for an edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_GETMARGINS, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
Remarks
Rich Edit: The EM_GETMARGINS message is not supported.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0xB8">
<name>EM_GETMODIFY</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used; must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used; must be zero. </lmisc>
</lparam>
<misc>EM_GETMODIFY Message
Gets the state of an edit control's modification flag. The flag indicates whether the contents of the edit control have been modified. You can send this message to either an edit control or a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_GETMODIFY, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
Remarks
The system automatically clears the modification flag to zero when the control is created. If the user changes the control's text, the system sets the flag to nonzero. You can send the EM_SETMODIFY message to the edit control to set or clear the flag.
Rich Edit: Supported in Microsoft Rich Edit 1.0 and later. For information about the compatibility of rich edit versions with the various system versions, see About Rich Edit Controls.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x43c">
<name>EM_GETOLEINTERFACE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
If the operation succeeds, the return value is a nonzero value.
If the operation fails, the return value is zero.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used; it must be zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Pointer to a pointer that receives the IRichEditOle object. The control calls the AddRef method for the object before returning, so the calling application must call the Release method when it is done with the object.
</lmisc>
</lparam>
<misc>EM_GETOLEINTERFACE Message
The EM_GETOLEINTERFACE message retrieves an IRichEditOle object that a client can use to access a rich edit control's Component Object Model (COM) functionality.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_GETOLEINTERFACE, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
This parameter is not used; it must be zero.
lParam
Pointer to a pointer that receives the IRichEditOle object. The control calls the AddRef method for the object before returning, so the calling application must call the Release method when it is done with the object.
Return Value
If the operation succeeds, the return value is a nonzero value.
If the operation fails, the return value is zero.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0x44e">
<name>EM_GETOPTIONS</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
This message returns a combination of the current option flag values described in the EM_SETOPTIONS message.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used; must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used; must be zero. </lmisc>
</lparam>
<misc>EM_GETOPTIONS Message
The EM_GETOPTIONS message retrieves rich edit control options.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_GETOPTIONS, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
This message returns a combination of the current option flag values described in the EM_SETOPTIONS message.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0x43d">
<name>EM_GETPARAFORMAT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
This message returns the value of the dwMask member of the PARAFORMAT structure.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used; it must be zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Pointer to a PARAFORMAT structure that receives the paragraph formatting attributes of the current selection.
If more than one paragraph is selected, the structure receives the attributes of the first paragraph, and the dwMask member specifies which attributes are consistent throughout the entire selection.
Microsoft Rich Edit 2.0 and later: This parameter can be a pointer to a PARAFORMAT2 structure, which is an extension of the PARAFORMAT structure. Before sending the EM_GETPARAFORMAT message, set the structure's cbSize member to indicate the version of the structure.
</lmisc>
</lparam>
<misc>EM_GETPARAFORMAT Message
The EM_GETPARAFORMAT message retrieves the paragraph formatting of the current selection in a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_GETPARAFORMAT, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
This parameter is not used; it must be zero.
lParam
Pointer to a PARAFORMAT structure that receives the paragraph formatting attributes of the current selection.
If more than one paragraph is selected, the structure receives the attributes of the first paragraph, and the dwMask member specifies which attributes are consistent throughout the entire selection.
Microsoft Rich Edit 2.0 and later: This parameter can be a pointer to a PARAFORMAT2 structure, which is an extension of the PARAFORMAT structure. Before sending the EM_GETPARAFORMAT message, set the structure's cbSize member to indicate the version of the structure.
Return Value
This message returns the value of the dwMask member of the PARAFORMAT structure.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0xD2">
<name>EM_GETPASSWORDCHAR</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used; must be zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used; must be zero.
</lmisc>
</lparam>
<misc>EM_GETPASSWORDCHAR Message
Gets the password character that an edit control displays when the user enters text. You can send this message to either an edit control or a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_GETPASSWORDCHAR, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
Remarks
If an edit control is created with the ES_PASSWORD style, the default password character is set to an asterisk (*). If an edit control is created without the ES_PASSWORD style, there is no password character. To change the password character, send the EM_SETPASSWORDCHAR message.
Microsoft Windows XP: If an edit control is from user32.dll, an asterisk is the default character for the ES_PASSWORD style. However, if an edit control is from comctl32.dll version 6, a black circle is the default character for the ES_PASSWORD style. Note that comctl32.dll version 6 is not redistributable but is included with Microsoft Windows XP or later. To use comctl32.dll version 6, specify it in a manifest. For more information on manifests, see Enabling Visual Styles.
Edit controls: Multiline edit controls do not support the password style or messages.
Rich edit: Supported in Microsoft Rich Edit 2.0 and later. Both single-line and multiline edit controls support the password style and messages. For information about the compatibility of rich edit versions with the various system versions, see About Rich Edit Controls.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x465">
<name>EM_GETPUNCTUATION</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
If the operation succeeds, the return value is a nonzero value.
If the operation fails, the return value is zero.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
The punctuation type can be one of the following values.
PC_LEADING
Leading punctuation characters
PC_FOLLOWING
Following punctuation characters
PC_DELIMITER
Delimiter
PC_OVERFLOW
Not supported</wmisc>
</wparam>
<lparam value="PUNCTUATION">
<lname>lParam</lname>
<lmisc>lParam
Pointer to a PUNCTUATION structure that receives the punctuation characters. </lmisc>
</lparam>
<misc>EM_GETPUNCTUATION Message
The EM_GETPUNCTUATION message gets the current punctuation characters for the rich edit control. This message is available only in Asian-language versions of the operating system.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_GETPUNCTUATION, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
The punctuation type can be one of the following values.
PC_LEADING
Leading punctuation characters
PC_FOLLOWING
Following punctuation characters
PC_DELIMITER
Delimiter
PC_OVERFLOW
Not supported
lParam
Pointer to a PUNCTUATION structure that receives the punctuation characters.
Return Value
If the operation succeeds, the return value is a nonzero value.
If the operation fails, the return value is zero.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95 (Asian version), Windows NT 4.0 (Asian version)</misc>
</message>
<message value="0xB2">
<name>EM_GETRECT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used.</wmisc>
</wparam>
<lparam value="RECT">
<lname>lParam</lname>
<lmisc>lParam
A pointer to a RECT structure that receives the formatting rectangle. </lmisc>
</lparam>
<misc>EM_GETRECT Message
Gets the formatting rectangle of an edit control. The formatting rectangle is the limiting rectangle into which the control draws the text. The limiting rectangle is independent of the size of the edit-control window. You can send this message to either an edit control or a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_GETRECT, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPRECT) lParam;
);
Parameters
wParam
This parameter is not used.
lParam
A pointer to a RECT structure that receives the formatting rectangle.
Return Value
Remarks
You can modify the formatting rectangle of a multiline edit control by using the EM_SETRECT and EM_SETRECTNP messages.
Under certain conditions, EM_GETRECT might not return the exact values that EM_SETRECT or EM_SETRECTNP set it will be approximately correct, but it can be off by a few pixels.
Rich Edit: Supported in Microsoft Rich Edit 1.0 and later. The formatting rectangle does not include the selection bar, which is an unmarked area to the left of each paragraph. When clicked, the selection bar selects the line. For information about the compatibility of rich edit versions with the various system versions, see About Rich Edit Controls.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x457">
<name>EM_GETREDONAME</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
If the redo queue for the control is not empty, the value returned is an UNDONAMEID enumeration value that indicates the type of the next action in the control's redo queue.
If there are no redoable actions or the type of the next redoable action is unknown, the return value is zero.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used; must be zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used; must be zero. </lmisc>
</lparam>
<misc>EM_GETREDONAME Message
An application sends an EM_GETREDONAME message to a rich edit control to retrieve the type of the next action, if any, in the control's redo queue.
To send this message, call the SendMessage function with the following parameters.
Syntax
lResult = SendMessage(
(HWND) hWnd,
(UINT) EM_GETREDONAME,
(WPARAM) wParam,
(LPARAM) lParam
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
If the redo queue for the control is not empty, the value returned is an UNDONAMEID enumeration value that indicates the type of the next action in the control's redo queue.
If there are no redoable actions or the type of the next redoable action is unknown, the return value is zero.
Remarks
The types of actions that can be undone or redone include typing, delete, drag-drop, cut, and paste operations. This information can be useful for applications that provide an extended user interface for undo and redo operations, such as a drop-down list box of redoable actions.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95 with Rich Edit 2.0, Windows 98, Windows NT 4.0</misc>
</message>
<message value="0x4dd">
<name>EM_GETSCROLLPOS</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
This message always returns 1.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used; it must be zero. </wmisc>
</wparam>
<lparam value="POINT">
<lname>lParam</lname>
<lmisc>lParam
Pointer to a POINT structure. After calling EM_GETSCROLLPOS, this parameters contains a point in the virtual text space of the document, expressed in pixels. This point will be the point that is currently located in the upper-left corner of the edit control window.
</lmisc>
</lparam>
<misc>EM_GETSCROLLPOS Message
An application sends an EM_GETSCROLLPOS message to obtain the current scroll position of the edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_GETSCROLLPOS, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
This parameter is not used; it must be zero.
lParam
Pointer to a POINT structure. After calling EM_GETSCROLLPOS, this parameters contains a point in the virtual text space of the document, expressed in pixels. This point will be the point that is currently located in the upper-left corner of the edit control window.
Return Value
This message always returns 1.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95 with Rich Edit 3.0, Windows NT 4.0 with Rich Edit 3.0, Windows Millennium Edition, Windows 2000</misc>
</message>
<message value="0xB0">
<name>EM_GETSEL</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
The return value is a zero-based value with the starting position of the selection in the low-order word and the position of the first TCHAR after the last selected TCHAR in the high-order word. If either of these values exceeds 65,535, the return value is 1.
It is better to use the values returned in wParam and lParam because they are full 32-bit values.
</returnmisc>
</return>
<wparam value="LPDWORD">
<wname>wParam</wname>
<wmisc> wParam
A pointer to a buffer that receives the starting position of the selection. This parameter can be NULL.
</wmisc>
</wparam>
<lparam value="LPDWORD">
<lname>lParam</lname>
<lmisc>lParam
A pointer to a buffer that receives the position of the first unselected character after the end of the selection. This parameter can be NULL.
</lmisc>
</lparam>
<misc>EM_GETSEL Message
Gets the starting and ending character positions (in TCHARs) of the current selection in an edit control. You can send this message to either an edit control or a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_GETSEL, // message ID
(WPARAM) wParam, // = (WPARAM) (LPDWORD) wParam;
(LPARAM) lParam // = (LPARAM) (LPDWORD) lParam;
);
Parameters
wParam
A pointer to a buffer that receives the starting position of the selection. This parameter can be NULL.
lParam
A pointer to a buffer that receives the position of the first unselected character after the end of the selection. This parameter can be NULL.
Return Value
The return value is a zero-based value with the starting position of the selection in the low-order word and the position of the first TCHAR after the last selected TCHAR in the high-order word. If either of these values exceeds 65,535, the return value is 1.
It is better to use the values returned in wParam and lParam because they are full 32-bit values.
Remarks
If there is no selection, the starting and ending values are both the position of the caret.
Rich edit controls: You can also use the EM_EXGETSEL message to retrieve the same information. EM_EXGETSEL also returns starting and ending character positions as 32-bit values.
Rich Edit: Supported in Microsoft Rich Edit 1.0 and later. For information about the compatibility of rich edit versions with the various system versions, see About Rich Edit Controls.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x43e">
<name>EM_GETSELTEXT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
This message returns the number of characters copied, not including the terminating null character.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used; it must be zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Pointer to a buffer that receives the selected text. The calling application must ensure that the buffer is large enough to hold the selected text.
</lmisc>
</lparam>
<misc>EM_GETSELTEXT Message
The EM_GETSELTEXT message retrieves the currently selected text in a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_GETSELTEXT, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
This parameter is not used; it must be zero.
lParam
Pointer to a buffer that receives the selected text. The calling application must ensure that the buffer is large enough to hold the selected text.
Return Value
This message returns the number of characters copied, not including the terminating null character.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0x45e">
<name>EM_GETTEXTEX</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
The return value is the number of TCHARs copied into the output buffer.
</returnmisc>
</return>
<wparam value="GETTEXTEX">
<wname>wParam</wname>
<wmisc> wParam
Pointer to a GETTEXTEX structure, which indicates how to translate the text before putting it into the output buffer.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Pointer to a null-terminated string that receives the text. The size of this buffer should be placed in the cb member of the GETTEXTEX structure.
</lmisc>
</lparam>
<misc>EM_GETTEXTEX Message
The EM_GETTEXTEX message allows you to get all of the text from the rich edit control in any particular code base you want.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_GETTEXTEX, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Pointer to a GETTEXTEX structure, which indicates how to translate the text before putting it into the output buffer.
lParam
Pointer to a null-terminated string that receives the text. The size of this buffer should be placed in the cb member of the GETTEXTEX structure.
Return Value
The return value is the number of TCHARs copied into the output buffer.
Remarks
If the size of the output buffer is less than the size of the text in the control, the edit control will copy text from its beginning and place it in the buffer until the buffer is full. A terminating null character will still be placed at the end of the buffer.
If ANSI text is requested, EM_GETTEXTEX uses the WideCharToMultiByte function to translate the Unicode characters to ANSI. It allows you to go from Unicode to ANSI using a particular code page. The GETTEXTEX structure contains members (lpDefaultChar and lpUsedDefChar) that are used in the translation from Unicode to ANSI.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95 with Rich Edit 2.0, Windows 98, Windows NT 4.0</misc>
</message>
<message value="0x45f">
<name>EM_GETTEXTLENGTHEX</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
The message returns the number of TCHARs in the edit control, depending on the setting of the flags in the GETTEXTLENGTHEX structure. If incompatible flags were set in the flags member, the message returns E_INVALIDARG .
</returnmisc>
</return>
<wparam value="GETTEXTLENGTHEX">
<wname>wParam</wname>
<wmisc>wParam
Pointer to a GETTEXTLENGTHEX structure that receives the text length information. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used; it must be zero.
</lmisc>
</lparam>
<misc>EM_GETTEXTLENGTHEX Message
The EM_GETTEXTLENGTHEX message calculates text length in various ways. It is usually called before creating a buffer to receive the text from the control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_GETTEXTLENGTHEX, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Pointer to a GETTEXTLENGTHEX structure that receives the text length information.
lParam
This parameter is not used; it must be zero.
Return Value
The message returns the number of TCHARs in the edit control, depending on the setting of the flags in the GETTEXTLENGTHEX structure. If incompatible flags were set in the flags member, the message returns E_INVALIDARG .
Remarks
This message is a fast and easy way to determine the number of characters in the Unicode version of the rich edit control. However, for a non-Unicode target code page you will potentially be converting to a combination of single-byte and double-byte characters.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95 with Rich Edit 2.0, Windows 98, Windows NT 4.0</misc>
</message>
<message value="0x45a">
<name>EM_GETTEXTMODE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
The return value is one or more values from the TEXTMODE enumeration type. The values indicate the current text mode and undo level of the control.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used; must be zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used; must be zero.</lmisc>
</lparam>
<misc>EM_GETTEXTMODE Message
An application sends an EM_GETTEXTMODE message to get the current text mode and undo level of a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_GETTEXTMODE, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
The return value is one or more values from the TEXTMODE enumeration type. The values indicate the current text mode and undo level of the control.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95 with Rich Edit 2.0, Windows 98, Windows NT 4.0</misc>
</message>
<message value="0x44b">
<name>EM_GETTEXTRANGE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
The message returns the number of characters copied, not including the terminating null character.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used; it must be zero. </wmisc>
</wparam>
<lparam value="TEXTRANGE">
<lname>lParam</lname>
<lmisc>lParam
Pointer to a TEXTRANGE structure that specifies the range of characters to retrieve and a buffer to copy the characters to.
</lmisc>
</lparam>
<misc>EM_GETTEXTRANGE Message
The EM_GETTEXTRANGE message retrieves a specified range of characters from a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_GETTEXTRANGE, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
This parameter is not used; it must be zero.
lParam
Pointer to a TEXTRANGE structure that specifies the range of characters to retrieve and a buffer to copy the characters to.
Return Value
The message returns the number of characters copied, not including the terminating null character.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0xBE">
<name>EM_GETTHUMB</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used; must be zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used; must be zero.
</lmisc>
</lparam>
<misc>EM_GETTHUMB Message
Gets the position of the scroll box (thumb) in the vertical scroll bar of a multiline edit control. You can send this message to either an edit control or a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_GETTHUMB, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
Remarks
Rich Edit: Supported in Microsoft Rich Edit 2.0 and later. For information about the compatibility of rich edit versions with the various system versions, see About Rich Edit Controls.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.51</misc>
</message>
<message value="0x4cb">
<name>EM_GETTYPOGRAPHYOPTIONS</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
The return value can be one of the following values.
TO_ADVANCEDTYPOGRAPHY Advanced typography (special line breaking and line formatting) is turned on.
TO_SIMPLELINEBREAK Normal line breaking and formatting is used.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used; must be zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used; must be zero. </lmisc>
</lparam>
<misc>EM_GETTYPOGRAPHYOPTIONS Message
The EM_GETTYPOGRAPHYOPTIONS message returns the current state of the typography options of a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_GETTYPOGRAPHYOPTIONS, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
The return value can be one of the following values.
TO_ADVANCEDTYPOGRAPHY Advanced typography (special line breaking and line formatting) is turned on.
TO_SIMPLELINEBREAK Normal line breaking and formatting is used.
Remarks
You can turn on advanced line breaking by sending the EM_SETTYPOGRAPHYOPTIONS message. Advanced and normal line breaking may also be turned on automatically by the rich edit control if it is needed for certain languages.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95 with Rich Edit 3.0, Windows NT 4.0 with Rich Edit 3.0, Windows Millennium Edition, Windows 2000</misc>
</message>
<message value="0x456">
<name>EM_GETUNDONAME</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
If there is an undo action, the value returned is an UNDONAMEID enumeration value that indicates the type of the next action in the control's undo queue.
If there are no actions that can be undone or the type of the next undo action is unknown, the return value is zero.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used; must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used; must be zero. </lmisc>
</lparam>
<misc>EM_GETUNDONAME Message
Microsoft Rich Edit 2.0 and later: An application sends an EM_GETUNDONAME message to a rich edit control to retrieve the type of the next undo action, if any.
Rich Edit 1.0: This message is not supported.
To send this message, call the SendMessage function with the following parameters.
Syntax
lResult = SendMessage(
(HWND) hWnd,
(UINT) EM_GETUNDONAME,
(WPARAM) wParam,
(LPARAM) lParam
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
If there is an undo action, the value returned is an UNDONAMEID enumeration value that indicates the type of the next action in the control's undo queue.
If there are no actions that can be undone or the type of the next undo action is unknown, the return value is zero.
Remarks
The types of actions that can be undone or redone include typing, delete, drag, drop, cut, and paste operations. This information can be useful for applications that provide an extended user interface for undo and redo operations, such as a drop-down list box of actions that can be undone.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95 with Rich Edit 2.0, Windows 98, Windows NT 4.0</misc>
</message>
<message value="0xD1">
<name>EM_GETWORDBREAKPROC</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used; must be zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used; must be zero. </lmisc>
</lparam>
<misc>EM_GETWORDBREAKPROC Message
Gets the address of the current Wordwrap function. You can send this message to either an edit control or a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_GETWORDBREAKPROC, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
Remarks
A Wordwrap function scans a text buffer that contains text to be sent to the display, looking for the first word that does not fit on the current display line. The wordwrap function places this word at the beginning of the next line on the display. A Wordwrap function defines the point at which the system should break a line of text for multiline edit controls, usually at a space character that separates two words.
Rich Edit: Supported in Microsoft Rich Edit 1.0 and later. For information about the compatibility of rich edit versions with the various system versions, see About Rich Edit Controls.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x450">
<name>EM_GETWORDBREAKPROCEX</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
The message returns the address of the current procedure.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used; must be zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used; must be zero. </lmisc>
</lparam>
<misc>EM_GETWORDBREAKPROCEX Message
The EM_GETWORDBREAKPROCEX message retrieves the address of the currently registered extended word-break procedure.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_GETWORDBREAKPROCEX, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
The message returns the address of the current procedure.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0x467">
<name>EM_GETWORDWRAPMODE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
The message returns the current word wrap and word-break options. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used; must be zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used; must be zero. </lmisc>
</lparam>
<misc>EM_GETWORDWRAPMODE Message
The EM_GETWORDWRAPMODE message gets the current word wrap and word-break options for the rich edit control. This message is available only in Asian-language versions of the operating system.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_GETWORDWRAPMODE, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
The message returns the current word wrap and word-break options.
Remarks
This message must not be sent by the application-defined, word-break procedure.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95 (Asian version), Windows NT 4.0 (Asian version)</misc>
</message>
<message value="0x4e0">
<name>EM_GETZOOM</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Receives the numerator of the zoom ratio. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Receives the denominator of the zoom ratio. </lmisc>
</lparam>
<misc>EM_GETZOOM Message
The EM_GETZOOM message gets the current zoom ratio, which is always between 1/64 and 64.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_GETZOOM, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Receives the numerator of the zoom ratio.
lParam
Receives the denominator of the zoom ratio.
Return Value
The message returns TRUE if message is processed, which it will be if both wParam and lParam are not NULL.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95 with Rich Edit 3.0, Windows NT 4.0 with Rich Edit 3.0, Windows Millennium Edition, Windows 2000</misc>
</message>
<message value="0x43f">
<name>EM_HIDESELECTION</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
This message does not return a value.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Value specifying whether to hide or show the selection. If this parameter is zero, the selection is shown. Otherwise, the selection is hidden.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used; it must be zero.
</lmisc>
</lparam>
<misc>EM_HIDESELECTION Message
The EM_HIDESELECTION message hides or shows the selection in a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_HIDESELECTION, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Value specifying whether to hide or show the selection. If this parameter is zero, the selection is shown. Otherwise, the selection is hidden.
lParam
This parameter is not used; it must be zero.
Return Value
This message does not return a value.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0xC5">
<name>EM_LIMITTEXT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
The maximum number of TCHARs the user can enter. For ANSI text, this is the number of bytes; for Unicode text, this is the number of characters. This number does not include the terminating null character.
Rich edit controls: If this parameter is zero, the text length is set to 64,000 characters.
Edit controls on Windows NT/2000/XP: If this parameter is zero, the text length is set to 0x7FFFFFFE characters for single-line edit controls or -1 for multiline edit controls.
Edit controls on Windows 95/98/Me: If this parameter is zero, the text length is set to 0x7FFE characters for single-line edit controls or 0xFFFF for multiline edit controls.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used. </lmisc>
</lparam>
<misc>EM_LIMITTEXT Message
Sets the text limit of an edit control. The text limit is the maximum amount of text, in TCHARs, that the user can type into the edit control. You can send this message to either an edit control or a rich edit control.
For edit controls and Microsoft Rich Edit 1.0, bytes are used. For Rich Edit 2.0 and later, characters are used.
Syntax
To send this message, call the SendMessage function as follows.
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_LIMITTEXT, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
The maximum number of TCHARs the user can enter. For ANSI text, this is the number of bytes; for Unicode text, this is the number of characters. This number does not include the terminating null character.
Rich edit controls: If this parameter is zero, the text length is set to 64,000 characters.
Edit controls on Windows NT/2000/XP: If this parameter is zero, the text length is set to 0x7FFFFFFE characters for single-line edit controls or -1 for multiline edit controls.
Edit controls on Windows 95/98/Me: If this parameter is zero, the text length is set to 0x7FFE characters for single-line edit controls or 0xFFFF for multiline edit controls.
lParam
This parameter is not used.
Return Value
Remarks
The EM_LIMITTEXT message limits only the text the user can enter. It does not affect any text already in the edit control when the message is sent, nor does it affect the length of the text copied to the edit control by the WM_SETTEXT message. If an application uses the WM_SETTEXT message to place more text into an edit control than is specified in the EM_LIMITTEXT message, the user can edit the entire contents of the edit control.
Before EM_LIMITTEXT is called, the default limit for the amount of text a user can enter in an edit control is 32,767 characters.
Edit controls on Windows NT/2000/XP: For single-line edit controls, the text limit is either 0x7FFFFFFE bytes or the value of the wParam parameter, whichever is smaller. For multiline edit controls, this value is either -1 byte or the value of the wParam parameter, whichever is smaller.
Edit controls on Windows 95/98/Me: For single-line edit controls, the text limit is either 0x7FFE bytes or the value of the wParam parameter, whichever is smaller. For multiline edit controls, this value is either 0xFFFF bytes or the value of the wParam parameter, whichever is smaller.
Rich Edit: Supported in Rich Edit 1.0 and later. Use the message EM_EXLIMITTEXT for text length values greater than 64,000. For information about the compatibility of rich edit versions with the various system versions, see About Rich Edit Controls.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0xC9">
<name>EM_LINEFROMCHAR</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
The return value is the zero-based line number of the line containing the character index specified by wParam.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
The character index of the character contained in the line whose number is to be retrieved. If this parameter is 1, EM_LINEFROMCHAR retrieves either the line number of the current line (the line containing the caret) or, if there is a selection, the line number of the line containing the beginning of the selection.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc> lParam
This parameter is not used. </lmisc>
</lparam>
<misc>EM_LINEFROMCHAR Message
Gets the index of the line that contains the specified character index in a multiline edit control. A character index is the zero-based index of the character from the beginning of the edit control. You can send this message to either an edit control or a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_LINEFROMCHAR, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
The character index of the character contained in the line whose number is to be retrieved. If this parameter is 1, EM_LINEFROMCHAR retrieves either the line number of the current line (the line containing the caret) or, if there is a selection, the line number of the line containing the beginning of the selection.
lParam
This parameter is not used.
Return Value
The return value is the zero-based line number of the line containing the character index specified by wParam.
Remarks
Rich Edit: Supported in Microsoft Rich Edit 1.0 and later. If the character index is greater than 64,000, use the EM_EXLINEFROMCHAR message. For information about the compatibility of rich edit versions with the various system versions, see About Rich Edit Controls.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0xBB">
<name>EM_LINEINDEX</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
The return value is the character index of the line specified in the wParam parameter, or it is 1 if the specified line number is greater than the number of lines in the edit control.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
The zero-based line number. A value of 1 specifies the current line number (the line that contains the caret).
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used.
</lmisc>
</lparam>
<misc>EM_LINEINDEX Message
Gets the character index of the first character of a specified line in a multiline edit control. A character index is the zero-based index of the character from the beginning of the edit control. You can send this message to either an edit control or a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_LINEINDEX, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
The zero-based line number. A value of 1 specifies the current line number (the line that contains the caret).
lParam
This parameter is not used.
Return Value
The return value is the character index of the line specified in the wParam parameter, or it is 1 if the specified line number is greater than the number of lines in the edit control.
Remarks
Rich Edit: Supported in Microsoft Rich Edit 1.0 and later. For information about the compatibility of rich edit versions with the various system versions, see About Rich Edit Controls.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0xC1">
<name>EM_LINELENGTH</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
For multiline edit controls, the return value is the length, in TCHARs, of the line specified by the wParam parameter. For ANSI text, this is the number of bytes; for Unicode text, this is the number of characters. It does not include the carriage-return character at the end of the line.
For single-line edit controls, the return value is the length, in TCHARs, of the text in the edit control.
If wParam is greater than the number of characters in the control, the return value is zero.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
The character index of a character in the line whose length is to be retrieved. If this parameter is greater than the number of characters in the control, the return value is zero.
This parameter can be 1. In this case, the message returns the number of unselected characters on lines containing selected characters. For example, if the selection extended from the fourth character of one line through the eighth character from the end of the next line, the return value would be 10 (three characters on the first line and seven on the next).
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used. </lmisc>
</lparam>
<misc>EM_LINELENGTH Message
Retrieves the length, in characters, of a line in an edit control. You can send this message to either an edit control or a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_LINELENGTH, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
The character index of a character in the line whose length is to be retrieved. If this parameter is greater than the number of characters in the control, the return value is zero.
This parameter can be 1. In this case, the message returns the number of unselected characters on lines containing selected characters. For example, if the selection extended from the fourth character of one line through the eighth character from the end of the next line, the return value would be 10 (three characters on the first line and seven on the next).
lParam
This parameter is not used.
Return Value
For multiline edit controls, the return value is the length, in TCHARs, of the line specified by the wParam parameter. For ANSI text, this is the number of bytes; for Unicode text, this is the number of characters. It does not include the carriage-return character at the end of the line.
For single-line edit controls, the return value is the length, in TCHARs, of the text in the edit control.
If wParam is greater than the number of characters in the control, the return value is zero.
Remarks
Use the EM_LINEINDEX message to retrieve a character index for a given line number within a multiline edit control.
Rich Edit: Supported in Microsoft Rich Edit 1.0 and later. For information about the compatibility of rich edit versions with the various system versions, see About Rich Edit Controls.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0xB6">
<name>EM_LINESCROLL</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
If the message is sent to a multiline edit control, the return value is TRUE.
If the message is sent to a single-line edit control, the return value is FALSE.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Edit controls: The number of characters to scroll horizontally.
Rich edit controls: This parameter is not used; it must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
The number of lines to scroll vertically. </lmisc>
</lparam>
<misc>EM_LINESCROLL Message
Scrolls the text in a multiline edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_LINESCROLL, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Edit controls: The number of characters to scroll horizontally.
Rich edit controls: This parameter is not used; it must be zero.
lParam
The number of lines to scroll vertically.
Return Value
If the message is sent to a multiline edit control, the return value is TRUE.
If the message is sent to a single-line edit control, the return value is FALSE.
Remarks
The control does not scroll vertically past the last line of text in the edit control. If the current line plus the number of lines specified by the lParam parameter exceeds the total number of lines in the edit control, the value is adjusted so that the last line of the edit control is scrolled to the top of the edit-control window.
Edit controls: The EM_LINESCROLL message scrolls the text vertically or horizontally in a multiline edit control. The EM_LINESCROLL message can be used to scroll horizontally past the last character of any line.
Rich Edit: Supported in Microsoft Rich Edit 1.0 and later. The EM_LINESCROLL message scrolls the text vertically in a multiline edit control. For information about the compatibility of rich edit versions with the various system versions, see About Rich Edit Controls.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x4dc">
<name>EM_OUTLINE</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x440">
<name>EM_PASTESPECIAL</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
This message does not return a value.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the Clipboard Formats. </wmisc>
</wparam>
<lparam value="REPASTESPECIAL">
<lname>lParam</lname>
<lmisc>lParam
Pointer to a REPASTESPECIAL structure or NULL. If an object is being pasted, the REPASTESPECIAL structure is filled in with the desired display aspect. If lParam is NULL or the dwAspect member is zero, the display aspect used will be the contents of the object descriptor.
</lmisc>
</lparam>
<misc>EM_PASTESPECIAL Message
The EM_PASTESPECIAL message pastes a specific clipboard format in a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_PASTESPECIAL, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Specifies the Clipboard Formats.
lParam
Pointer to a REPASTESPECIAL structure or NULL. If an object is being pasted, the REPASTESPECIAL structure is filled in with the desired display aspect. If lParam is NULL or the dwAspect member is zero, the display aspect used will be the contents of the object descriptor.
Return Value
This message does not return a value.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0x426">
<name>EM_POSFROMCHAR</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Rich Edit 1.0 and 3.0: The return value is not used.
Edit controls and Rich Edit 2.0: The return value contains the client area coordinates of the character. The low-order word contains the horizontal coordinate and the high-order word contains the vertical coordinate.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
Rich Edit 1.0 and 3.0: A pointer to a POINTL structure that receives the client area coordinates of the character. The coordinates are in screen units and are relative to the upper-left corner of the control's client area.
Edit controls and Rich Edit 2.0: The zero-based index of the character. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Rich Edit 1.0 and 3.0: The zero-based index of the character.
Edit controls and Rich Edit 2.0: This parameter is not used. </lmisc>
</lparam>
<misc>EM_POSFROMCHAR Message
Retrieves the client area coordinates of a specified character in an edit control. You can send this message to either an edit control or a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_POSFROMCHAR, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Rich Edit 1.0 and 3.0: A pointer to a POINTL structure that receives the client area coordinates of the character. The coordinates are in screen units and are relative to the upper-left corner of the control's client area.
Edit controls and Rich Edit 2.0: The zero-based index of the character.
lParam
Rich Edit 1.0 and 3.0: The zero-based index of the character.
Edit controls and Rich Edit 2.0: This parameter is not used.
Return Value
Rich Edit 1.0 and 3.0: The return value is not used.
Edit controls and Rich Edit 2.0: The return value contains the client area coordinates of the character. The low-order word contains the horizontal coordinate and the high-order word contains the vertical coordinate.
Remarks
A returned coordinate can be a negative value if the specified character is not displayed in the edit control's client area. The coordinates are truncated to integer values.
If the character is a line delimiter, the returned coordinates indicate a point just beyond the last visible character in the line. If the specified index is greater than the index of the last character in the control, the control returns -1.
Rich Edit 3.0 and later: For backward compatibility, Microsoft Rich Edit 3.0 supports the syntax used by Rich Edit 2.0. If Rich Edit 3.0 detects that wParam is not a valid POINTL pointer, it assumes the message was sent using the Rich Edit 2.0 syntax. In this case, it uses the return value to return the coordinates.
Rich Edit: Supported in Rich Edit 1.0 and later. For information about the compatibility of rich edit versions with the various system versions, see About Rich Edit Controls.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0x47d">
<name>EM_RECONVERSION</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
This message always returns zero.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used; must be zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used; must be zero.</lmisc>
</lparam>
<misc>EM_RECONVERSION Message
The EM_RECONVERSION message invokes the Input Method Editor (IME) reconversion dialog box.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_RECONVERSION, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
This message always returns zero.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95 with Rich Edit 3.0, Windows NT 4.0 with Rich Edit 3.0, Windows Millennium Edition, Windows 2000</misc>
</message>
<message value="0x454">
<name>EM_REDO</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
If the Redo operation succeeds, the return value is a nonzero value.
If the Redo operation fails, the return value is zero.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used; must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used; must be zero. </lmisc>
</lparam>
<misc>EM_REDO Message
Send an EM_REDO message to a rich edit control to redo the next action in the control's redo queue.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_REDO, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
If the Redo operation succeeds, the return value is a nonzero value.
If the Redo operation fails, the return value is zero.
Remarks
To determine whether there are any actions in the control's redo queue, send the EM_CANREDO message.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95 with Rich Edit 2.0, Windows 98, Windows NT 4.0</misc>
</message>
<message value="0xC2">
<name>EM_REPLACESEL</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies whether the replacement operation can be undone. If this is TRUE, the operation can be undone. If this is FALSE , the operation cannot be undone.
</wmisc>
</wparam>
<lparam value="LPCTSTR">
<lname>lParam</lname>
<lmisc>lParam
A pointer to a null-terminated string containing the replacement text.
</lmisc>
</lparam>
<misc>EM_REPLACESEL Message
Replaces the selected text in an edit control or a rich edit control with the specified text.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_REPLACESEL, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) (LPCTSTR) lParam;
);
Parameters
wParam
Specifies whether the replacement operation can be undone. If this is TRUE, the operation can be undone. If this is FALSE , the operation cannot be undone.
lParam
A pointer to a null-terminated string containing the replacement text.
Return Value
Remarks
Use the EM_REPLACESEL message to replace only a portion of the text in an edit control. To replace all of the text, use the WM_SETTEXT message.
If there is no selection, the replacement text is inserted at the caret.
Rich Edit: Supported in Microsoft Rich Edit 1.0 and later. For information about the compatibility of rich edit versions with the various system versions, see About Rich Edit Controls.
In a rich edit control, the replacement text takes the formatting of the character at the caret or, if there is a selection, of the first character in the selection.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x441">
<name>EM_REQUESTRESIZE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
This message does not return a value.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used; must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used; must be zero. </lmisc>
</lparam>
<misc>EM_REQUESTRESIZE Message
The EM_REQUESTRESIZE message forces a rich edit control to send an EN_REQUESTRESIZE notification message to its parent window.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_REQUESTRESIZE, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
This message does not return a value.
Remarks
This message is useful during WM_SIZE processing for the parent of a bottomless rich edit control.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0xB5">
<name>EM_SCROLL</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
If the message is successful, the high-order word of the return value is TRUE, and the low-order word is the number of lines that the command scrolls. The number returned may not be the same as the actual number of lines scrolled if the scrolling moves to the beginning or the end of the text. If the wParam parameter specifies an invalid value, the return value is FALSE.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
The action the scroll bar is to take. This parameter can be one of the following values.
SB_LINEDOWN
Scrolls down one line.
SB_LINEUP
Scrolls up one line.
SB_PAGEDOWN
Scrolls down one page.
SB_PAGEUP
Scrolls up one page.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used. </lmisc>
</lparam>
<misc>EM_SCROLL Message
Scrolls the text vertically in a multiline edit control. This message is equivalent to sending a WM_VSCROLL message to the edit control. You can send this message to either an edit control or a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_SCROLL, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
The action the scroll bar is to take. This parameter can be one of the following values.
SB_LINEDOWN
Scrolls down one line.
SB_LINEUP
Scrolls up one line.
SB_PAGEDOWN
Scrolls down one page.
SB_PAGEUP
Scrolls up one page.
lParam
This parameter is not used.
Return Value
If the message is successful, the high-order word of the return value is TRUE, and the low-order word is the number of lines that the command scrolls. The number returned may not be the same as the actual number of lines scrolled if the scrolling moves to the beginning or the end of the text. If the wParam parameter specifies an invalid value, the return value is FALSE.
Remarks
To scroll to a specific line or character position, use the EM_LINESCROLL message. To scroll the caret into view, use the EM_SCROLLCARET message.
Rich Edit: Supported in Microsoft Rich Edit 1.0 and later. For information about the compatibility of rich edit versions with the various system versions, see About Rich Edit Controls.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0xB7">
<name>EM_SCROLLCARET</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is reserved. It should be set to zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is reserved. It should be set to zero. </lmisc>
</lparam>
<misc>EM_SCROLLCARET Message
Scrolls the caret into view in an edit control. You can send this message to either an edit control or a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_SCROLLCARET, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
This parameter is reserved. It should be set to zero.
lParam
This parameter is reserved. It should be set to zero.
Return Value
Remarks
Rich Edit: Supported in Microsoft Rich Edit 1.0 and later. For information about the compatibility of rich edit versions with the various system versions, see About Rich Edit Controls.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x442">
<name>EM_SELECTIONTYPE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
If the selection is empty, the return value is SEL_EMPTY.
If the selection is not empty, the return value is a set of flags containing one or more of the following values.
SEL_TEXT Text.
SEL_OBJECT At least one Component Object Model (COM) object.
SEL_MULTICHAR More than one character of text.
SEL_MULTIOBJECT More than one COM object.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used; must be zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used; must be zero. </lmisc>
</lparam>
<misc>EM_SELECTIONTYPE Message
The EM_SELECTIONTYPE message determines the selection type for a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_SELECTIONTYPE, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
If the selection is empty, the return value is SEL_EMPTY.
If the selection is not empty, the return value is a set of flags containing one or more of the following values.
SEL_TEXT Text.
SEL_OBJECT At least one Component Object Model (COM) object.
SEL_MULTICHAR More than one character of text.
SEL_MULTIOBJECT More than one COM object.
Remarks
This message is useful during WM_SIZE processing for the parent of a bottomless rich edit control.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0x4c8">
<name>EM_SETBIDIOPTIONS</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
This message does not return a value.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used; it must be zero. </wmisc>
</wparam>
<lparam value="BIDIOPTIONS">
<lname>lParam</lname>
<lmisc>lParam
Pointer to a BIDIOPTIONS structure that indicates how to set the state of the bidirectional options in the rich edit control.
</lmisc>
</lparam>
<misc>EM_SETBIDIOPTIONS Message
The EM_SETBIDIOPTIONS message sets the current state of the bidirectional options in the rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_SETBIDIOPTIONS, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
This parameter is not used; it must be zero.
lParam
Pointer to a BIDIOPTIONS structure that indicates how to set the state of the bidirectional options in the rich edit control.
Return Value
This message does not return a value.
Remarks
The rich edit control must be in plain text mode or EM_SETBIDIOPTIONS will not do anything.
In plain text controls, EM_SETBIDIOPTIONS automatically determines the paragraph direction and/or alignment based on the context rules. These rules state that the direction and/or alignment is derived from the first strong character in the control. A strong character is one from which text direction can be determined (see Unicode Standard version 2.0). The paragraph direction and/or alignment is applied to the default format.
EM_SETBIDIOPTIONS only switches the default paragraph format to RTL (right to left) if it finds an RTL character,
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95 (Middle Eastern) with Rich Edit 3.0, Windows NT 4.0 (Middle Eastern) with Rich Edit 3.0, Windows Millennium Edition (Middle Eastern), Windows 2000 (Middle Eastern)</misc>
</message>
<message value="0x443">
<name>EM_SETBKGNDCOLOR</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
This message returns the original background color.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies whether to use the system color. If this parameter is a nonzero value, the background is set to the window background system color. Otherwise, the background is set to the specified color.
</wmisc>
</wparam>
<lparam value="COLORREF">
<lname>lParam</lname>
<lmisc>lParam
A COLORREF structure specifying the color if wParam is zero. To generate a COLORREF, use the RGB macro.
</lmisc>
</lparam>
<misc>EM_SETBKGNDCOLOR Message
The EM_SETBKGNDCOLOR message sets the background color for a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_SETBKGNDCOLOR, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Specifies whether to use the system color. If this parameter is a nonzero value, the background is set to the window background system color. Otherwise, the background is set to the specified color.
lParam
A COLORREF structure specifying the color if wParam is zero. To generate a COLORREF, use the RGB macro.
Return Value
This message returns the original background color.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95, Windows NT 4.0
See Also</misc>
</message>
<message value="0x444">
<name>EM_SETCHARFORMAT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
If the operation succeeds, the return value is a nonzero value.
If the operation fails, the return value is zero.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
Character formatting that applies to the control. If this parameter is zero, the default character format is set. Otherwise, it can be one of the following values.
SCF_ALL
Applies the formatting to all text in the control. Not valid with SCF_SELECTION or SCF_WORD.
SCF_SELECTION
Applies the formatting to the current selection. If the selection is empty, the character formatting is applied to the insertion point, and the new character format is in effect only until the insertion point changes.
SCF_WORD
Applies the formatting to the selected word or words. If the selection is empty but the insertion point is inside a word, the formatting is applied to the word. The SCF_WORD value must be used in conjunction with the SCF_SELECTION value.
SCF_ASSOCIATEFONT
RichEdit 4.1: Associates a font to a given script, thus changing the default font for that script. To specify the font, use the following members of CHARFORMAT2: yHeight, bCharSet, bPitchAndFamily, szFaceName, and lcid.
SCF_ASSOCIATEFONT2
RichEdit 4.1: Associates a surrogate (plane-2) font to a given script, thus changing the default font for that script. To specify the font, use the following members of CHARFORMAT2: yHeight, bCharSet, bPitchAndFamily, szFaceName, and lcid.
SCF_DEFAULT
RichEdit 4.1: Sets the default font for the control.
SCF_NOKBUPDATE
RichEdit 4.1: Prevents keyboard switching to match the font. For example, if an Arabic font is set, normally the autokeyboard feature for Bidi languages changes the keyboard to an Arabic keyboard.
SCF_USEUIRULES
RichEdit 4.1: Used with SCF_SELECTION. Indicates that format came from a toolbar or other UI tool, so UI formatting rules should be used instead of literal formatting.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Pointer to a CHARFORMAT structure specifying the character formatting to use. Only the formatting attributes specified by the dwMask member are changed.
Microsoft Rich Edit 2.0 and later: This parameter can be a pointer to a CHARFORMAT2 structure, which is an extension of the CHARFORMAT structure. Before sending the EM_SETCHARFORMAT message, set the structure's cbSize member to indicate the version of the structure.
The szFaceName and bCharSet may be overruled when invalid for characters, for example: Arial on kanji characters.
</lmisc>
</lparam>
<misc>EM_SETCHARFORMAT Message
The EM_SETCHARFORMAT message sets character formatting in a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_SETCHARFORMAT, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Character formatting that applies to the control. If this parameter is zero, the default character format is set. Otherwise, it can be one of the following values.
SCF_ALL
Applies the formatting to all text in the control. Not valid with SCF_SELECTION or SCF_WORD.
SCF_SELECTION
Applies the formatting to the current selection. If the selection is empty, the character formatting is applied to the insertion point, and the new character format is in effect only until the insertion point changes.
SCF_WORD
Applies the formatting to the selected word or words. If the selection is empty but the insertion point is inside a word, the formatting is applied to the word. The SCF_WORD value must be used in conjunction with the SCF_SELECTION value.
SCF_ASSOCIATEFONT
RichEdit 4.1: Associates a font to a given script, thus changing the default font for that script. To specify the font, use the following members of CHARFORMAT2: yHeight, bCharSet, bPitchAndFamily, szFaceName, and lcid.
SCF_ASSOCIATEFONT2
RichEdit 4.1: Associates a surrogate (plane-2) font to a given script, thus changing the default font for that script. To specify the font, use the following members of CHARFORMAT2: yHeight, bCharSet, bPitchAndFamily, szFaceName, and lcid.
SCF_DEFAULT
RichEdit 4.1: Sets the default font for the control.
SCF_NOKBUPDATE
RichEdit 4.1: Prevents keyboard switching to match the font. For example, if an Arabic font is set, normally the autokeyboard feature for Bidi languages changes the keyboard to an Arabic keyboard.
SCF_USEUIRULES
RichEdit 4.1: Used with SCF_SELECTION. Indicates that format came from a toolbar or other UI tool, so UI formatting rules should be used instead of literal formatting.
lParam
Pointer to a CHARFORMAT structure specifying the character formatting to use. Only the formatting attributes specified by the dwMask member are changed.
Microsoft Rich Edit 2.0 and later: This parameter can be a pointer to a CHARFORMAT2 structure, which is an extension of the CHARFORMAT structure. Before sending the EM_SETCHARFORMAT message, set the structure's cbSize member to indicate the version of the structure.
The szFaceName and bCharSet may be overruled when invalid for characters, for example: Arial on kanji characters.
Return Value
If the operation succeeds, the return value is a nonzero value.
If the operation fails, the return value is zero.
Remarks
If this message is sent more than once with the same parameters, the effect on the text is toggled. That is, sending the message once produces the effect, sending the message twice cancels the effect, and so forth.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0x1501">
<name>EM_SETCUEBANNER</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="BOOL">
<wname>wParam</wname>
<wmisc>wParam
[in] TRUE if the cue banner should show even when the edit control has focus; otherwise, FALSE. FALSE is the default behavior the cue banner disappears when the user clicks in the control.
</wmisc>
</wparam>
<lparam value="LPCWSTR">
<lname>lParam</lname>
<lmisc>lParam
[in] A pointer to a Unicode string that contains the text to display as the textual cue.
</lmisc>
</lparam>
<misc>EM_SETCUEBANNER Message
Sets the textual cue, or tip, that is displayed by the edit control to prompt the user for information.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_SETCUEBANNER, // message ID
(WPARAM) wParam, // = (WPARAM) (BOOL) wParam;
(LPARAM) lParam // = (LPARAM) (LPCWSTR) lParam;
);
Parameters
wParam
[in] TRUE if the cue banner should show even when the edit control has focus; otherwise, FALSE. FALSE is the default behavior the cue banner disappears when the user clicks in the control.
lParam
[in] A pointer to a Unicode string that contains the text to display as the textual cue.
Return Value
Remarks
An edit control that is used to begin a search may display "Enter search here" in gray text as a textual cue. When the user clicks the text, the text goes away and the user can type.
You cannot set a cue banner on a multiline edit control or on a rich edit control.
Note To use this API, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.
Message Information
Header Declared in Commctrl.h
Minimum operating systems Windows XP</misc>
</message>
<message value="0x4cc">
<name>EM_SETEDITSTYLE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
The return value is the state of the edit style flags after rich edit has attempted to implement your edit style changes. The edit style flags are a set of flags that indicate the current edit style, made up of the values in the preceding table.
</returnmisc>
</return>
<wparam value="DWORD">
<wname>wParam</wname>
<wmisc> wParam
Specifies one of the following values.
SES_EMULATESYSEDIT
When this bit is on, rich edit attempts to emulate the system edit control.
SES_BEEPONMAXTEXT
Rich Edit will call the system beeper if the user attempts to enter more than the maximum characters.
SES_EXTENDBACKCOLOR
Extends the background color all the way to the edges of the client rectangle.
SES_USEAIMM
Uses the AIMM input method component that ships with Microsoft Internet Explorer 4.0 or later.
SES_UPPERCASE
Converts all input characters to uppercase.
SES_LOWERCASE
Converts all input characters to lowercase.
SES_NOINPUTSEQUENCECHK
When this bit is on, rich edit does not verify the sequence of typed text. Some languages (such as Thai and Vietnamese) require verifying the input sequence order before submitting it to the backing store.
SES_XLTCRCRLFTOCR
Turns on translation of CRCRLFs to CRs. When this bit is on and a file is read in, all instances of CRCRLF will be converted to hard CRs internally. This will affect the text wrapping. Note that if such a file is saved as plain text, the CRs will be replaced by CRLFs. This is the .txt standard for plain text.
SES_NOIME
Disallows IMEs for this control instance.
SES_BIDI
Turns on bidirectional processing. This is automatically turned on by Microsoft Rich Edit if any of the following window styles are active: WS_EX_RIGHT, WS_EX_RTLREADING, WS_EX_LEFTSCROLLBAR. However, this setting is useful for handling these window styles when using a custom implementation of ITextHost.
SES_SCROLLONKILLFOCUS
When KillFocus occurs, scroll to the beginning of the text (cp=0).
SES_DRAFTMODE
Windows XP SP1: Use draftmode fonts to display text. Draft mode is an accessibility option where the control displays the text with a single font; the font is determined by the system setting for the font used in message boxes. For example, accessible users may read text easier if it is uniform, rather than a mix of fonts and styles.
SES_USECTF
Windows XP SP1: Turns on Text Services Framework (TSF) support.
SES_HIDEGRIDLINES
Windows XP SP1: If the table gridlines width is zero, gridlines are not displayed. This is equivalent to the hide gridlines feature in Microsoft Word's table menu.
SES_USEATFONT
Windows XP SP1: Uses an @ font, which is designed for vertical text; this is used with the ES_VERTICAL window style. The name of an @ font begins with the @ symbol, for example, "@Batang."
SES_CTFALLOWEMBED
Windows XP SP1: Allows embedded objects to be inserted using TSF.
SES_CTFALLOWSMARTTAG
Windows XP SP1: Allows TSF SmartTag tips.
SES_CTFALLOWPROOFING
Windows XP SP1: Allows TSF proofing tips.</wmisc>
</wparam>
<lparam value="DWORD">
<lname>lParam</lname>
<lmisc> lParam
A mask consisting of one or more of the wParam values. Only the values specified in this mask will be set or cleared. This allows a single flag to be set or cleared without reading the current flag states.
</lmisc>
</lparam>
<misc>EM_SETEDITSTYLE Message
The EM_SETEDITSTYLE message sets the current edit style flags.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_SETEDITSTYLE, // message ID
(WPARAM) wParam, // = (WPARAM) (DWORD) wParam;
(LPARAM) lParam // = (LPARAM) (DWORD) lParam;
);
Parameters
wParam
Specifies one of the following values.
SES_EMULATESYSEDIT
When this bit is on, rich edit attempts to emulate the system edit control.
SES_BEEPONMAXTEXT
Rich Edit will call the system beeper if the user attempts to enter more than the maximum characters.
SES_EXTENDBACKCOLOR
Extends the background color all the way to the edges of the client rectangle.
SES_USEAIMM
Uses the AIMM input method component that ships with Microsoft Internet Explorer 4.0 or later.
SES_UPPERCASE
Converts all input characters to uppercase.
SES_LOWERCASE
Converts all input characters to lowercase.
SES_NOINPUTSEQUENCECHK
When this bit is on, rich edit does not verify the sequence of typed text. Some languages (such as Thai and Vietnamese) require verifying the input sequence order before submitting it to the backing store.
SES_XLTCRCRLFTOCR
Turns on translation of CRCRLFs to CRs. When this bit is on and a file is read in, all instances of CRCRLF will be converted to hard CRs internally. This will affect the text wrapping. Note that if such a file is saved as plain text, the CRs will be replaced by CRLFs. This is the .txt standard for plain text.
SES_NOIME
Disallows IMEs for this control instance.
SES_BIDI
Turns on bidirectional processing. This is automatically turned on by Microsoft Rich Edit if any of the following window styles are active: WS_EX_RIGHT, WS_EX_RTLREADING, WS_EX_LEFTSCROLLBAR. However, this setting is useful for handling these window styles when using a custom implementation of ITextHost.
SES_SCROLLONKILLFOCUS
When KillFocus occurs, scroll to the beginning of the text (cp=0).
SES_DRAFTMODE
Windows XP SP1: Use draftmode fonts to display text. Draft mode is an accessibility option where the control displays the text with a single font; the font is determined by the system setting for the font used in message boxes. For example, accessible users may read text easier if it is uniform, rather than a mix of fonts and styles.
SES_USECTF
Windows XP SP1: Turns on Text Services Framework (TSF) support.
SES_HIDEGRIDLINES
Windows XP SP1: If the table gridlines width is zero, gridlines are not displayed. This is equivalent to the hide gridlines feature in Microsoft Word's table menu.
SES_USEATFONT
Windows XP SP1: Uses an @ font, which is designed for vertical text; this is used with the ES_VERTICAL window style. The name of an @ font begins with the @ symbol, for example, "@Batang."
SES_CTFALLOWEMBED
Windows XP SP1: Allows embedded objects to be inserted using TSF.
SES_CTFALLOWSMARTTAG
Windows XP SP1: Allows TSF SmartTag tips.
SES_CTFALLOWPROOFING
Windows XP SP1: Allows TSF proofing tips.
lParam
A mask consisting of one or more of the wParam values. Only the values specified in this mask will be set or cleared. This allows a single flag to be set or cleared without reading the current flag states.
Return Value
The return value is the state of the edit style flags after rich edit has attempted to implement your edit style changes. The edit style flags are a set of flags that indicate the current edit style, made up of the values in the preceding table.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95 with Rich Edit 3.0, Windows NT 4.0 with Rich Edit 3.0, Windows Millennium Edition, Windows 2000</misc>
</message>
<message value="0x445">
<name>EM_SETEVENTMASK</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used; it must be zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
New event mask for the rich edit control. For a list of event masks, see Rich Edit Control Event Mask Flags.
</lmisc>
</lparam>
<misc>EM_SETEVENTMASK Message
The EM_SETEVENTMASK message sets the event mask for a rich edit control. The event mask specifies which notification messages the control sends to its parent window.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_SETEVENTMASK, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
This parameter is not used; it must be zero.
lParam
New event mask for the rich edit control. For a list of event masks, see Rich Edit Control Event Mask Flags.
Return Value
Remarks
The default event mask (before any is set) is ENM_NONE.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0x4df">
<name>EM_SETFONTSIZE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
If no error occurred, the return value is TRUE.
If an error occurred, the return value is FALSE.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
Change in point size of the selected text. The result will be rounded according to values shown in the following table. This parameter should be in the range of 1637 to 1638. The resulting font size will be within the range of 1 to 1638.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used; it must be zero.
</lmisc>
</lparam>
<misc>EM_SETFONTSIZE Message
The EM_SETFONTSIZE message sets the font size for the selected text.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_SETFONTSIZE, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Change in point size of the selected text. The result will be rounded according to values shown in the following table. This parameter should be in the range of 1637 to 1638. The resulting font size will be within the range of 1 to 1638.
lParam
This parameter is not used; it must be zero.
Return Value
If no error occurred, the return value is TRUE.
If an error occurred, the return value is FALSE.
Remarks
You can easily get the font size by sending the EM_GETCHARFORMAT message.
Rich Edit first adds wParamto the current font size and then uses the resulting size and the following table to determine the rounding value.
Band Rounding value
12 1
28 2
36 0
48 0
72 0
80 0
80 10
If the resulting font size is not evenly divisible by the rounding value, the font size is then rounded to a number evenly divisible by the rounding value. So if the font size is less than or equal to 12, the rounding value will be 1. Similarly, if the font size is less than or equal to 28, the rounding value is 2. For values greater than 28, font sizes are rounded to the next band. So, the font size jumps to 36, 48, 72, 80. After 80, all rounding is done in increments of ten points.
The font size is rounded up or down depending on the sign of wParam. If wParam is positive, the rounding is always up. Otherwise, rounding is always down. So, if the current font size is 10 and wParam is 3, the resulting font size would be 14 (10 + 3 = 13, which is not divisible by 2, so the size rounds up to 14). Conversely, if the current font size is 14 and wParam is 3, the resulting font size would be 10 (14 3 = 11, which is not divisible by 2, so the size rounds down to 10).
The change is applied to each part of the selection. So, if some of the text is 10pt and some 20pt, after a call with wParam set to 1, the font sizes become 11pt and 22pt, respectively.
Additional examples are shown in the following table.
Original font size wParam Resulting font size
7 1 8
7 3 10
10 3 14
14 -3 10
28 1 36
28 3 36
80 1 90
80 -1 72
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95 with Rich Edit 3.0, Windows NT 4.0 with Rich Edit 3.0, Windows Millennium Edition, Windows 2000</misc>
</message>
<message value="0xBC">
<name>EM_SETHANDLE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="HLOCAL">
<wname>wParam</wname>
<wmisc>wParam
A handle to the memory buffer the edit control uses to store the currently displayed text instead of allocating its own memory. If necessary, the control reallocates this memory.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used.
</lmisc>
</lparam>
<misc>EM_SETHANDLE Message
Sets the handle of the memory that will be used by a multiline edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_SETHANDLE, // message ID
(WPARAM) wParam, // = (WPARAM) (HLOCAL) wParam;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
A handle to the memory buffer the edit control uses to store the currently displayed text instead of allocating its own memory. If necessary, the control reallocates this memory.
lParam
This parameter is not used.
Return Value
Remarks
Before an application sets a new memory handle, it should send an EM_GETHANDLE message to retrieve the handle of the current memory buffer and should free that memory.
An edit control automatically reallocates the given buffer whenever it needs additional space for text, or it removes enough text so that additional space is no longer needed.
Sending an EM_SETHANDLE message clears the undo buffer (EM_CANUNDO returns zero) and the internal modification flag (EM_GETMODIFY returns zero). The edit control window is redrawn.
Rich Edit: The EM_SETHANDLE message is not supported. Rich edit controls do not store text as a simple array of characters.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows NT 3.1</misc>
</message>
<message value="0x468">
<name>EM_SETIMECOLOR</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
If the operation succeeds, the return value is a nonzero value.
If the operation fails, the return value is zero.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used; it must be zero. </wmisc>
</wparam>
<lparam value="COMPCOLOR">
<lname>lParam</lname>
<lmisc>lParam
Pointer to a COMPCOLOR structure that contains the composition color to be set.
</lmisc>
</lparam>
<misc>EM_SETIMECOLOR Message
The EM_SETIMECOLOR message sets the Input Method Editor (IME) composition color. This message is available only in Asian-language versions of the operating system.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_SETIMECOLOR, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
This parameter is not used; it must be zero.
lParam
Pointer to a COMPCOLOR structure that contains the composition color to be set.
Return Value
If the operation succeeds, the return value is a nonzero value.
If the operation fails, the return value is zero.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95 (Asian version), Windows NT 4.0 (Asian version)</misc>
</message>
<message value="0x47e">
<name>EM_SETIMEMODEBIAS</name>
<return value="DWORD">
<returninfo>returns DWORD in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="DWORD">
<wname>wParam</wname>
<wmisc>wParam
IME mode bias value. It can be one of the following.
IMF_SMODE_PLAURALCLAUSE
Sets the IME mode bias to Name.
IMF_SMODE_NONE
No bias.</wmisc>
</wparam>
<lparam value="DWORD">
<lname>lParam</lname>
<lmisc>lParam
This must be the same value as wParam. </lmisc>
</lparam>
<misc>EM_SETIMEMODEBIAS Message
An application sends an EM_SETIMEMODEBIAS message to set the Input Method Editor (IME) mode bias for a Microsoft Rich Edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns DWORD in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_SETIMEMODEBIAS, // message ID
(WPARAM) wParam, // = (WPARAM) (DWORD) wParam;
(LPARAM) lParam // = (LPARAM) (DWORD) lParam;
);
Parameters
wParam
IME mode bias value. It can be one of the following.
IMF_SMODE_PLAURALCLAUSE
Sets the IME mode bias to Name.
IMF_SMODE_NONE
No bias.
lParam
This must be the same value as wParam.
Return Value
Remarks
When the IME generates a list of alternative choices for a set of characters, this message sets the criteria by which some of the choices will appear at the top of the list.
To set the Text Services Framework mode bias, use EM_SETCTFMODEBIAS.
The application should call EM_ISIME before calling this function.
Message Information
Minimum DLL Version msftedit.dll
Header Declared in Richedit.h
Minimum operating systems Windows XP SP1</misc>
</message>
<message value="0x46a">
<name>EM_SETIMEOPTIONS</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
If the operation succeeds, the return value is a nonzero value.
If the operation fails, the return value is zero.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
Specifies one of the following values.
ECOOP_SET
Sets the options to those specified by lParam.
ECOOP_OR
Combines the specified options with the current options.
ECOOP_AND
Retains only those current options that are also specified by lParam.
ECOOP_XOR
Logically exclusive OR the current options with those specified by lParam.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Specifies one of more of the following values.
IMF_CLOSESTATUSWINDOW
Closes the IME status window when the control receives the input focus.
IMF_FORCEACTIVE
Activates the IME when the control receives the input focus.
IMF_FORCEDISABLE
Disables the IME when the control receives the input focus.
IMF_FORCEENABLE
Enables the IME when the control receives the input focus.
IMF_FORCEINACTIVE
Inactivates the IME when the control receives the input focus.
IMF_FORCENONE
Disables IME handling.
IMF_FORCEREMEMBER
Restores the previous IME status when the control receives the input focus.
IMF_MULTIPLEEDIT
Specifies that the composition string will not be canceled or determined by focus changes. This allows an application to have separate composition strings on each rich edit control.
</lmisc>
</lparam>
<misc>EM_SETIMEOPTIONS Message
The EM_SETIMEOPTIONS message sets the Input Method Editor (IME) options. This message is available only in Asian-language versions of the operating system.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_SETIMEOPTIONS, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Specifies one of the following values.
ECOOP_SET
Sets the options to those specified by lParam.
ECOOP_OR
Combines the specified options with the current options.
ECOOP_AND
Retains only those current options that are also specified by lParam.
ECOOP_XOR
Logically exclusive OR the current options with those specified by lParam.
lParam
Specifies one of more of the following values.
IMF_CLOSESTATUSWINDOW
Closes the IME status window when the control receives the input focus.
IMF_FORCEACTIVE
Activates the IME when the control receives the input focus.
IMF_FORCEDISABLE
Disables the IME when the control receives the input focus.
IMF_FORCEENABLE
Enables the IME when the control receives the input focus.
IMF_FORCEINACTIVE
Inactivates the IME when the control receives the input focus.
IMF_FORCENONE
Disables IME handling.
IMF_FORCEREMEMBER
Restores the previous IME status when the control receives the input focus.
IMF_MULTIPLEEDIT
Specifies that the composition string will not be canceled or determined by focus changes. This allows an application to have separate composition strings on each rich edit control.
Return Value
If the operation succeeds, the return value is a nonzero value.
If the operation fails, the return value is zero.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95 (Asian version), Windows NT 4.0 (Asian version)</misc>
</message>
<message value="0xD8">
<name>EM_SETIMESTATUS</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns the previous value of the lParam parameter.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
The type of status to set. This parameter can be the following value.
EMSIS_COMPOSITIONSTRING
Sets behavior for the handling composition string.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Data specific to the status type. If wParam is EMSIS_COMPOSITIONSTRING, this parameter can be one or more of the following values.
EIMES_GETCOMPSTRATONCE
If this flag is set, the edit control hooks the WM_IME_COMPOSITION message with lParam set to GCS_RESULTSTR and returns the result string immediately. If this flag is not set, the edit control passes the WM_IME_COMPOSITION message to the default window procedure and handles the result string from the WM_CHAR message; this is the default behavior of the edit control.
EIMES_CANCELCOMPSTRINFOCUS
If this flag is set, the edit control cancels the composition string when it receives the WM_SETFOCUS message. If this flag is not set, the edit control does not cancel the composition string; this is the default behavior of the edit control.
EIMES_COMPLETECOMPSTRKILLFOCUS
If this flag is set, the edit control completes the composition string upon receiving the WM_KILLFOCUS message. If this flag is not set, the edit control does not complete the composition string; this is the default behavior of the edit control.
</lmisc>
</lparam>
<misc>EM_SETIMESTATUS Message
Sets the status flags that determine how an edit control interacts with the Input Method Editor (IME).
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_SETIMESTATUS, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
The type of status to set. This parameter can be the following value.
EMSIS_COMPOSITIONSTRING
Sets behavior for the handling composition string.
lParam
Data specific to the status type. If wParam is EMSIS_COMPOSITIONSTRING, this parameter can be one or more of the following values.
EIMES_GETCOMPSTRATONCE
If this flag is set, the edit control hooks the WM_IME_COMPOSITION message with lParam set to GCS_RESULTSTR and returns the result string immediately. If this flag is not set, the edit control passes the WM_IME_COMPOSITION message to the default window procedure and handles the result string from the WM_CHAR message; this is the default behavior of the edit control.
EIMES_CANCELCOMPSTRINFOCUS
If this flag is set, the edit control cancels the composition string when it receives the WM_SETFOCUS message. If this flag is not set, the edit control does not cancel the composition string; this is the default behavior of the edit control.
EIMES_COMPLETECOMPSTRKILLFOCUS
If this flag is set, the edit control completes the composition string upon receiving the WM_KILLFOCUS message. If this flag is not set, the edit control does not complete the composition string; this is the default behavior of the edit control.
Return Value
Returns the previous value of the lParam parameter.
Remarks
Rich Edit: The EM_SETIMESTATUS message is not supported.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 98, Windows 2000</misc>
</message>
<message value="0x478">
<name>EM_SETLANGOPTIONS</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
This message returns a value of 1.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used; it must be zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Specifies the language options. This parameter can be one or more of the following values.
IMF_AUTOFONT
If this flag is set, the control automatically changes fonts when the user explicitly changes to a different keyboard layout. It is useful to turn off IMF_AUTOFONT for universal Unicode fonts. This option is turned on by default (1).
IMF_AUTOFONTSIZEADJUST
Font-bound font sizes are scaled from insertion point size according to script. For example, Asian fonts are slightly larger than Western ones. This option is turned on by default (1).
IMF_AUTOKEYBOARD
If this flag is set, the control automatically changes the keyboard layout when the user explicitly changes to a different font, or when the user explicitly changes the insertion point to a new location in the text. Will be turned on automatically for bidirectional controls. For all other controls, it is turned off by default.
IMF_DUALFONT
Sets the control to dual-font mode. Used for Asian language support. The control uses an English font for ASCII text and a Asian font for Asian text.
IMF_IMEALWAYSSENDNOTIFY
Controls how Rich Edit notifies the client during IME composition:
0: No EN_CHANGED or EN_SELCHANGE notifications during undetermined state. Send notification when final string comes in. (default)
1: Send EN_CHANGED and EN_SELCHANGE events during undetermined state.
IMF_IMECANCELCOMPLETE
This flag determines how the control uses the composition string of an IME if the user cancels it. If this flag is set, the control discards the composition string. If this flag is not set, the control uses the composition string as the result string.
IMF_UIFONTS
Use user-interface default fonts. This option is turned off by default.</lmisc>
</lparam>
<misc>EM_SETLANGOPTIONS Message
An application sends an EM_SETLANGOPTIONS message to set options for Input Method Editor (IME) and Asian language support in a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_SETLANGOPTIONS, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
This parameter is not used; it must be zero.
lParam
Specifies the language options. This parameter can be one or more of the following values.
IMF_AUTOFONT
If this flag is set, the control automatically changes fonts when the user explicitly changes to a different keyboard layout. It is useful to turn off IMF_AUTOFONT for universal Unicode fonts. This option is turned on by default (1).
IMF_AUTOFONTSIZEADJUST
Font-bound font sizes are scaled from insertion point size according to script. For example, Asian fonts are slightly larger than Western ones. This option is turned on by default (1).
IMF_AUTOKEYBOARD
If this flag is set, the control automatically changes the keyboard layout when the user explicitly changes to a different font, or when the user explicitly changes the insertion point to a new location in the text. Will be turned on automatically for bidirectional controls. For all other controls, it is turned off by default.
IMF_DUALFONT
Sets the control to dual-font mode. Used for Asian language support. The control uses an English font for ASCII text and a Asian font for Asian text.
IMF_IMEALWAYSSENDNOTIFY
Controls how Rich Edit notifies the client during IME composition:
0: No EN_CHANGED or EN_SELCHANGE notifications during undetermined state. Send notification when final string comes in. (default)
1: Send EN_CHANGED and EN_SELCHANGE events during undetermined state.
IMF_IMECANCELCOMPLETE
This flag determines how the control uses the composition string of an IME if the user cancels it. If this flag is set, the control discards the composition string. If this flag is not set, the control uses the composition string as the result string.
IMF_UIFONTS
Use user-interface default fonts. This option is turned off by default.
Return Value
This message returns a value of 1.
Remarks
The EM_SETLANGOPTIONS message controls the following:
* Automatic font binding.
* Automatic keyboard switching.
* Automatic font size adjustment.
* Use of user-interface default fonts instead of document default fonts.
* Notifications to client during IME composition.
* How IME aborts composition mode.
The IMF_AUTOFONT flag is set by default. The IMF_AUTOKEYBOARD and IMF_IMECANCELCOMPLETE flags are clear by default.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95 with Rich Edit 2.0, Windows 98, Windows NT 4.0</misc>
</message>
<message value="0xD3">
<name>EM_SETMARGINS</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
The margins to set. This parameter can be one or more of the following values.
EC_LEFTMARGIN
Sets the left margin.
EC_RIGHTMARGIN
Sets the right margin.
EC_USEFONTINFO
Rich edit controls: Sets the left and right margins to a narrow width calculated using the text metrics of the control's current font. If no font has been set for the control, the margins are set to zero. The lParam parameter is ignored.
Edit controls: The EC_USEFONTINFO value cannot be used in the wParam parameter. It can only be used in the lParam parameter.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
The low-order word specifies the new width of the left margin, in pixels. This value is ignored if wParam does not include EC_LEFTMARGIN.
Edit controls and Rich Edit 3.0 and later: The low-order word can specify the EC_USEFONTINFO value to set the left margin to a narrow width calculated using the text metrics of the control's current font. If no font has been set for the control, the margin is set to zero.
The high-order word specifies the new width of the right margin, in pixels. This value is ignored if wParam does not include EC_RIGHTMARGIN.
Edit controls and Rich Edit 3.0 and later: The high-order word can specify the EC_USEFONTINFO value to set the right margin to a narrow width calculated using the text metrics of the control's current font. If no font has been set for the control, the margin is set to zero.
</lmisc>
</lparam>
<misc>EM_SETMARGINS Message
Sets the widths of the left and right margins for an edit control. The message redraws the control to reflect the new margins. You can send this message to either an edit control or a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_SETMARGINS, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
The margins to set. This parameter can be one or more of the following values.
EC_LEFTMARGIN
Sets the left margin.
EC_RIGHTMARGIN
Sets the right margin.
EC_USEFONTINFO
Rich edit controls: Sets the left and right margins to a narrow width calculated using the text metrics of the control's current font. If no font has been set for the control, the margins are set to zero. The lParam parameter is ignored.
Edit controls: The EC_USEFONTINFO value cannot be used in the wParam parameter. It can only be used in the lParam parameter.
lParam
The low-order word specifies the new width of the left margin, in pixels. This value is ignored if wParam does not include EC_LEFTMARGIN.
Edit controls and Rich Edit 3.0 and later: The low-order word can specify the EC_USEFONTINFO value to set the left margin to a narrow width calculated using the text metrics of the control's current font. If no font has been set for the control, the margin is set to zero.
The high-order word specifies the new width of the right margin, in pixels. This value is ignored if wParam does not include EC_RIGHTMARGIN.
Edit controls and Rich Edit 3.0 and later: The high-order word can specify the EC_USEFONTINFO value to set the right margin to a narrow width calculated using the text metrics of the control's current font. If no font has been set for the control, the margin is set to zero.
Return Value
Remarks
Edit controls: You cannot use EC_USEFONTINFO in the wParam parameter, but you can use it in the lParam parameter.
Rich Edit: Supported in Microsoft Rich Edit 1.0 and later. All rich edit versions support the use of EC_USEFONTINFO in the wParam parameter. However, only Rich Edit 3.0 and later support the use of EC_USEFONTINFO in the lParam parameter. For information about the compatibility of rich edit versions with the various system versions, see About Rich Edit Controls.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0xB9">
<name>EM_SETMODIFY</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
The new value for the modification flag. A value of TRUE indicates the text has been modified, and a value of FALSE indicates it has not been modified.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used. </lmisc>
</lparam>
<misc>EM_SETMODIFY Message
Sets or clears the modification flag for an edit control. The modification flag indicates whether the text within the edit control has been modified. You can send this message to either an edit control or a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_SETMODIFY, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
The new value for the modification flag. A value of TRUE indicates the text has been modified, and a value of FALSE indicates it has not been modified.
lParam
This parameter is not used.
Return Value
Remarks
The system automatically clears the modification flag to zero when the control is created. If the user changes the control's text, the system sets the flag to nonzero. You can send the EM_GETMODIFY message to the edit control to retrieve the current state of the flag.
Rich Edit 1.0: Objects created without the REO_DYNAMICSIZE flag will lock in their extents when the modify flag is set to FALSE.
Rich Edit: Supported in Microsoft Rich Edit 1.0 and later. For information about the compatibility of rich edit versions with the various system versions, see About Rich Edit Controls.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x446">
<name>EM_SETOLECALLBACK</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
If the operation succeeds, the return value is a nonzero value.
If the operation fails, the return value is zero.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used; it must be zero. </wmisc>
</wparam>
<lparam value="IRichEditOleCallback">
<lname>lParam</lname>
<lmisc>lParam
Pointer to an IRichEditOleCallback object. The control calls the AddRef function for the object before returning.
</lmisc>
</lparam>
<misc>EM_SETOLECALLBACK Message
The EM_SETOLECALLBACK message gives a rich edit control an IRichEditOleCallback object that the control uses to get OLE-related resources and information from the client.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_SETOLECALLBACK, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
This parameter is not used; it must be zero.
lParam
Pointer to an IRichEditOleCallback object. The control calls the AddRef function for the object before returning.
Return Value
If the operation succeeds, the return value is a nonzero value.
If the operation fails, the return value is zero.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0x44d">
<name>EM_SETOPTIONS</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
This message returns the current options of the edit control.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the operation, which can be one of these values.
ECOOP_SET
Sets the options to those specified by lParam.
ECOOP_OR
Combines the specified options with the current options.
ECOOP_AND
Retains only those current options that are also specified by lParam.
ECOOP_XOR
Logically exclusive OR the current options with those specified by lParam.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Specifies one or more of the following values.
ECO_AUTOWORDSELECTION
Automatic selection of word on double-click.
ECO_AUTOVSCROLL
Same as ES_AUTOVSCROLL style.
ECO_AUTOHSCROLL
Same as ES_AUTOHSCROLL style.
ECO_NOHIDESEL
Same as ES_NOHIDESEL style.
ECO_READONLY
Same as ES_READONLY style.
ECO_WANTRETURN
Same as ES_WANTRETURN style.
ECO_SELECTIONBAR
Same as ES_SELECTIONBAR style.
ECO_VERTICAL
Same as ES_VERTICAL style. Available in Asian-language versions only.
</lmisc>
</lparam>
<misc>EM_SETOPTIONS Message
The EM_SETOPTIONS message sets the options for a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_SETOPTIONS, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Specifies the operation, which can be one of these values.
ECOOP_SET
Sets the options to those specified by lParam.
ECOOP_OR
Combines the specified options with the current options.
ECOOP_AND
Retains only those current options that are also specified by lParam.
ECOOP_XOR
Logically exclusive OR the current options with those specified by lParam.
lParam
Specifies one or more of the following values.
ECO_AUTOWORDSELECTION
Automatic selection of word on double-click.
ECO_AUTOVSCROLL
Same as ES_AUTOVSCROLL style.
ECO_AUTOHSCROLL
Same as ES_AUTOHSCROLL style.
ECO_NOHIDESEL
Same as ES_NOHIDESEL style.
ECO_READONLY
Same as ES_READONLY style.
ECO_WANTRETURN
Same as ES_WANTRETURN style.
ECO_SELECTIONBAR
Same as ES_SELECTIONBAR style.
ECO_VERTICAL
Same as ES_VERTICAL style. Available in Asian-language versions only.
Return Value
This message returns the current options of the edit control.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0x45d">
<name>EM_SETPALETTE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
This message does not return a value.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Handle to the new palette used by the rich edit control. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used; it must be zero. </lmisc>
</lparam>
<misc>EM_SETPALETTE Message
An application sends an EM_SETPALETTE message to change the palette that rich edit uses for its display window.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_SETPALETTE, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Handle to the new palette used by the rich edit control.
lParam
This parameter is not used; it must be zero.
Return Value
This message does not return a value.
Remarks
Microsoft Rich Edit assumes the palette you're passing is valid.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95 with Rich Edit 2.0, Windows 98, Windows NT 4.0</misc>
</message>
<message value="0x447">
<name>EM_SETPARAFORMAT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
If the operation succeeds, the return value is a nonzero value.
If the operation fails, the return value is zero.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used; it must be zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Pointer to a PARAFORMAT structure specifying the new paragraph formatting attributes. Only the attributes specified by the dwMask member are changed.
Microsoft Rich Edit 2.0 and later: This parameter can be a pointer to a PARAFORMAT2 structure, which is an extension of the PARAFORMAT structure. Before sending the EM_SETPARAFORMAT message, set the structure's cbSize member to indicate the version of the structure.
</lmisc>
</lparam>
<misc>EM_SETPARAFORMAT Message
The EM_SETPARAFORMAT message sets the paragraph formatting for the current selection in a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_SETPARAFORMAT, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
This parameter is not used; it must be zero.
lParam
Pointer to a PARAFORMAT structure specifying the new paragraph formatting attributes. Only the attributes specified by the dwMask member are changed.
Microsoft Rich Edit 2.0 and later: This parameter can be a pointer to a PARAFORMAT2 structure, which is an extension of the PARAFORMAT structure. Before sending the EM_SETPARAFORMAT message, set the structure's cbSize member to indicate the version of the structure.
Return Value
If the operation succeeds, the return value is a nonzero value.
If the operation fails, the return value is zero.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0xCC">
<name>EM_SETPASSWORDCHAR</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
The character to be displayed in place of the characters typed by the user. If this parameter is zero, the control removes the current password character and displays the characters typed by the user.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used. </lmisc>
</lparam>
<misc>EM_SETPASSWORDCHAR Message
Sets or removes the password character for an edit control. When a password character is set, that character is displayed in place of the characters typed by the user. You can send this message to either an edit control or a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_SETPASSWORDCHAR, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
The character to be displayed in place of the characters typed by the user. If this parameter is zero, the control removes the current password character and displays the characters typed by the user.
lParam
This parameter is not used.
Return Value
Remarks
When an edit control receives the EM_SETPASSWORDCHAR message, the control redraws all visible characters using the character specified by the wParam parameter. If wParam is zero, the control redraws all visible characters using the characters typed by the user.
If an edit control is created with the ES_PASSWORD style, the default password character is set to an asterisk (*). If an edit control is created without the ES_PASSWORD style, there is no password character. The ES_PASSWORD style is removed if an EM_SETPASSWORDCHAR message is sent with the wParam parameter set to zero.
Windows XP: If an edit control is from user32.dll, an asterisk is the default character for the ES_PASSWORD style. However, if an edit control is from comctl32.dll version 6, a black circle is the default character for the ES_PASSWORD style. Note that comctl32.dll version 6 is not redistributable but is included with Microsoft Windows XP or later. To use comctl32.dll version 6, specify it in a manifest. For more information on manifests, see Enabling Visual Styles.
Edit controls: Multiline edit controls do not support the password style or messages.
Rich Edit: Supported in Microsoft Rich Edit 2.0 and later. Both single-line and multiline edit controls support the password style and messages. For information about the compatibility of rich edit versions with the various system versions, see About Rich Edit Controls.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x464">
<name>EM_SETPUNCTUATION</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
If the operation succeeds, the return value is a nonzero value.
If the operation fails, the return value is zero.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the punctuation type, which can be one of the following values.
PC_LEADING
Leading punctuation characters.
PC_FOLLOWING
Following punctuation characters.
PC_DELIMITER
Delimiter.
PC_OVERFLOW
Not supported.</wmisc>
</wparam>
<lparam value="PUNCTUATION">
<lname>lParam</lname>
<lmisc>lParam
Pointer to a PUNCTUATION structure that contains the punctuation characters. </lmisc>
</lparam>
<misc>EM_SETPUNCTUATION Message
The EM_SETPUNCTUATION message sets the punctuation characters for a rich edit control. This message is available only in Asian-language versions of the operating system.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_SETPUNCTUATION, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Specifies the punctuation type, which can be one of the following values.
PC_LEADING
Leading punctuation characters.
PC_FOLLOWING
Following punctuation characters.
PC_DELIMITER
Delimiter.
PC_OVERFLOW
Not supported.
lParam
Pointer to a PUNCTUATION structure that contains the punctuation characters.
Return Value
If the operation succeeds, the return value is a nonzero value.
If the operation fails, the return value is zero.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95 (Asian version), Windows NT 4.0 (Asian version)</misc>
</message>
<message value="0xCF">
<name>EM_SETREADONLY</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
If the operation succeeds, the return value is nonzero.
If the operation fails, the return value is zero.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies whether to set or remove the ES_READONLY style. A value of TRUE sets the ES_READONLY style; a value of FALSE removes the ES_READONLY style.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used.
</lmisc>
</lparam>
<misc>EM_SETREADONLY Message
Sets or removes the read-only style (ES_READONLY) of an edit control. You can send this message to either an edit control or a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_SETREADONLY, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Specifies whether to set or remove the ES_READONLY style. A value of TRUE sets the ES_READONLY style; a value of FALSE removes the ES_READONLY style.
lParam
This parameter is not used.
Return Value
If the operation succeeds, the return value is nonzero.
If the operation fails, the return value is zero.
Remarks
When an edit control has the ES_READONLY style, the user cannot change the text within the edit control.
To determine whether an edit control has the ES_READONLY style, use the GetWindowLong function with the GWL_STYLE flag.
Rich Edit: Supported in Microsoft Rich Edit 1.0 and later. For information about the compatibility of rich edit versions with the various system versions, see About Rich Edit Controls.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0xB3">
<name>EM_SETRECT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Rich Edit 2.0 and later: Indicates whether lParam specifies absolute or relative coordinates. A value of zero indicates absolute coordinates. A value of 1 indicates offsets relative to the current formatting rectangle. (The offsets can be positive or negative.)
Edit controls and Rich Edit 1.0: This parameter is not used and must be zero.
</wmisc>
</wparam>
<lparam value="RECT">
<lname>lParam</lname>
<lmisc>lParam
A pointer to a RECT structure that specifies the new dimensions of the rectangle. If this parameter is NULL, the formatting rectangle is set to its default values.
</lmisc>
</lparam>
<misc>EM_SETRECT Message
Sets the formatting rectangle of a multiline edit control. The formatting rectangle is the limiting rectangle into which the control draws the text. The limiting rectangle is independent of the size of the edit control window.
This message is processed only by multiline edit controls. You can send this message to either an edit control or a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_SETRECT, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) (LPRECT) lParam;
);
Parameters
wParam
Rich Edit 2.0 and later: Indicates whether lParam specifies absolute or relative coordinates. A value of zero indicates absolute coordinates. A value of 1 indicates offsets relative to the current formatting rectangle. (The offsets can be positive or negative.)
Edit controls and Rich Edit 1.0: This parameter is not used and must be zero.
lParam
A pointer to a RECT structure that specifies the new dimensions of the rectangle. If this parameter is NULL, the formatting rectangle is set to its default values.
Return Value
Remarks
The EM_SETRECT message causes the text of the edit control to be redrawn. To change the size of the formatting rectangle without redrawing the text, use the EM_SETRECTNP message.
When an edit control is first created, the formatting rectangle is set to a default size. You can use the EM_SETRECT message to make the formatting rectangle larger or smaller than the edit control window.
If the edit control does not have a horizontal scroll bar, and the formatting rectangle is set to be larger than the edit control window, lines of text exceeding the width of the edit control window (but smaller than the width of the formatting rectangle) are clipped instead of wrapped.
If the edit control contains a border, the formatting rectangle is reduced by the size of the border. If you are adjusting the rectangle returned by an EM_GETRECT message, you must remove the size of the border before using the rectangle with the EM_SETRECT message.
Rich Edit: Supported in Microsoft Rich Edit 1.0 and later. The formatting rectangle does not include the selection bar, which is an unmarked area to the left of each paragraph. When the user clicks in the selection bar, the corresponding line is selected. For information about the compatibility of rich edit versions with the various system versions, see About Rich Edit Controls.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0xB4">
<name>EM_SETRECTNP</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Rich Edit 3.0 and later: Indicates whether the new rectangle contains absolute or relative coordinates. A value of zero indicates absolute coordinates. A value of 1 indicates offsets relative to the current formatting rectangle. (The offsets can be positive or negative.)
Edit controls: This parameter is not used and must be zero.
</wmisc>
</wparam>
<lparam value="RECT">
<lname>lParam</lname>
<lmisc>lParam
A pointer to a RECT structure that specifies the new dimensions of the rectangle. If this parameter is NULL, the formatting rectangle is set to its default values.
</lmisc>
</lparam>
<misc>EM_SETRECTNP Message
Sets the formatting rectangle of a multiline edit control. The EM_SETRECTNP message is identical to the EM_SETRECT message, except that EM_SETRECTNP does not redraw the edit control window.
The formatting rectangle is the limiting rectangle into which the control draws the text. The limiting rectangle is independent of the size of the edit control window.
This message is processed only by multiline edit controls. You can send this message to either an edit control or a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_SETRECTNP, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) (LPRECT) lParam;
);
Parameters
wParam
Rich Edit 3.0 and later: Indicates whether the new rectangle contains absolute or relative coordinates. A value of zero indicates absolute coordinates. A value of 1 indicates offsets relative to the current formatting rectangle. (The offsets can be positive or negative.)
Edit controls: This parameter is not used and must be zero.
lParam
A pointer to a RECT structure that specifies the new dimensions of the rectangle. If this parameter is NULL, the formatting rectangle is set to its default values.
Return Value
Remarks
Rich Edit: Supported in Microsoft Rich Edit 3.0 and later. For information about the compatibility of rich edit versions with the various system versions, see About Rich Edit Controls.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x4de">
<name>EM_SETSCROLLPOS</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
This message always returns 1.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used; it must be zero. </wmisc>
</wparam>
<lparam value="POINT">
<lname>lParam</lname>
<lmisc>lParam
Pointer to a POINT structure which specifies a point in the virtual text space of the document, expressed in pixels. The document will be scrolled until this point is located in the upper-left corner of the edit control window. If you want to change the view such that the upper left corner of the view is two lines down and one character in from the left edge. You would pass a point of (7, 22).
Microsoft Rich Edit checks the X and Y coordinates and adjusts them if necessary, so that a complete line is displayed at the top. It also ensures that the text is never completely scrolled off the view rectangle.
</lmisc>
</lparam>
<misc>EM_SETSCROLLPOS Message
An application sends an EM_SETSCROLLPOS message to tell the rich edit control to scroll to a particular point.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_SETSCROLLPOS, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
This parameter is not used; it must be zero.
lParam
Pointer to a POINT structure which specifies a point in the virtual text space of the document, expressed in pixels. The document will be scrolled until this point is located in the upper-left corner of the edit control window. If you want to change the view such that the upper left corner of the view is two lines down and one character in from the left edge. You would pass a point of (7, 22).
Microsoft Rich Edit checks the X and Y coordinates and adjusts them if necessary, so that a complete line is displayed at the top. It also ensures that the text is never completely scrolled off the view rectangle.
Return Value
This message always returns 1.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95 with Rich Edit 3.0, Windows NT 4.0 with Rich Edit 3.0, Windows Millennium Edition, Windows 2000</misc>
</message>
<message value="0xB1">
<name>EM_SETSEL</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
The starting character position of the selection. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
The ending character position of the selection. </lmisc>
</lparam>
<misc>EM_SETSEL Message
Selects a range of characters in an edit control. You can send this message to either an edit control or a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_SETSEL, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
The starting character position of the selection.
lParam
The ending character position of the selection.
Return Value
Remarks
The start value can be greater than the end value. The lower of the two values specifies the character position of the first character in the selection. The higher value specifies the position of the first character beyond the selection.
The start value is the anchor point of the selection, and the end value is the active end. If the user uses the SHIFT key to adjust the size of the selection, the active end can move but the anchor point remains the same.
If the start is 0 and the end is 1, all the text in the edit control is selected. If the start is 1, any current selection is deselected.
Edit controls: The control displays a flashing caret at the end position regardless of the relative values of start and end.
Rich Edit: Supported in Microsoft Rich Edit 1.0 and later. For information about the compatibility of rich edit versions with the various system versions, see About Rich Edit Controls.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0xCB">
<name>EM_SETTABSTOPS</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
If all the tabs are set, the return value is TRUE.
If all the tabs are not set, the return value is FALSE.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
The number of tab stops contained in the array. If this parameter is zero, the lParam parameter is ignored and default tab stops are set at every 32 dialog template units. If this parameter is 1, tab stops are set at every n dialog template units, where n is the distance pointed to by the lParam parameter. If this parameter is greater than 1, lParam is a pointer to an array of tab stops.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
A pointer to an array of unsigned integers specifying the tab stops, in dialog template units. If the wParam parameter is 1, this parameter is a pointer to an unsigned integer containing the distance between all tab stops, in dialog template units.
Windows 95/98/Me: The buffer pointed to by lParam must reside in writable memory, even though the message does not modify the array.
</lmisc>
</lparam>
<misc>EM_SETTABSTOPS Message
The EM_SETTABSTOPS message sets the tab stops in a multiline edit control. When text is copied to the control, any tab character in the text causes space to be generated up to the next tab stop.
This message is processed only by multiline edit controls. You can send this message to either an edit control or a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_SETTABSTOPS, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
The number of tab stops contained in the array. If this parameter is zero, the lParam parameter is ignored and default tab stops are set at every 32 dialog template units. If this parameter is 1, tab stops are set at every n dialog template units, where n is the distance pointed to by the lParam parameter. If this parameter is greater than 1, lParam is a pointer to an array of tab stops.
lParam
A pointer to an array of unsigned integers specifying the tab stops, in dialog template units. If the wParam parameter is 1, this parameter is a pointer to an unsigned integer containing the distance between all tab stops, in dialog template units.
Windows 95/98/Me: The buffer pointed to by lParam must reside in writable memory, even though the message does not modify the array.
Return Value
If all the tabs are set, the return value is TRUE.
If all the tabs are not set, the return value is FALSE.
Remarks
The EM_SETTABSTOPS message does not automatically redraw the edit control window. If the application is changing the tab stops for text already in the edit control, it should call the InvalidateRect function to redraw the edit control window.
The values specified in the array are in dialog template units, which are the device-independent units used in dialog box templates. To convert measurements from dialog template units to screen units (pixels), use the MapDialogRect function.
Rich Edit: Supported in Microsoft Rich Edit 3.0 and later. For information about the compatibility of rich edit versions with the various system versions, see About Rich Edit Controls.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x448">
<name>EM_SETTARGETDEVICE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
The return value is zero if the operation fails, or nonzero if it succeeds.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
handle to a device context (HDC) for the target device. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Line width to use for formatting.
</lmisc>
</lparam>
<misc>EM_SETTARGETDEVICE Message
The EM_SETTARGETDEVICE message sets the target device and line width used for "what you see is what you get" (WYSIWYG) formatting in a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_SETTARGETDEVICE, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
handle to a device context (HDC) for the target device.
lParam
Line width to use for formatting.
Return Value
The return value is zero if the operation fails, or nonzero if it succeeds.
Remarks
The HDC for the default printer can be obtained as follows.
Copy Code
PRINTDLG pd = { sizeof(pd) };
pd.Flags = PD_RETURNDC | PD_RETURNDEFAULT;
if (PrintDlg(pd))
{
HDC hdc = pd.hDC;
...
}
If lParam is zero, no line breaks are created.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0x461">
<name>EM_SETTEXTEX</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
If the operation is setting all of the text and succeeds, the return value is 1.
If the operation is setting the selection and succeeds, the return value is the number of bytes or characters copied.
If the operation fails, the return value is zero.</returnmisc>
</return>
<wparam value="SETTEXTEX">
<wname>wParam</wname>
<wmisc> wParam
Pointer to a SETTEXTEX structure that specifies flags and an optional code page to use in translating to Unicode.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Pointer to the null-terminated text to insert. This text is an ANSI string, unless the code page is 1200 (Unicode). If lParam starts with a valid Rich Text Format (RTF) ASCII sequence for example, "{\rtf" or "{urtf" the text is read in using the RTF reader.
</lmisc>
</lparam>
<misc>EM_SETTEXTEX Message
The EM_SETTEXTEX message combines the functionality of WM_SETTEXT and EM_REPLACESEL and adds the ability to set text using a code page and to use either rich text or plain text.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_SETTEXTEX, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Pointer to a SETTEXTEX structure that specifies flags and an optional code page to use in translating to Unicode.
lParam
Pointer to the null-terminated text to insert. This text is an ANSI string, unless the code page is 1200 (Unicode). If lParam starts with a valid Rich Text Format (RTF) ASCII sequence for example, "{\rtf" or "{urtf" the text is read in using the RTF reader.
Return Value
If the operation is setting all of the text and succeeds, the return value is 1.
If the operation is setting the selection and succeeds, the return value is the number of bytes or characters copied.
If the operation fails, the return value is zero.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95 with Rich Edit 3.0, Windows NT 4.0 with Rich Edit 3.0, Windows Millennium Edition, Windows 2000</misc>
</message>
<message value="0x459">
<name>EM_SETTEXTMODE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
If the message succeeds, the return value is zero.
If the message fails, the return value is a nonzero value. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
One or more values from the TEXTMODE enumeration type. The values specify the new settings for the control's text mode and undo level parameters.
Specify one of the following values to set the text mode parameter. If you don't specify a text mode value, the text mode remains at its current setting.
Value Meaning
TM_PLAINTEXT Indicates plain text mode, in which the control is similar to a standard edit control. For more information about plain text mode, see the following Remarks section.
TM_RICHTEXT Indicates rich text mode, in which the control has standard rich edit functionality. Rich text mode is the default setting.
Specify one of the following values to set the undo level parameter. If you don't specify an undo level value, the undo level remains at its current setting.
Value Meaning
TM_SINGLELEVELUNDO The control allows the user to undo only the last action that can be undone.
TM_MULTILEVELUNDO The control supports multiple undo operations. This is the default setting. Use the EM_SETUNDOLIMIT message to set the maximum number of undo actions.
Specify one of the following values to set the code page parameter. If you don't specify an code page value, the code page remains at its current setting.
Value Meaning
TM_SINGLECODEPAGE The control only allows the English keyboard and a keyboard corresponding to the default charset. For example, you could have Greek and English. Note that this prevents Unicode text from entering the control. For example, use this value if a Microsoft Rich Edit control must be restricted to ANSI text.
TM_MULTICODEPAGE The control allows multiple code pages and Unicode text into the control. This is the default setting.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used; it must be zero. </lmisc>
</lparam>
<misc>EM_SETTEXTMODE Message
An application sends an EM_SETTEXTMODE message to set the text mode or undo level of a rich edit control. The message fails if the control contains any text.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_SETTEXTMODE, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
One or more values from the TEXTMODE enumeration type. The values specify the new settings for the control's text mode and undo level parameters.
Specify one of the following values to set the text mode parameter. If you don't specify a text mode value, the text mode remains at its current setting.
Value Meaning
TM_PLAINTEXT Indicates plain text mode, in which the control is similar to a standard edit control. For more information about plain text mode, see the following Remarks section.
TM_RICHTEXT Indicates rich text mode, in which the control has standard rich edit functionality. Rich text mode is the default setting.
Specify one of the following values to set the undo level parameter. If you don't specify an undo level value, the undo level remains at its current setting.
Value Meaning
TM_SINGLELEVELUNDO The control allows the user to undo only the last action that can be undone.
TM_MULTILEVELUNDO The control supports multiple undo operations. This is the default setting. Use the EM_SETUNDOLIMIT message to set the maximum number of undo actions.
Specify one of the following values to set the code page parameter. If you don't specify an code page value, the code page remains at its current setting.
Value Meaning
TM_SINGLECODEPAGE The control only allows the English keyboard and a keyboard corresponding to the default charset. For example, you could have Greek and English. Note that this prevents Unicode text from entering the control. For example, use this value if a Microsoft Rich Edit control must be restricted to ANSI text.
TM_MULTICODEPAGE The control allows multiple code pages and Unicode text into the control. This is the default setting.
lParam
This parameter is not used; it must be zero.
Return Value
If the message succeeds, the return value is zero.
If the message fails, the return value is a nonzero value.
Remarks
In rich text mode, a rich edit control has standard rich edit functionality. However, in plain text mode, the control is similar to a standard edit control:
* The text in a plain text control can have only one format (such as Bold, 10pt Arial).
* The user cannot paste rich text formats, such as Rich Text Format (RTF) or embedded objects into a plain text control.
* Rich text mode controls always have a default end-of-document marker or carriage return, to format paragraphs. Plain text controls, on the other hand, do not need the default, end-of-document marker, so it is omitted.
The control must contain no text when it receives the EM_SETTEXTMODE message. To ensure there is no text, send a WM_SETTEXT message with an empty string ("").
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95 with Rich Edit 2.0, Windows 98, Windows NT 4.0</misc>
</message>
<message value="0x4ca">
<name>EM_SETTYPOGRAPHYOPTIONS</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
If an illegal wParam is passed, EM_SETTYPOGRAPHYOPTIONS returns FALSE.
If wParam is valid, the return value is TRUE.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies one of the following values.
TO_ADVANCEDTYPOGRAPHY
Advanced line breaking and line formatting is turned on.
TO_SIMPLELINEBREAK
Normal line breaking and formatting is used.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
A mask consisting of one or more of the flags in wParam. Only the flags are set in this mask will be set or cleared. This allows a single flag to be set or cleared without reading the current flag states.
</lmisc>
</lparam>
<misc>EM_SETTYPOGRAPHYOPTIONS Message
The EM_SETTYPOGRAPHYOPTIONS message sets the current state of the typography options of a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_SETTYPOGRAPHYOPTIONS, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Specifies one of the following values.
TO_ADVANCEDTYPOGRAPHY
Advanced line breaking and line formatting is turned on.
TO_SIMPLELINEBREAK
Normal line breaking and formatting is used.
lParam
A mask consisting of one or more of the flags in wParam. Only the flags are set in this mask will be set or cleared. This allows a single flag to be set or cleared without reading the current flag states.
Return Value
If an illegal wParam is passed, EM_SETTYPOGRAPHYOPTIONS returns FALSE.
If wParam is valid, the return value is TRUE.
Remarks
Advanced and normal line breaking may also be turned on automatically by the rich edit control if it is needed for certain languages.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95 with Rich Edit 3.0, Windows NT 4.0 with Rich Edit 3.0, Windows Millennium Edition, Windows 2000</misc>
</message>
<message value="0x452">
<name>EM_SETUNDOLIMIT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
The return value is the new maximum number of undo actions for the rich edit control. This value may be less than wParam if memory is limited.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the maximum number of actions that can be stored in the undo queue. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used; it must be zero. </lmisc>
</lparam>
<misc>EM_SETUNDOLIMIT Message
An application sends an EM_SETUNDOLIMIT message to a rich edit control to set the maximum number of actions that can stored in the undo queue.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_SETUNDOLIMIT, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Specifies the maximum number of actions that can be stored in the undo queue.
lParam
This parameter is not used; it must be zero.
Return Value
The return value is the new maximum number of undo actions for the rich edit control. This value may be less than wParam if memory is limited.
Remarks
By default, the maximum number of actions in the undo queue is 100. If you increase this number, there must be enough available memory to accommodate the new number. For better performance, set the limit to the smallest possible value.
Setting the limit to zero disables the Undo feature.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95 with Rich Edit 2.0, Windows 98, Windows NT 4.0</misc>
</message>
<message value="0xD0">
<name>EM_SETWORDBREAKPROC</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
The address of the application-defined Wordwrap function. For more information about breaking lines, see the description of the EditWordBreakProc callback function.
</lmisc>
</lparam>
<misc>EM_SETWORDBREAKPROC Message
Replaces an edit control's default Wordwrap function with an application-defined Wordwrap function. You can send this message to either an edit control or a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_SETWORDBREAKPROC, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
This parameter is not used.
lParam
The address of the application-defined Wordwrap function. For more information about breaking lines, see the description of the EditWordBreakProc callback function.
Return Value
Remarks
A Wordwrap function scans a text buffer that contains text to be sent to the screen, looking for the first word that does not fit on the current screen line. The Wordwrap function places this word at the beginning of the next line on the screen.
A Wordwrap function defines the point at which the system should break a line of text for multiline edit controls, usually at a space character that separates two words. Either a multiline or a single-line edit control might call this function when the user presses arrow keys in combination with the CTRL key to move the caret to the next word or previous word. The default Wordwrap function breaks a line of text at a space character. The application-defined function may define the Wordwrap to occur at a hyphen or a character other than the space character.
Rich Edit: Supported in Microsoft Rich Edit 1.0 and later. For information about the compatibility of rich edit versions with the various system versions, see About Rich Edit Controls.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x451">
<name>EM_SETWORDBREAKPROCEX</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
This message returns the address of the previous extended word-break procedure.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used; it must be zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Pointer to an EditWordBreakProcEx function or NULL to use the default procedure. </lmisc>
</lparam>
<misc>EM_SETWORDBREAKPROCEX Message
The EM_SETWORDBREAKPROCEX message sets the extended word-break procedure.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_SETWORDBREAKPROCEX, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
This parameter is not used; it must be zero.
lParam
Pointer to an EditWordBreakProcEx function or NULL to use the default procedure.
Return Value
This message returns the address of the previous extended word-break procedure.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0x466">
<name>EM_SETWORDWRAPMODE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
This message returns the current word-wrapping and word-breaking options.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies one or more of the following values.
WBF_WORDWRAP
Enables Asian-specific word wrap operations, such as kinsoku in Japanese.
WBF_WORDBREAK
Enables English word-breaking operations in Japanese and Chinese. Enables Hangeul word-breaking operation.
WBF_OVERFLOW
Recognizes overflow punctuation. (Not currently supported.)
WBF_LEVEL1
Sets the Level 1 punctuation table as the default.
WBF_LEVEL2
Sets the Level 2 punctuation table as the default.
WBF_CUSTOM
Sets the application-defined punctuation table.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used; it must be zero. </lmisc>
</lparam>
<misc>EM_SETWORDWRAPMODE Message
The EM_SETWORDWRAPMODE message sets the word-wrapping and word-breaking options for the rich edit control. This message is available only in Asian-language versions of the operating system.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_SETWORDWRAPMODE, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Specifies one or more of the following values.
WBF_WORDWRAP
Enables Asian-specific word wrap operations, such as kinsoku in Japanese.
WBF_WORDBREAK
Enables English word-breaking operations in Japanese and Chinese. Enables Hangeul word-breaking operation.
WBF_OVERFLOW
Recognizes overflow punctuation. (Not currently supported.)
WBF_LEVEL1
Sets the Level 1 punctuation table as the default.
WBF_LEVEL2
Sets the Level 2 punctuation table as the default.
WBF_CUSTOM
Sets the application-defined punctuation table.
lParam
This parameter is not used; it must be zero.
Return Value
This message returns the current word-wrapping and word-breaking options.
Remarks
This message must not be sent by the application defined word breaking procedure.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95 (Asian version), Windows NT 4.0 (Asian version)</misc>
</message>
<message value="0x4e1">
<name>EM_SETZOOM</name>
<return value="BOOL">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
If the new zoom setting is accepted, the return value is TRUE.
If the new zoom setting is not accepted, the return value is FALSE. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Numerator of the zoom ratio. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Denominator of the zoom ratio. These parameters can have the following values.
Both 0
Turns off zooming by using the EM_SETZOOM message (zooming may still occur using ITextHost::TxGetExtent).
1/64 (wParam / lParam) 64
Zooms display by the zoom ratio numerator/denominator
</lmisc>
</lparam>
<misc>EM_SETZOOM Message
The EM_SETZOOM message sets the zoom ratio anywhere between 1/64 and 64.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_SETZOOM, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Numerator of the zoom ratio.
lParam
Denominator of the zoom ratio. These parameters can have the following values.
Both 0
Turns off zooming by using the EM_SETZOOM message (zooming may still occur using ITextHost::TxGetExtent).
1/64 (wParam / lParam) 64
Zooms display by the zoom ratio numerator/denominator
Return Value
If the new zoom setting is accepted, the return value is TRUE.
If the new zoom setting is not accepted, the return value is FALSE.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95 with Rich Edit 3.0, Windows NT 4.0 with Rich Edit 3.0, Windows Millennium Edition, Windows 2000</misc>
</message>
<message value="0x460">
<name>EM_SHOWSCROLLBAR</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
This message does not return a value. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Identifies which scroll bar to display: horizontal or vertical. This parameter must be SB_VERT or SB_HORZ.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Specifies whether to show the scroll bar or hide it. Specify TRUE to show the scroll bar and FALSE to hide it.
</lmisc>
</lparam>
<misc>EM_SHOWSCROLLBAR Message
The EM_SHOWSCROLLBAR message shows or hides one of the scroll bars in the Text Host window.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_SHOWSCROLLBAR, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Identifies which scroll bar to display: horizontal or vertical. This parameter must be SB_VERT or SB_HORZ.
lParam
Specifies whether to show the scroll bar or hide it. Specify TRUE to show the scroll bar and FALSE to hide it.
Return Value
This message does not return a value.
Remarks
This method is only valid when the control is in-place active. Calls made while the control is inactive may fail.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95 with Rich Edit 2.0, Windows 98, Windows NT 4.0</misc>
</message>
<message value="0x458">
<name>EM_STOPGROUPTYPING</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
The return value is zero. This message cannot fail. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used; must be zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used; must be zero.</lmisc>
</lparam>
<misc>EM_STOPGROUPTYPING Message
An application sends an EM_STOPGROUPTYPING message to a rich edit control to stop the control from collecting additional typing actions into the current undo action. The control stores the next typing action, if any, into a new action in the undo queue.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_STOPGROUPTYPING, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
The return value is zero. This message cannot fail.
Remarks
A rich edit control groups consecutive typing actions, including characters deleted by using the BackSpace key, into a single undo action until one of the following events occurs:
* The control receives an EM_STOPGROUPTYPING message.
* The control loses focus.
* The user moves the current selection, either by using the arrow keys or by clicking the mouse.
* The user presses the Delete key.
* The user performs any other action, such as a paste operation that does not involve typing.
You can send the EM_STOPGROUPTYPING message to break consecutive typing actions into smaller undo groups. For example, you could send EM_STOPGROUPTYPING after each character or at each word break.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95 with Rich Edit 2.0, Windows 98, Windows NT 4.0</misc>
</message>
<message value="0x449">
<name>EM_STREAMIN</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
This message returns the number of characters read.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the data format and replacement options. This value must be one of the following values.
SF_RTF
Rich Text Format (RTF)
SF_TEXT
Text
In addition, you can specify the following flags.
SFF_PLAINRTF
If specified, only keywords common to all languages are streamed in. Language-specific RTF keywords in the stream are ignored. If not specified, all keywords are streamed in. You can combine this flag with the SF_RTF flag.
SFF_SELECTION
If specified, the data stream replaces the contents of the current selection. If not specified, the data stream replaces the entire contents of the control. You can combine this flag with the SF_TEXT or SF_RTF flags.
SF_UNICODE
Microsoft Rich Edit 2.0 and later: Indicates Unicode text. You can combine this flag with the SF_TEXT flag.
</wmisc>
</wparam>
<lparam value="EDITSTREAM">
<lname>lParam</lname>
<lmisc>lParam
Pointer to an EDITSTREAM structure. On input, the pfnCallback member of this structure must point to an application defined EditStreamCallback function. On output, the dwError member can contain a nonzero error code if an error occurred.
</lmisc>
</lparam>
<misc>EM_STREAMIN Message
The EM_STREAMIN message replaces the contents of a rich edit control with a stream of data provided by an application defined EditStreamCallback callback function.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_STREAMIN, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Specifies the data format and replacement options. This value must be one of the following values.
SF_RTF
Rich Text Format (RTF)
SF_TEXT
Text
In addition, you can specify the following flags.
SFF_PLAINRTF
If specified, only keywords common to all languages are streamed in. Language-specific RTF keywords in the stream are ignored. If not specified, all keywords are streamed in. You can combine this flag with the SF_RTF flag.
SFF_SELECTION
If specified, the data stream replaces the contents of the current selection. If not specified, the data stream replaces the entire contents of the control. You can combine this flag with the SF_TEXT or SF_RTF flags.
SF_UNICODE
Microsoft Rich Edit 2.0 and later: Indicates Unicode text. You can combine this flag with the SF_TEXT flag.
lParam
Pointer to an EDITSTREAM structure. On input, the pfnCallback member of this structure must point to an application defined EditStreamCallback function. On output, the dwError member can contain a nonzero error code if an error occurred.
Return Value
This message returns the number of characters read.
Remarks
When you send an EM_STREAMIN message, the rich edit control makes repeated calls to the EditStreamCallback function specified by the pfnCallback member of the EDITSTREAM structure. Each time the callback function is called, it fills a buffer with data to read into the control. This continues until the callback function indicates that the stream-in operation has been completed or an error occurs.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0x44a">
<name>EM_STREAMOUT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the data format and replacement options.
This value must be one of the following values.
SF_RTF
Rich Text Format (RTF).
SF_RTFNOOBJS
RTF with spaces in place of Component Object Model (COM) objects.
SF_TEXT
Text with spaces in place of COM objects.
SF_TEXTIZED
Text with a text representation of COM objects.
The SF_RTFNOOBJS option is useful if an application stores COM objects itself, as RTF representation of COM objects is not very compact. The control word, \objattph, followed by a space denotes the object position.
In addition, you can specify the following flags.
SFF_PLAINRTF
If specified, the rich edit control streams out only the keywords common to all languages, ignoring language-specific keywords. If not specified, the rich edit control streams out all keywords. You can combine this flag with the SF_RTF or SF_RTFNOOBJS flag.
SFF_SELECTION
If specified, the rich edit control streams out only the contents of the current selection. If not specified, the control streams out the entire contents. You can combine this flag with any of data format values.
SF_UNICODE
Microsoft Rich Edit 2.0 and later: Indicates Unicode text. You can combine this flag with the SF_TEXT flag.
SF_USECODEPAGE
Rich Edit 3.0 and later: Generates 8-bit Unicode Transformation Format (UTF-8) RTF as well as text using other code pages. The code page is set in the high word of wParam. For example, for UTF-8 RTF, set wParam to (CP_UTF8 16) | SF_USECODEPAGE | SF_RTF.
</wmisc>
</wparam>
<lparam value="EDITSTREAM">
<lname>lParam</lname>
<lmisc>lParam
Pointer to an EDITSTREAM structure. On input, the pfnCallback member of this structure must point to an application defined EditStreamCallback function. On output, the dwError member can contain a nonzero error code if an error occurred.
</lmisc>
</lparam>
<misc>EM_STREAMOUT Message
The EM_STREAMOUT message causes a rich edit control to pass its contents to an application defined EditStreamCallback callback function. The callback function can then write the stream of data to a file or any other location that it chooses.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_STREAMOUT, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Specifies the data format and replacement options.
This value must be one of the following values.
SF_RTF
Rich Text Format (RTF).
SF_RTFNOOBJS
RTF with spaces in place of Component Object Model (COM) objects.
SF_TEXT
Text with spaces in place of COM objects.
SF_TEXTIZED
Text with a text representation of COM objects.
The SF_RTFNOOBJS option is useful if an application stores COM objects itself, as RTF representation of COM objects is not very compact. The control word, \objattph, followed by a space denotes the object position.
In addition, you can specify the following flags.
SFF_PLAINRTF
If specified, the rich edit control streams out only the keywords common to all languages, ignoring language-specific keywords. If not specified, the rich edit control streams out all keywords. You can combine this flag with the SF_RTF or SF_RTFNOOBJS flag.
SFF_SELECTION
If specified, the rich edit control streams out only the contents of the current selection. If not specified, the control streams out the entire contents. You can combine this flag with any of data format values.
SF_UNICODE
Microsoft Rich Edit 2.0 and later: Indicates Unicode text. You can combine this flag with the SF_TEXT flag.
SF_USECODEPAGE
Rich Edit 3.0 and later: Generates 8-bit Unicode Transformation Format (UTF-8) RTF as well as text using other code pages. The code page is set in the high word of wParam. For example, for UTF-8 RTF, set wParam to (CP_UTF8 16) | SF_USECODEPAGE | SF_RTF.
lParam
Pointer to an EDITSTREAM structure. On input, the pfnCallback member of this structure must point to an application defined EditStreamCallback function. On output, the dwError member can contain a nonzero error code if an error occurred.
Return Value
Remarks
When you send an EM_STREAMOUT message, the rich edit control makes repeated calls to the EditStreamCallback function specified by the pfnCallback member of the EDITSTREAM structure. Each time it calls the callback function, the control passes a buffer containing a portion of the contents of the control. This process continues until the control has passed all its contents to the callback function, or until an error occurs.
Message Information
Header Declared in Richedit.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0xC7">
<name>EM_UNDO</name>
<return value="BOOL">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
For a single-line edit control, the return value is always TRUE.
For a multiline edit control, the return value is TRUE if the undo operation is successful, or FALSE if the undo operation fails.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used; must be zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used; must be zero.
</lmisc>
</lparam>
<misc>EM_UNDO Message
This message undoes the last edit control operation in the control's undo queue. You can send this message to either an edit control or a rich edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_UNDO, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
For a single-line edit control, the return value is always TRUE.
For a multiline edit control, the return value is TRUE if the undo operation is successful, or FALSE if the undo operation fails.
Remarks
Edit controls and Rich Edit 1.0: An undo operation can also be undone. For example, you can restore deleted text with the first EM_UNDO message, and remove the text again with a second EM_UNDO message as long as there is no intervening edit operation.
Rich Edit 2.0 and later: The undo feature is multilevel so sending two EM_UNDO messages will undo the last two operations in the undo queue. To redo an operation, send the EM_REDO message.
Rich Edit: Supported in Microsoft Rich Edit 1.0 and later. For information about the compatibility of rich edit versions with the various system versions, see About Rich Edit Controls.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x1218">
<name>HDM_CLEARFILTER</name>
<return value="BOOL">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns an integer. The LRESULT is cast to an integer that indicates TRUE(1) or FALSE(0).</returnmisc>
</return>
<wparam value="int">
<wname>i</wname>
<wmisc>i
A column value indicating which filter to clear.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.
</lmisc>
</lparam>
<misc>HDM_CLEARFILTER Message
Clears the filter for a given header control. You can send this message explicitly or use the Header_ClearFilter macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) HDM_CLEARFILTER, // message ID
(WPARAM) wParam, // = (WPARAM) (int) i;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
i
A column value indicating which filter to clear.
lParam
Must be zero.
Return Value
Returns an integer. The LRESULT is cast to an integer that indicates TRUE(1) or FALSE(0).
Remarks
If the column value is specified as -1, all the filters are cleared, and the HDN_FILTERCHANGE notification is sent only once.
Message Information
Minimum DLL Version comctl32.dll version 5.80 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 5, Windows 98</misc>
</message>
<message value="0x1210">
<name>HDM_CREATEDRAGIMAGE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>iIndex</wname>
<wmisc>iIndex
The zero-based index of the item within the header control. The image assigned to this item is the basis for the transparent image.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>HDM_CREATEDRAGIMAGE Message
Creates a semi-transparent version of an item's image for use as a dragging image. You can send this message explicitly or use the Header_CreateDragImage macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) HDM_CREATEDRAGIMAGE, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iIndex;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
iIndex
The zero-based index of the item within the header control. The image assigned to this item is the basis for the transparent image.
lParam
Must be zero.
Return Value
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x1202">
<name>HDM_DELETEITEM</name>
<return value="BOOL">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns TRUE if successful, or FALSE otherwise. </returnmisc>
</return>
<wparam value="int">
<wname>index</wname>
<wmisc>index
An index of the item to delete. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.
</lmisc>
</lparam>
<misc>HDM_DELETEITEM Message
Deletes an item from a header control. You can send this message explicitly or use the Header_DeleteItem macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) HDM_DELETEITEM, // message ID
(WPARAM) wParam, // = (WPARAM) (int) index;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
index
An index of the item to delete.
lParam
Must be zero.
Return Value
Returns TRUE if successful, or FALSE otherwise.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1217">
<name>HDM_EDITFILTER</name>
<return value="BOOL">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns an integer. The LRESULT is cast to an integer that indicates TRUE(1) or FALSE(0).</returnmisc>
</return>
<wparam value="int">
<wname>i</wname>
<wmisc>i
A value specifying the column to edit. </wmisc>
</wparam>
<lparam value="">
<lname>fDiscardChanges</lname>
<lmisc>fDiscardChanges
A flag that specifies how to handle the user's editing changes. Use this flag to specify what to do if the user is in the process of editing the filter when the message is sent.
TRUE
Discard the changes made by the user.
FALSE
Accept the changes made by the user. </lmisc>
</lparam>
<misc>HDM_EDITFILTER Message
Moves the input focus to the edit box when a filter button has the focus.
To send this message, call the SendMessage function as follows.
Syntax
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) HDM_EDITFILTER, // message ID
(WPARAM) wParam, // = (WPARAM) (int) i
(LPARAM) lParam // = (LPARAM) MAKELPARAM(fDiscardChanges, 0)
);
Parameters
i
A value specifying the column to edit.
fDiscardChanges
A flag that specifies how to handle the user's editing changes. Use this flag to specify what to do if the user is in the process of editing the filter when the message is sent.
TRUE
Discard the changes made by the user.
FALSE
Accept the changes made by the user.
Return Value
Returns an integer. The LRESULT is cast to an integer that indicates TRUE(1) or FALSE(0).
Message Information
Minimum DLL Version comctl32.dll version 5.80 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 5, Windows 98</misc>
</message>
<message value="0x1200">
<name>HDM_FIRST</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x1215">
<name>HDM_GETBITMAPMARGIN</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns the width of the bitmap margin in pixels. If the bitmap margin was not previously specified, the default value of 3* GetSystemMetrics (SM_CXEDGE) is returned.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>HDM_GETBITMAPMARGIN Message
Gets the width of the bitmap margin for a header control. You can send this message explicitly or use the Header_GetBitmapMargin macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) HDM_GETBITMAPMARGIN, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Returns the width of the bitmap margin in pixels. If the bitmap margin was not previously specified, the default value of 3* GetSystemMetrics (SM_CXEDGE) is returned.
Message Information
Minimum DLL Version comctl32.dll version 5.80 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 5, Windows 98</misc>
</message>
<message value="0x1209">
<name>HDM_GETIMAGELIST</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns a handle to the image list set for the header control. </returnmisc>
</return>
<wparam value="int">
<wname>wParam</wname>
<wmisc>wParam
One of the following values:
HDSIL_NORMAL
Indicates that this is a normal image list.
HDSIL_STATE
Indicates that this is a state image list.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>HDM_GETIMAGELIST Message
Gets the handle to the image list that has been set for an existing header control. You can send this message explicitly or use the Header_GetImageList or Header_GetStateImageList macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) HDM_GETIMAGELIST, // message ID
(WPARAM) wParam, // = (WPARAM) (int) wParam;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
One of the following values:
HDSIL_NORMAL
Indicates that this is a normal image list.
HDSIL_STATE
Indicates that this is a state image list.
lParam
Must be zero.
Return Value
Returns a handle to the image list set for the header control.
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x1203">
<name>HDM_GETITEMA</name>
<return value="BOOL">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns TRUE if successful, or FALSE otherwise.
</returnmisc>
</return>
<wparam value="int">
<wname>index</wname>
<wmisc>index
The index of the item for which information is to be retrieved. </wmisc>
</wparam>
<lparam value="LPHDITEM">
<lname>phdi</lname>
<lmisc>phdi
A pointer to an HDITEM structure. When the message is sent, the mask member indicates the type of information being requested. When the message returns, the other members receive the requested information. If the mask member specifies zero, the message returns TRUE but copies no information to the structure.
</lmisc>
</lparam>
<misc>HDM_GETITEM Message
Gets information about an item in a header control. You can send this message explicitly or use the Header_GetItem macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) HDM_GETITEM, // message ID
(WPARAM) wParam, // = (WPARAM) (int) index;
(LPARAM) lParam // = (LPARAM) (LPHDITEM) phdi;
);
Parameters
index
The index of the item for which information is to be retrieved.
phdi
A pointer to an HDITEM structure. When the message is sent, the mask member indicates the type of information being requested. When the message returns, the other members receive the requested information. If the mask member specifies zero, the message returns TRUE but copies no information to the structure.
Return Value
Returns TRUE if successful, or FALSE otherwise.
Remarks
If the HDI_TEXT flag is set in the mask member of the HDITEM structure, the control may change the pszText member of the structure to point to the new text instead of filling the buffer with the requested text. Applications should not assume that the text will always be placed in the requested buffer.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1200">
<name>HDM_GETITEMCOUNT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns the number of items if successful, or -1 otherwise. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>HDM_GETITEMCOUNT Message
Gets a count of the items in a header control. You can send this message explicitly or use the Header_GetItemCount macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) HDM_GETITEMCOUNT, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Returns the number of items if successful, or -1 otherwise.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1207">
<name>HDM_GETITEMRECT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>eturn Value
Returns nonzero if successful, or zero otherwise. </returnmisc>
</return>
<wparam value="int">
<wname>iIndex</wname>
<wmisc>iIndex
The zero-based index of the header control item for which to retrieve the bounding rectangle.
</wmisc>
</wparam>
<lparam value="RECT">
<lname>lpItemRect</lname>
<lmisc>lpItemRect
A pointer to a RECT structure that receives the bounding rectangle information. </lmisc>
</lparam>
<misc>HDM_GETITEMRECT Message
Gets the bounding rectangle for a given item in a header control. You can send this message explicitly or use the Header_GetItemRect macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) HDM_GETITEMRECT, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iIndex;
(LPARAM) lParam // = (LPARAM) (RECT*) lpItemRect;
);
Parameters
iIndex
The zero-based index of the header control item for which to retrieve the bounding rectangle.
lpItemRect
A pointer to a RECT structure that receives the bounding rectangle information.
Return Value
Returns nonzero if successful, or zero otherwise.
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x120b">
<name>HDM_GETITEMW</name>
<return value="BOOL">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns TRUE if successful, or FALSE otherwise. </returnmisc>
</return>
<wparam value="int">
<wname>index</wname>
<wmisc>index
The index of the item for which information is to be retrieved. </wmisc>
</wparam>
<lparam value="LPHDITEM">
<lname>phdi</lname>
<lmisc>phdi
A pointer to an HDITEM structure. When the message is sent, the mask member indicates the type of information being requested. When the message returns, the other members receive the requested information. If the mask member specifies zero, the message returns TRUE but copies no information to the structure.
</lmisc>
</lparam>
<misc>HDM_GETITEM Message
Gets information about an item in a header control. You can send this message explicitly or use the Header_GetItem macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) HDM_GETITEM, // message ID
(WPARAM) wParam, // = (WPARAM) (int) index;
(LPARAM) lParam // = (LPARAM) (LPHDITEM) phdi;
);
Parameters
index
The index of the item for which information is to be retrieved.
phdi
A pointer to an HDITEM structure. When the message is sent, the mask member indicates the type of information being requested. When the message returns, the other members receive the requested information. If the mask member specifies zero, the message returns TRUE but copies no information to the structure.
Return Value
Returns TRUE if successful, or FALSE otherwise.
Remarks
If the HDI_TEXT flag is set in the mask member of the HDITEM structure, the control may change the pszText member of the structure to point to the new text instead of filling the buffer with the requested text. Applications should not assume that the text will always be placed in the requested buffer.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1211">
<name>HDM_GETORDERARRAY</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns nonzero if successful, and the buffer at lpiArray receives the item number for each item in the header control in the order in which they appear from left to right. Otherwise, the message returns zero.
</returnmisc>
</return>
<wparam value="int">
<wname>iSize</wname>
<wmisc>iSize
The number of integer elements that lpiArray can hold. This value must be equal to the number of items in the control (see HDM_GETITEMCOUNT).
</wmisc>
</wparam>
<lparam value="LPINT">
<lname>lpiArray</lname>
<lmisc>lpiArray
A pointer to an array of integers that receive the index values for items in the header.
</lmisc>
</lparam>
<misc>HDM_GETORDERARRAY Message
Gets the current left-to-right order of items in a header control. You can send this message explicitly or use the Header_GetOrderArray macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) HDM_GETORDERARRAY, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iSize;
(LPARAM) lParam // = (LPARAM) (LPINT) lpiArray;
);
Parameters
iSize
The number of integer elements that lpiArray can hold. This value must be equal to the number of items in the control (see HDM_GETITEMCOUNT).
lpiArray
A pointer to an array of integers that receive the index values for items in the header.
Return Value
Returns nonzero if successful, and the buffer at lpiArray receives the item number for each item in the header control in the order in which they appear from left to right. Otherwise, the message returns zero.
Remarks
The number of elements in lpiArray is specified in iSize and must be equal to the number of items in the control. For example, the following code fragment will reserve enough memory to hold the index values.
Copy Code
int iItems,
*lpiArray;
// Get memory for buffer.
(iItems = SendMessage(hwndHD, HDM_GETITEMCOUNT, 0,0))!=-1)
if(!(lpiArray = calloc(iItems,sizeof(int))))
MessageBox(hwnd, "Out of memory.","Error", MB_OK);
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0
</misc>
</message>
<message value="0x1206">
<name>HDM_HITTEST</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns the index of the item at the specified position, if any, or 1 otherwise. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPHDHITTESTINFO">
<lname>phdhti</lname>
<lmisc>phdhti
A pointer to an HDHITTESTINFO structure that contains the position to test and receives information about the results of the test.
</lmisc>
</lparam>
<misc>HDM_HITTEST Message
Tests a point to determine which header item, if any, is at the specified point.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) HDM_HITTEST, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPHDHITTESTINFO) phdhti;
);
Parameters
wParam
Must be zero.
phdhti
A pointer to an HDHITTESTINFO structure that contains the position to test and receives information about the results of the test.
Return Value
Returns the index of the item at the specified position, if any, or 1 otherwise.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1201">
<name>HDM_INSERTITEMA</name>
<return value="">
<returninfo></returninfo>
<returnmisc>returns LRESULT in lResult</returnmisc>
</return>
<wparam value="int">
<wname>index</wname>
<wmisc>index
The index of the item after which the new item is to be inserted. The new item is inserted at the end of the header control if index is greater than or equal to the number of items in the control. If index is zero, the new item is inserted at the beginning of the header control.
</wmisc>
</wparam>
<lparam value="LPHDITEM">
<lname>phdi</lname>
<lmisc>phdi
A pointer to an HDITEM structure that contains information about the new item. </lmisc>
</lparam>
<misc>HDM_INSERTITEM Message
Inserts a new item into a header control. You can send this message explicitly or use the Header_InsertItem macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) HDM_INSERTITEM, // message ID
(WPARAM) wParam, // = (WPARAM) (int) index;
(LPARAM) lParam // = const (LPARAM) (LPHDITEM) phdi;
);
Parameters
index
The index of the item after which the new item is to be inserted. The new item is inserted at the end of the header control if index is greater than or equal to the number of items in the control. If index is zero, the new item is inserted at the beginning of the header control.
phdi
A pointer to an HDITEM structure that contains information about the new item.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x120a">
<name>HDM_INSERTITEMW</name>
<return value="">
<returninfo></returninfo>
<returnmisc>returns LRESULT in lResult</returnmisc>
</return>
<wparam value="int">
<wname>index</wname>
<wmisc>index
The index of the item after which the new item is to be inserted. The new item is inserted at the end of the header control if index is greater than or equal to the number of items in the control. If index is zero, the new item is inserted at the beginning of the header control.
</wmisc>
</wparam>
<lparam value="LPHDITEM">
<lname>phdi</lname>
<lmisc>phdi
A pointer to an HDITEM structure that contains information about the new item. </lmisc>
</lparam>
<misc>HDM_INSERTITEM Message
Inserts a new item into a header control. You can send this message explicitly or use the Header_InsertItem macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) HDM_INSERTITEM, // message ID
(WPARAM) wParam, // = (WPARAM) (int) index;
(LPARAM) lParam // = const (LPARAM) (LPHDITEM) phdi;
);
Parameters
index
The index of the item after which the new item is to be inserted. The new item is inserted at the end of the header control if index is greater than or equal to the number of items in the control. If index is zero, the new item is inserted at the beginning of the header control.
phdi
A pointer to an HDITEM structure that contains information about the new item.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1205">
<name>HDM_LAYOUT</name>
<return value="BOOL">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns TRUE if successful, or FALSE otherwise. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPHDLAYOUT">
<lname>playout</lname>
<lmisc>playout
A pointer to an HDLAYOUT structure. The prc member specifies the coordinates of a rectangle, and the pwpos member receives the size and position for the header control within the rectangle.
</lmisc>
</lparam>
<misc>HDM_LAYOUT Message
Retrieves the correct size and position of a header control within the parent window. You can send this message explicitly or use the Header_Layout macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) HDM_LAYOUT, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPHDLAYOUT) playout;
);
Parameters
wParam
Must be zero.
playout
A pointer to an HDLAYOUT structure. The prc member specifies the coordinates of a rectangle, and the pwpos member receives the size and position for the header control within the rectangle.
Return Value
Returns TRUE if successful, or FALSE otherwise.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x120f">
<name>HDM_ORDERTOINDEX</name>
<return value="int">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns INT that indicates the item index. If iOrder is invalid (negative or too large), the return equals iOrder.
</returnmisc>
</return>
<wparam value="int">
<wname>iOrder</wname>
<wmisc>iOrder
The order in which the item appears within the header control, from left to right. For example, the index value of the item in the far left column would be 0. The value for the next item to the right would be 1, and so on.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc> lParam
Must be zero.</lmisc>
</lparam>
<misc>HDM_ORDERTOINDEX Message
Retrieves an index value for an item based on its order in the header control. You can send this message explicitly or use the Header_OrderToIndex macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) HDM_ORDERTOINDEX, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iOrder;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
iOrder
The order in which the item appears within the header control, from left to right. For example, the index value of the item in the far left column would be 0. The value for the next item to the right would be 1, and so on.
lParam
Must be zero.
Return Value
Returns INT that indicates the item index. If iOrder is invalid (negative or too large), the return equals iOrder.
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x1214">
<name>HDM_SETBITMAPMARGIN</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns the width of the bitmap margin, in pixels. If the bitmap margin was not previously specified, the default value of 3* GetSystemMetrics (SM_CXEDGE) is returned.
</returnmisc>
</return>
<wparam value="int">
<wname>iWidth</wname>
<wmisc>iWidth
The width, specified in pixels, of the margin that surrounds a bitmap within an existing header control.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>HDM_SETBITMAPMARGIN Message
Sets the width of the margin, specified in pixels, of a bitmap in an existing header control. You can send this message explicitly or use the Header_SetBitmapMargin macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) HDM_SETBITMAPMARGIN, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iWidth;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
iWidth
The width, specified in pixels, of the margin that surrounds a bitmap within an existing header control.
lParam
Must be zero.
Return Value
Returns the width of the bitmap margin, in pixels. If the bitmap margin was not previously specified, the default value of 3* GetSystemMetrics (SM_CXEDGE) is returned.
Message Information
Minimum DLL Version comctl32.dll version 5.80 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 5, Windows 98</misc>
</message>
<message value="0x1216">
<name>HDM_SETFILTERCHANGETIMEOUT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="int">
<lname>i</lname>
<lmisc>i
The timeout value, in milliseconds.
</lmisc>
</lparam>
<misc>HDM_SETFILTERCHANGETIMEOUT Message
Sets the timeout interval between the time a change takes place in the filter attributes and the posting of an HDN_FILTERCHANGE notification. You can send this message explicitly or use the Header_SetFilterChangeTimeout macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) HDM_SETFILTERCHANGETIMEOUT, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (int) i;
);
Parameters
wParam
Must be zero.
i
The timeout value, in milliseconds.
Return Value
Message Information
Minimum DLL Version comctl32.dll version 5.80 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 5, Windows 98</misc>
</message>
<message value="0x1213">
<name>HDM_SETHOTDIVIDER</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="BOOL">
<wname>flag</wname>
<wmisc>flag
The type of value represented by dwInputValue. This value can be one of the following:
TRUE
Indicates that dwInputValue holds the client coordinates of the pointer.
FALSE
Indicates that dwInputValue holds a divider index value.</wmisc>
</wparam>
<lparam value="DWORD">
<lname>dwInputValue</lname>
<lmisc>dwInputValue
A value held in dwInputValue is interpreted depending on the value of flag.
If flag is TRUE, dwInputValue represents the x- and y-coordinates of the pointer. The x-coordinate is in the low word, and the y-coordinate is in the high word. When the header control receives the message, it highlights the appropriate divider based on the dwInputValue coordinates.
If flag is FALSE, dwInputValue represents the integer index of the divider to be highlighted.
</lmisc>
</lparam>
<misc>HDM_SETHOTDIVIDER Message
Changes the color of a divider between header items to indicate the destination of an external drag-and-drop operation. You can send this message explicitly or use the Header_SetHotDivider macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) HDM_SETHOTDIVIDER, // message ID
(WPARAM) wParam, // = (WPARAM) (BOOL) flag;
(LPARAM) lParam // = (LPARAM) (DWORD) dwInputValue;
);
Parameters
flag
The type of value represented by dwInputValue. This value can be one of the following:
TRUE
Indicates that dwInputValue holds the client coordinates of the pointer.
FALSE
Indicates that dwInputValue holds a divider index value.
dwInputValue
A value held in dwInputValue is interpreted depending on the value of flag.
If flag is TRUE, dwInputValue represents the x- and y-coordinates of the pointer. The x-coordinate is in the low word, and the y-coordinate is in the high word. When the header control receives the message, it highlights the appropriate divider based on the dwInputValue coordinates.
If flag is FALSE, dwInputValue represents the integer index of the divider to be highlighted.
Return Value
Remarks
This message creates an effect that a header control automatically produces when it has the HDS_DRAGDROP style. The HDM_SETHOTDIVIDER message is intended to be used when the owner of the control handles drag-and-drop operations manually.
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x1208">
<name>HDM_SETIMAGELIST</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>wParam</wname>
<wmisc>wParam
One of the following values:
HDSIL_NORMAL
Indicates that this is a normal image list.
HDSIL_STATE
Indicates that this is a state image list.</wmisc>
</wparam>
<lparam value="HIMAGELIST">
<lname>himl</lname>
<lmisc>himl
A handle to an image list. </lmisc>
</lparam>
<misc>HDM_SETIMAGELIST Message
Assigns an image list to an existing header control. You can send this message explicitly or use the Header_SetImageList or Header_SetStateImageList macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) HDM_SETIMAGELIST, // message ID
(WPARAM) wParam, // = (WPARAM) (int) wParam;
(LPARAM) lParam // = (LPARAM) (HIMAGELIST) himl;
);
Parameters
wParam
One of the following values:
HDSIL_NORMAL
Indicates that this is a normal image list.
HDSIL_STATE
Indicates that this is a state image list.
himl
A handle to an image list.
Return Value
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x1204">
<name>HDM_SETITEMA</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns nonzero upon success, or zero otherwise. </returnmisc>
</return>
<wparam value="int">
<wname>iIndex</wname>
<wmisc>iIndex
The current index of the item whose attributes are to be changed. </wmisc>
</wparam>
<lparam value="LPHDITEM">
<lname>phdItem</lname>
<lmisc>phdItem
A pointer to an HDITEM structure that contains item information. When this message is sent, the mask member of the structure must be set to indicate which attributes are being set.
</lmisc>
</lparam>
<misc>HDM_SETITEM Message
Sets the attributes of the specified item in a header control. You can send this message explicitly or use the Header_SetItem macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) HDM_SETITEM, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iIndex;
(LPARAM) lParam // = const (LPARAM) (LPHDITEM) phdItem;
);
Parameters
iIndex
The current index of the item whose attributes are to be changed.
phdItem
A pointer to an HDITEM structure that contains item information. When this message is sent, the mask member of the structure must be set to indicate which attributes are being set.
Return Value
Returns nonzero upon success, or zero otherwise.
Remarks
The HDITEM structure that supports this message supports item order and image list information. By using these members, you can control the order in which items are displayed and specify images to appear with items.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x120c">
<name>HDM_SETITEMW</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns nonzero upon success, or zero otherwise. </returnmisc>
</return>
<wparam value="int">
<wname>iIndex</wname>
<wmisc>iIndex
The current index of the item whose attributes are to be changed. </wmisc>
</wparam>
<lparam value="LPHDITEM">
<lname>phdItem</lname>
<lmisc>phdItem
A pointer to an HDITEM structure that contains item information. When this message is sent, the mask member of the structure must be set to indicate which attributes are being set.
</lmisc>
</lparam>
<misc>HDM_SETITEM Message
Sets the attributes of the specified item in a header control. You can send this message explicitly or use the Header_SetItem macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) HDM_SETITEM, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iIndex;
(LPARAM) lParam // = const (LPARAM) (LPHDITEM) phdItem;
);
Parameters
iIndex
The current index of the item whose attributes are to be changed.
phdItem
A pointer to an HDITEM structure that contains item information. When this message is sent, the mask member of the structure must be set to indicate which attributes are being set.
Return Value
Returns nonzero upon success, or zero otherwise.
Remarks
The HDITEM structure that supports this message supports item order and image list information. By using these members, you can control the order in which items are displayed and specify images to appear with items.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1212">
<name>HDM_SETORDERARRAY</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>iSize</wname>
<wmisc> iSize
The size of the buffer at lpiArray, in elements. This value must equal the value returned by HDM_GETITEMCOUNT.
</wmisc>
</wparam>
<lparam value="LPINT">
<lname>lpiArray</lname>
<lmisc>lpiArray
A pointer to an array that specifies the order in which items should be displayed, from left to right. For example, if the contents of the array are {2,0,1}, the control displays item 2, item 0, and item 1, from left to right.
</lmisc>
</lparam>
<misc>HDM_SETORDERARRAY Message
Sets the left-to-right order of header items. You can send this message explicitly or use the Header_SetOrderArray macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) HDM_SETORDERARRAY, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iSize;
(LPARAM) lParam // = (LPARAM) (LPINT) lpiArray;
);
Parameters
iSize
The size of the buffer at lpiArray, in elements. This value must equal the value returned by HDM_GETITEMCOUNT.
lpiArray
A pointer to an array that specifies the order in which items should be displayed, from left to right. For example, if the contents of the array are {2,0,1}, the control displays item 2, item 0, and item 1, from left to right.
Return Value
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x1000">
<name>LVM_GETBKCOLOR</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>LVM_GETBKCOLOR Message
Gets the background color of a list-view control. You can send this message explicitly or by using the ListView_GetBkColor macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETBKCOLOR, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1001">
<name>LVM_SETBKCOLOR</name>
<return value="BOOL">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns TRUE if successful, or FALSE otherwise. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="COLORREF">
<lname>clrBk</lname>
<lmisc>clrBk
Background color to set or the CLR_NONE value for no background color. List-view controls with background colors redraw themselves significantly faster than those without background colors.
</lmisc>
</lparam>
<misc>LVM_SETBKCOLOR Message
Sets the background color of a list-view control. You can send this message explicitly or by using the ListView_SetBkColor macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_SETBKCOLOR, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (COLORREF) clrBk;
);
Parameters
wParam
Must be zero.
clrBk
Background color to set or the CLR_NONE value for no background color. List-view controls with background colors redraw themselves significantly faster than those without background colors.
Return Value
Returns TRUE if successful, or FALSE otherwise.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1002">
<name>LVM_GETIMAGELIST</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns the handle to the specified image list if successful, or NULL otherwise. </returnmisc>
</return>
<wparam value="int">
<wname>iImageList</wname>
<wmisc>iImageList
Image list to retrieve. This parameter can be one of the following values:
LVSIL_NORMAL
Image list with large icons.
LVSIL_SMALL
Image list with small icons.
LVSIL_STATE
Image list with state images.
LVSIL_GROUPHEADER
Image list for group header.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.
</lmisc>
</lparam>
<misc>LVM_GETIMAGELIST Message
Retrieves the handle to an image list used for drawing list-view items. You can send this message explicitly or by using the ListView_GetImageList macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETIMAGELIST, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iImageList;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
iImageList
Image list to retrieve. This parameter can be one of the following values:
LVSIL_NORMAL
Image list with large icons.
LVSIL_SMALL
Image list with small icons.
LVSIL_STATE
Image list with state images.
LVSIL_GROUPHEADER
Image list for group header.
lParam
Must be zero.
Return Value
Returns the handle to the specified image list if successful, or NULL otherwise.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1003">
<name>LVM_GETIMAGELIST</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns the handle to the specified image list if successful, or NULL otherwise. </returnmisc>
</return>
<wparam value="int">
<wname>iImageList</wname>
<wmisc>iImageList
Image list to retrieve. This parameter can be one of the following values:
LVSIL_NORMAL
Image list with large icons.
LVSIL_SMALL
Image list with small icons.
LVSIL_STATE
Image list with state images.
LVSIL_GROUPHEADER
Image list for group header.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>LVM_GETIMAGELIST Message
Retrieves the handle to an image list used for drawing list-view items. You can send this message explicitly or by using the ListView_GetImageList macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETIMAGELIST, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iImageList;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
iImageList
Image list to retrieve. This parameter can be one of the following values:
LVSIL_NORMAL
Image list with large icons.
LVSIL_SMALL
Image list with small icons.
LVSIL_STATE
Image list with state images.
LVSIL_GROUPHEADER
Image list for group header.
lParam
Must be zero.
Return Value
Returns the handle to the specified image list if successful, or NULL otherwise.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1004">
<name>LVM_GETITEMCOUNT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>LVM_GETITEMCOUNT Message
Retrieves the number of items in a list-view control. You can send this message explicitly or by using the ListView_GetItemCount macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETITEMCOUNT, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1005">
<name>LVM_GETITEMA</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPLVITEMA">
<lname>pitem</lname>
<lmisc>pitem
Pointer to an LVITEM structure that specifies the information to retrieve and receives information about the list-view item.
</lmisc>
</lparam>
<misc>LVM_GETITEM Message
Retrieves some or all of a list-view item's attributes. You can send this message explicitly or by using the ListView_GetItem macro.
Syntax
To send this message, call the SendMessage function as follows.
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETITEM, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPLVITEM) pitem;
);
Parameters
wParam
Must be zero.
pitem
Pointer to an LVITEM structure that specifies the information to retrieve and receives information about the list-view item.
Return Value
Remarks
When the LVM_GETITEM message is sent, the iItem and iSubItem members identify the item or subitem to retrieve information about and the mask member specifies which attributes to retrieve. For a list of possible values, see the description of the LVITEM structure.
If the LVIF_TEXT flag is set in the mask member of the LVITEM structure, the pszText member must point to a valid buffer and the cchTextMax member must be set to the number of characters in that buffer. Applications should not assume that the text will necessarily be placed in the specified buffer. The control may instead change the pszText member of the structure to point to the new text, rather than place it in the buffer.
If the mask member specifies the LVIF_STATE value, the stateMask member must specify the item state bits to retrieve. On output, the state member contains the values of the specified state bits.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x104b">
<name>LVM_GETITEMW</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPLVITEMW">
<lname>pitem</lname>
<lmisc>pitem
Pointer to an LVITEM structure that specifies the information to retrieve and receives information about the list-view item.
</lmisc>
</lparam>
<misc>LVM_GETITEM Message
Retrieves some or all of a list-view item's attributes. You can send this message explicitly or by using the ListView_GetItem macro.
Syntax
To send this message, call the SendMessage function as follows.
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETITEM, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPLVITEM) pitem;
);
Parameters
wParam
Must be zero.
pitem
Pointer to an LVITEM structure that specifies the information to retrieve and receives information about the list-view item.
Return Value
Remarks
When the LVM_GETITEM message is sent, the iItem and iSubItem members identify the item or subitem to retrieve information about and the mask member specifies which attributes to retrieve. For a list of possible values, see the description of the LVITEM structure.
If the LVIF_TEXT flag is set in the mask member of the LVITEM structure, the pszText member must point to a valid buffer and the cchTextMax member must be set to the number of characters in that buffer. Applications should not assume that the text will necessarily be placed in the specified buffer. The control may instead change the pszText member of the structure to point to the new text, rather than place it in the buffer.
If the mask member specifies the LVIF_STATE value, the stateMask member must specify the item state bits to retrieve. On output, the state member contains the values of the specified state bits.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1006">
<name>LVM_SETITEMA</name>
<return value="BOOL">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns TRUE if successful, or FALSE otherwise. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPLVITEM">
<lname>pitem</lname>
<lmisc> pitem
Pointer to an LVITEM structure that contains the new item attributes. The iItem and iSubItem members identify the item or subitem, and the mask member specifies which attributes to set. If the mask member specifies the LVIF_TEXT value, the pszText member is the address of a null-terminated string and the cchTextMax member is ignored. If the mask member specifies the LVIF_STATE value, the stateMask member specifies which item states to change and the state member contains the values for those states.
</lmisc>
</lparam>
<misc>LVM_SETITEM Message
Sets some or all of a list-view item's attributes. You can also send LVM_SETITEM to set the text of a subitem. You can send this message explicitly or by using the ListView_SetItem macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_SETITEM, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = const (LPARAM) (LPLVITEM) pitem;
);
Parameters
wParam
Must be zero.
pitem
Pointer to an LVITEM structure that contains the new item attributes. The iItem and iSubItem members identify the item or subitem, and the mask member specifies which attributes to set. If the mask member specifies the LVIF_TEXT value, the pszText member is the address of a null-terminated string and the cchTextMax member is ignored. If the mask member specifies the LVIF_STATE value, the stateMask member specifies which item states to change and the state member contains the values for those states.
Return Value
Returns TRUE if successful, or FALSE otherwise.
Remarks
To set the attributes of a list-view item, set the iItem member of the LVITEM structure to the index of the item, and set the iSubItem member to zero. For an item, you can set the state, pszText, iImage, and lParam members of the LVITEM structure.
To set the text of a subitem, set the iItem and iSubItem members to indicate the specific subitem, and use the pszText member to specify the text. Alternatively, you can use the ListView_SetItemText macro to set the text of a subitem. You cannot set the state or lParam members for subitems because subitems do not have these attributes. In version 4.70 and later, you can set the iImage member for subitems. The subitem image will be displayed if the list-view control has the LVS_EX_SUBITEMIMAGES extended style. Previous versions will ignore the subitem image.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x104c">
<name>LVM_SETITEMW</name>
<return value="BOOL">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns TRUE if successful, or FALSE otherwise. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPLVITEM">
<lname>pitem</lname>
<lmisc> pitem
Pointer to an LVITEM structure that contains the new item attributes. The iItem and iSubItem members identify the item or subitem, and the mask member specifies which attributes to set. If the mask member specifies the LVIF_TEXT value, the pszText member is the address of a null-terminated string and the cchTextMax member is ignored. If the mask member specifies the LVIF_STATE value, the stateMask member specifies which item states to change and the state member contains the values for those states.
</lmisc>
</lparam>
<misc>LVM_SETITEM Message
Sets some or all of a list-view item's attributes. You can also send LVM_SETITEM to set the text of a subitem. You can send this message explicitly or by using the ListView_SetItem macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_SETITEM, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = const (LPARAM) (LPLVITEM) pitem;
);
Parameters
wParam
Must be zero.
pitem
Pointer to an LVITEM structure that contains the new item attributes. The iItem and iSubItem members identify the item or subitem, and the mask member specifies which attributes to set. If the mask member specifies the LVIF_TEXT value, the pszText member is the address of a null-terminated string and the cchTextMax member is ignored. If the mask member specifies the LVIF_STATE value, the stateMask member specifies which item states to change and the state member contains the values for those states.
Return Value
Returns TRUE if successful, or FALSE otherwise.
Remarks
To set the attributes of a list-view item, set the iItem member of the LVITEM structure to the index of the item, and set the iSubItem member to zero. For an item, you can set the state, pszText, iImage, and lParam members of the LVITEM structure.
To set the text of a subitem, set the iItem and iSubItem members to indicate the specific subitem, and use the pszText member to specify the text. Alternatively, you can use the ListView_SetItemText macro to set the text of a subitem. You cannot set the state or lParam members for subitems because subitems do not have these attributes. In version 4.70 and later, you can set the iImage member for subitems. The subitem image will be displayed if the list-view control has the LVS_EX_SUBITEMIMAGES extended style. Previous versions will ignore the subitem image.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1007">
<name>LVM_INSERTITEMA</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns the index of the new item if successful, or -1 otherwise.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPLVITEM">
<lname>pitem</lname>
<lmisc>pitem
Pointer to an LVITEM structure that specifies the attributes of the list-view item. Use the iItem member to specify the zero-based index at which the new item should be inserted. If this value is greater than the number of items currently contained by the listview, the new item will be appended to the end of the list and assigned the correct index. Examine the message's return value to determine the actual index assigned to the item.
</lmisc>
</lparam>
<misc>LVM_INSERTITEM Message
Inserts a new item in a list-view control. You can send this message explicitly or by using the ListView_InsertItem macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_INSERTITEM, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = const (LPARAM) (LPLVITEM) pitem;
);
Parameters
wParam
Must be zero.
pitem
Pointer to an LVITEM structure that specifies the attributes of the list-view item. Use the iItem member to specify the zero-based index at which the new item should be inserted. If this value is greater than the number of items currently contained by the listview, the new item will be appended to the end of the list and assigned the correct index. Examine the message's return value to determine the actual index assigned to the item.
Return Value
Returns the index of the new item if successful, or -1 otherwise.
Remarks
You cannot use ListView_InsertItem or LVM_INSERTITEM to insert subitems. The iSubItem member of the LVITEM structure must be zero. See LVM_SETITEM for information on setting subitems.
If a list-view control has the LVS_EX_CHECKBOXES style set, any value placed in bits 12 through 15 of the state member of the LVITEM structure will be ignored. When an item is added with this style set, it will always be set to the unchecked state.
If a list-view control has either the LVS_SORTASCENDING or LVS_SORTDESCENDING window style, an LVM_INSERTITEM message will fail if you try to insert an item that has LPSTR_TEXTCALLBACK as the value for its pszText member.
The LVM_INSERTITEM message will insert the new item in the proper position in the sort order if the following conditions hold:
* You are using one of the LVS_SORTXXX styles.
* You are not using the LVS_OWNERDRAW style.
* The pszText member of the structure pointed to by pitem is not set to LPSTR_TEXTCALLBACK.
If the LVITEM structure does not contain LVIF_GROUPID in the mask member, the value of the iGroupId member is I_GROUPIDCALLBACK by default.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x104d">
<name>LVM_INSERTITEMW</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns the index of the new item if successful, or -1 otherwise.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPLVITEM">
<lname>pitem</lname>
<lmisc>pitem
Pointer to an LVITEM structure that specifies the attributes of the list-view item. Use the iItem member to specify the zero-based index at which the new item should be inserted. If this value is greater than the number of items currently contained by the listview, the new item will be appended to the end of the list and assigned the correct index. Examine the message's return value to determine the actual index assigned to the item.
</lmisc>
</lparam>
<misc>LVM_INSERTITEM Message
Inserts a new item in a list-view control. You can send this message explicitly or by using the ListView_InsertItem macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_INSERTITEM, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = const (LPARAM) (LPLVITEM) pitem;
);
Parameters
wParam
Must be zero.
pitem
Pointer to an LVITEM structure that specifies the attributes of the list-view item. Use the iItem member to specify the zero-based index at which the new item should be inserted. If this value is greater than the number of items currently contained by the listview, the new item will be appended to the end of the list and assigned the correct index. Examine the message's return value to determine the actual index assigned to the item.
Return Value
Returns the index of the new item if successful, or -1 otherwise.
Remarks
You cannot use ListView_InsertItem or LVM_INSERTITEM to insert subitems. The iSubItem member of the LVITEM structure must be zero. See LVM_SETITEM for information on setting subitems.
If a list-view control has the LVS_EX_CHECKBOXES style set, any value placed in bits 12 through 15 of the state member of the LVITEM structure will be ignored. When an item is added with this style set, it will always be set to the unchecked state.
If a list-view control has either the LVS_SORTASCENDING or LVS_SORTDESCENDING window style, an LVM_INSERTITEM message will fail if you try to insert an item that has LPSTR_TEXTCALLBACK as the value for its pszText member.
The LVM_INSERTITEM message will insert the new item in the proper position in the sort order if the following conditions hold:
* You are using one of the LVS_SORTXXX styles.
* You are not using the LVS_OWNERDRAW style.
* The pszText member of the structure pointed to by pitem is not set to LPSTR_TEXTCALLBACK.
If the LVITEM structure does not contain LVIF_GROUPID in the mask member, the value of the iGroupId member is I_GROUPIDCALLBACK by default.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1008">
<name>LVM_DELETEITEM</name>
<return value="BOOL">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns TRUE if successful, or FALSE otherwise. </returnmisc>
</return>
<wparam value="int">
<wname>iItem</wname>
<wmisc>iItem
The index of the list-view item to delete. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.
</lmisc>
</lparam>
<misc>LVM_DELETEITEM Message
Removes an item from a list-view control. You can send this message explicitly or by using the ListView_DeleteItem macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_DELETEITEM, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iItem;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
iItem
The index of the list-view item to delete.
lParam
Must be zero.
Return Value
Returns TRUE if successful, or FALSE otherwise.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1009">
<name>LVM_DELETEALLITEMS</name>
<return value="BOOL">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns TRUE if successful, or FALSE otherwise. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.
</lmisc>
</lparam>
<misc>LVM_DELETEALLITEMS Message
Removes all items from a list-view control. You can send this message explicitly or by using the ListView_DeleteAllItems macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_DELETEALLITEMS, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Returns TRUE if successful, or FALSE otherwise.
Remarks
When a list-view control receives the LVM_DELETEALLITEMS message, it sends the LVN_DELETEALLITEMS notification message to its parent window.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x100a">
<name>LVM_GETCALLBACKMASK</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns the callback mask. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>LVM_GETCALLBACKMASK Message
Gets the callback mask for a list-view control. You can send this message explicitly or by using the ListView_GetCallbackMask macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETCALLBACKMASK, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Returns the callback mask.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x100b">
<name>LVM_SETCALLBACKMASK</name>
<return value="BOOL">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns TRUE if successful, or FALSE otherwise.
</returnmisc>
</return>
<wparam value="UINT">
<wname>mask</wname>
<wmisc>mask
Value of the callback mask. The bits of the mask indicate the item states or images for which the application stores the current state data. This value can be any combination of the following constants:
LVIS_CUT
The item is marked for a cut-and-paste operation.
LVIS_DROPHILITED
The item is highlighted as a drag-and-drop target.
LVIS_FOCUSED
The item has the focus.
LVIS_SELECTED
The item is selected.
LVIS_OVERLAYMASK
The application stores the image list index of the current overlay image for each item.
LVIS_STATEIMAGEMASK
The application stores the image list index of the current state image for each item.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>LVM_SETCALLBACKMASK Message
Changes the callback mask for a list-view control. You can send this message explicitly or by using the ListView_SetCallbackMask macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_SETCALLBACKMASK, // message ID
(WPARAM) wParam, // = (WPARAM) (UINT) mask;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
mask
Value of the callback mask. The bits of the mask indicate the item states or images for which the application stores the current state data. This value can be any combination of the following constants:
LVIS_CUT
The item is marked for a cut-and-paste operation.
LVIS_DROPHILITED
The item is highlighted as a drag-and-drop target.
LVIS_FOCUSED
The item has the focus.
LVIS_SELECTED
The item is selected.
LVIS_OVERLAYMASK
The application stores the image list index of the current overlay image for each item.
LVIS_STATEIMAGEMASK
The application stores the image list index of the current state image for each item.
lParam
Must be zero.
Return Value
Returns TRUE if successful, or FALSE otherwise.
Remarks
The callback mask of a list-view control is a set of bit flags that specify the item states for which the application, rather than the control, stores the current data. The callback mask applies to all of the control's items, unlike the callback item designation, which applies to a specific item. The callback mask is zero by default, meaning that the list-view control stores all item state information. After creating a list-view control and initializing its items, you can send the LVM_SETCALLBACKMASK message to change the callback mask. To retrieve the current callback mask, send the LVM_GETCALLBACKMASK message.
For more information about overlay images and state images, see Adding List-View Image Lists.
For more information on list-view callbacks, see Callback Items and the Callback Mask.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x100c">
<name>LVM_GETNEXTITEM</name>
<return value="">
<returninfo></returninfo>
<returnmisc>returns LRESULT in lResult</returnmisc>
</return>
<wparam value="int">
<wname>iStart</wname>
<wmisc>iStart
Index of the item to begin the search with, or -1 to find the first item that matches the specified flags. The specified item itself is excluded from the search.
</wmisc>
</wparam>
<lparam value="UINT">
<lname>flags</lname>
<lmisc>flags
Specifies the relationship to the item specified in iStart. This can be one or a combination of the following values:
Searches by index.
LVNI_ALL
Searches for a subsequent item by index, the default value.
LVNI_PREVIOUS
Microsoft Windows Vista and later: Searches for an item that is ordered before the item specified in plvii. The LVNI_PREVIOUS flag is not directional (LVNI_ABOVE will find the item positioned above, while LVNI_PREVIOUS will find the item ordered before.) The LVNI_PREVIOUS flag basically reverses the logic of the search performed by the LVM_GETNEXTITEM or LVM_GETNEXTITEMINDEX messages.
Searches by physical relationship to the index of the item where the search is to begin.
LVNI_ABOVE
Searches for an item that is above the specified item.
LVNI_BELOW
Searches for an item that is below the specified item.
LVNI_TOLEFT
Searches for an item to the left of the specified item.
LVNI_TORIGHT
Searches for an item to the right of the specified item.
LVNI_DIRECTIONMASK
Microsoft Windows Vista and later: A directional flag mask with value as follows: LVNI_ABOVE | LVNI_BELOW | LVNI_TOLEFT | LVNI_TORIGHT.
The state of the item to find can be specified with one or a combination of the following values:
LVNI_CUT
The item has the LVIS_CUT state flag set.
LVNI_DROPHILITED
The item has the LVIS_DROPHILITED state flag set
LVNI_FOCUSED
The item has the LVIS_FOCUSED state flag set.
LVNI_SELECTED
The item has the LVIS_SELECTED state flag set.
LVNI_STATEMASK
Microsoft Windows Vista and later: A state flag mask with value as follows: LVNI_FOCUSED | LVNI_SELECTED | LVNI_CUT | LVNI_DROPHILITED.
Searches by appearance of items or by group
LVNI_VISIBLEORDER
Microsoft Windows Vista and later: Search the visible order.
LVNI_VISIBLEONLY
Microsoft Windows Vista and later: Search the visible items.
LVNI_SAMEGROUPONLY
Microsoft Windows Vista and later: Search the current group.
If an item does not have all of the specified state flags set, the search continues with the next item.
</lmisc>
</lparam>
<misc>LVM_GETNEXTITEM Message
Searches for a list-view item that has the specified properties and bears the specified relationship to a specified item. You can send this message explicitly or by using the ListView_GetNextItem macro.
To send this message, call the SendMessage function as follows.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETNEXTITEM, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iStart;
(LPARAM) lParam // = (LPARAM) (UINT) flags;
);
Parameters
iStart
Index of the item to begin the search with, or -1 to find the first item that matches the specified flags. The specified item itself is excluded from the search.
flags
Specifies the relationship to the item specified in iStart. This can be one or a combination of the following values:
Searches by index.
LVNI_ALL
Searches for a subsequent item by index, the default value.
LVNI_PREVIOUS
Microsoft Windows Vista and later: Searches for an item that is ordered before the item specified in plvii. The LVNI_PREVIOUS flag is not directional (LVNI_ABOVE will find the item positioned above, while LVNI_PREVIOUS will find the item ordered before.) The LVNI_PREVIOUS flag basically reverses the logic of the search performed by the LVM_GETNEXTITEM or LVM_GETNEXTITEMINDEX messages.
Searches by physical relationship to the index of the item where the search is to begin.
LVNI_ABOVE
Searches for an item that is above the specified item.
LVNI_BELOW
Searches for an item that is below the specified item.
LVNI_TOLEFT
Searches for an item to the left of the specified item.
LVNI_TORIGHT
Searches for an item to the right of the specified item.
LVNI_DIRECTIONMASK
Microsoft Windows Vista and later: A directional flag mask with value as follows: LVNI_ABOVE | LVNI_BELOW | LVNI_TOLEFT | LVNI_TORIGHT.
The state of the item to find can be specified with one or a combination of the following values:
LVNI_CUT
The item has the LVIS_CUT state flag set.
LVNI_DROPHILITED
The item has the LVIS_DROPHILITED state flag set
LVNI_FOCUSED
The item has the LVIS_FOCUSED state flag set.
LVNI_SELECTED
The item has the LVIS_SELECTED state flag set.
LVNI_STATEMASK
Microsoft Windows Vista and later: A state flag mask with value as follows: LVNI_FOCUSED | LVNI_SELECTED | LVNI_CUT | LVNI_DROPHILITED.
Searches by appearance of items or by group
LVNI_VISIBLEORDER
Microsoft Windows Vista and later: Search the visible order.
LVNI_VISIBLEONLY
Microsoft Windows Vista and later: Search the visible items.
LVNI_SAMEGROUPONLY
Microsoft Windows Vista and later: Search the current group.
If an item does not have all of the specified state flags set, the search continues with the next item.
Return Value
Remarks
Note that the following flags, for use only with Windows Vista, are mutually exclusive of any other flags in use: LVNI_VISIBLEONLY, LVNI_SAMEGROUPONLY, LVNI_VISIBLEORDER, LVNI_DIRECTIONMASK, and LVNI_STATEMASK.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95
</misc>
</message>
<message value="0x100d">
<name>LVM_FINDITEMA</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>iStart</wname>
<wmisc>iStart
The index of the item to begin the search with or -1 to start from the beginning. The specified item is itself excluded from the search.
</wmisc>
</wparam>
<lparam value="LPLVFINDINFO">
<lname>plvfi</lname>
<lmisc>plvfi
A pointer to an LVFINDINFO structure that contains information about what to search for.
</lmisc>
</lparam>
<misc>LVM_FINDITEM Message
Searches for a list-view item with the specified characteristics. You can send this message explicitly or by using the ListView_FindItem macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_FINDITEM, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iStart;
(LPARAM) lParam // = const (LPARAM) (LPLVFINDINFO) plvfi;
);
Parameters
iStart
The index of the item to begin the search with or -1 to start from the beginning. The specified item is itself excluded from the search.
plvfi
A pointer to an LVFINDINFO structure that contains information about what to search for.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1053">
<name>LVM_FINDITEMW</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>iStart</wname>
<wmisc>iStart
The index of the item to begin the search with or -1 to start from the beginning. The specified item is itself excluded from the search.
</wmisc>
</wparam>
<lparam value="LPLVFINDINFO">
<lname>plvfi</lname>
<lmisc>plvfi
A pointer to an LVFINDINFO structure that contains information about what to search for.
</lmisc>
</lparam>
<misc>LVM_FINDITEM Message
Searches for a list-view item with the specified characteristics. You can send this message explicitly or by using the ListView_FindItem macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_FINDITEM, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iStart;
(LPARAM) lParam // = const (LPARAM) (LPLVFINDINFO) plvfi;
);
Parameters
iStart
The index of the item to begin the search with or -1 to start from the beginning. The specified item is itself excluded from the search.
plvfi
A pointer to an LVFINDINFO structure that contains information about what to search for.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x100e">
<name>LVM_GETITEMRECT</name>
<return value="BOOL">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns TRUE if successful, or FALSE otherwise.</returnmisc>
</return>
<wparam value="int">
<wname>i</wname>
<wmisc>i
[in] Index of the list-view item. </wmisc>
</wparam>
<lparam value="RECT">
<lname>prc</lname>
<lmisc>prc
[in, out] Pointer to a RECT structure that receives the bounding rectangle. When the message is sent, the left member of this structure is used to specify the portion of the list-view item from which to retrieve the bounding rectangle. It must be set to one of the following values:
LVIR_BOUNDS
Returns the bounding rectangle of the entire item, including the icon and label.
LVIR_ICON
Returns the bounding rectangle of the icon or small icon.
LVIR_LABEL
Returns the bounding rectangle of the item text.
LVIR_SELECTBOUNDS
Returns the union of the LVIR_ICON and LVIR_LABEL rectangles, but excludes columns in report view.
</lmisc>
</lparam>
<misc>LVM_GETITEMRECT Message
Retrieves the bounding rectangle for all or part of an item in the current view. You can send this message explicitly or by using the ListView_GetItemRect macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETITEMRECT, // message ID
(WPARAM) wParam, // = (WPARAM) (int) i;
(LPARAM) lParam // = (LPARAM) (LPRECT) prc;
);
Parameters
i
[in] Index of the list-view item.
prc
[in, out] Pointer to a RECT structure that receives the bounding rectangle. When the message is sent, the left member of this structure is used to specify the portion of the list-view item from which to retrieve the bounding rectangle. It must be set to one of the following values:
LVIR_BOUNDS
Returns the bounding rectangle of the entire item, including the icon and label.
LVIR_ICON
Returns the bounding rectangle of the icon or small icon.
LVIR_LABEL
Returns the bounding rectangle of the item text.
LVIR_SELECTBOUNDS
Returns the union of the LVIR_ICON and LVIR_LABEL rectangles, but excludes columns in report view.
Return Value
Returns TRUE if successful, or FALSE otherwise.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x10f">
<name>LVM_SETITEMPOSITION</name>
<return value="BOOL">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns TRUE if successful, or FALSE otherwise. </returnmisc>
</return>
<wparam value="int">
<wname>i</wname>
<wmisc>i
Index of the list-view item. </wmisc>
</wparam>
<lparam value="int">
<lname>x, y</lname>
<lmisc>x
New x-position of the item's upper-left corner, in view coordinates.
y
New y-position of the item's upper-left corner, in view coordinates.
</lmisc>
</lparam>
<misc>LVM_SETITEMPOSITION Message
Moves an item to a specified position in a list-view control (must be in icon or small icon view). You can send this message explicitly or by using the ListView_SetItemPosition macro.
To send this message, call the SendMessage function as follows.
Syntax
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_SETITEMPOSITION, // message ID
(WPARAM) wParam, // = (WPARAM) (int) i
(LPARAM) lParam // = (LPARAM) MAKELPARAM ((int) x, (int) y)
);
Parameters
i
Index of the list-view item.
x
New x-position of the item's upper-left corner, in view coordinates.
y
New y-position of the item's upper-left corner, in view coordinates.
Return Value
Returns TRUE if successful, or FALSE otherwise.
Remarks
If the list-view control has the LVS_AUTOARRANGE style, the items in the list-view control are arranged after the position of the item is set.
On Windows Vista, sending this message to a list-view control with the LVS_AUTOARRANGE style does nothing, and the return value is FALSE.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1010">
<name>LVM_GETITEMPOSITION</name>
<return value="BOOL">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns TRUE if successful, or FALSE otherwise. </returnmisc>
</return>
<wparam value="int">
<wname>i</wname>
<wmisc>i
Index of the list-view item. </wmisc>
</wparam>
<lparam value="POINT">
<lname>ppt</lname>
<lmisc>ppt
Pointer to a POINT structure that receives the position of the item's upper-left corner, in view coordinates.
</lmisc>
</lparam>
<misc>LVM_GETITEMPOSITION Message
Retrieves the position of a list-view item. You can send this message explicitly or by using the ListView_GetItemPosition macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETITEMPOSITION, // message ID
(WPARAM) wParam, // = (WPARAM) (int) i;
(LPARAM) lParam // = (LPARAM) (POINT*) ppt;
);
Parameters
i
Index of the list-view item.
ppt
Pointer to a POINT structure that receives the position of the item's upper-left corner, in view coordinates.
Return Value
Returns TRUE if successful, or FALSE otherwise.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1011">
<name>LVM_GETSTRINGWIDTHA</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns the string width if successful, or zero otherwise. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPCSTR">
<lname>psz</lname>
<lmisc>psz
Pointer to a null-terminated string.
</lmisc>
</lparam>
<misc>LVM_GETSTRINGWIDTH Message
Determines the width of a specified string using the specified list-view control's current font. You can send this message explicitly or by using the ListView_GetStringWidth macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETSTRINGWIDTH, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPCSTR) psz;
);
Parameters
wParam
Must be zero.
psz
Pointer to a null-terminated string.
Return Value
Returns the string width if successful, or zero otherwise.
Remarks
The LVM_GETSTRINGWIDTH message returns the exact width, in pixels, of the specified string. If you use the returned string width as the column width in the LVM_SETCOLUMNWIDTH message, the string will be truncated. To retrieve the column width that can contain the string without truncating it, you must add padding to the returned string width.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1057">
<name>LVM_GETSTRINGWIDTHW</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns the string width if successful, or zero otherwise. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPCSTR">
<lname>psz</lname>
<lmisc>psz
Pointer to a null-terminated string.
</lmisc>
</lparam>
<misc>LVM_GETSTRINGWIDTH Message
Determines the width of a specified string using the specified list-view control's current font. You can send this message explicitly or by using the ListView_GetStringWidth macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETSTRINGWIDTH, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPCSTR) psz;
);
Parameters
wParam
Must be zero.
psz
Pointer to a null-terminated string.
Return Value
Returns the string width if successful, or zero otherwise.
Remarks
The LVM_GETSTRINGWIDTH message returns the exact width, in pixels, of the specified string. If you use the returned string width as the column width in the LVM_SETCOLUMNWIDTH message, the string will be truncated. To retrieve the column width that can contain the string without truncating it, you must add padding to the returned string width.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1012">
<name>LVM_HITTEST</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns the index of the item at the specified position, if any, or -1 otherwise.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be 0. Windows Vista. Should be -1 if the iGroup and iSubItem members of pInfo are to be retrieved.
</wmisc>
</wparam>
<lparam value="LPLVHITTESTINFO">
<lname>pinfo</lname>
<lmisc>pinfo
Pointer to an LVHITTESTINFO structure that contains the position to hit test and receives information about the results of the hit test.
</lmisc>
</lparam>
<misc>LVM_HITTEST Message
Determines which list-view item, if any, is at a specified position. You can send this message explicitly or by using the ListView_HitTest macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_HITTEST, // message ID
(WPARAM) wParam, // = (WPARAM) (WPARAM) wParam;
(LPARAM) lParam // = (LPARAM) (LPLVHITTESTINFO) pinfo;
);
Parameters
wParam
Must be 0. Windows Vista. Should be -1 if the iGroup and iSubItem members of pInfo are to be retrieved.
pinfo
Pointer to an LVHITTESTINFO structure that contains the position to hit test and receives information about the results of the hit test.
Return Value
Returns the index of the item at the specified position, if any, or -1 otherwise.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1013">
<name>LVM_ENSUREVISIBLE</name>
<return value="BOOL">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns TRUE if successful, or FALSE otherwise. </returnmisc>
</return>
<wparam value="int">
<wname>i</wname>
<wmisc>i
The index of the list-view item. </wmisc>
</wparam>
<lparam value="BOOL">
<lname>fPartialOK</lname>
<lmisc>fPartialOK
A value specifying whether the item must be entirely visible. If this parameter is TRUE, no scrolling occurs if the item is at least partially visible.
</lmisc>
</lparam>
<misc>LVM_ENSUREVISIBLE Message
Ensures that a list-view item is either entirely or partially visible, scrolling the list-view control if necessary. You can send this message explicitly or by using the ListView_EnsureVisible macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_ENSUREVISIBLE, // message ID
(WPARAM) wParam, // = (WPARAM) (int) i;
(LPARAM) lParam // = (LPARAM) (BOOL) fPartialOK;
);
Parameters
i
The index of the list-view item.
fPartialOK
A value specifying whether the item must be entirely visible. If this parameter is TRUE, no scrolling occurs if the item is at least partially visible.
Return Value
Returns TRUE if successful, or FALSE otherwise.
Remarks
The message fails if the window style includes LVS_NOSCROLL.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1014">
<name>LVM_SCROLL</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>dx</wname>
<wmisc>dx
Value of type int that specifies the amount of horizontal scrolling in pixels. If the list-view control is in list-view, this value specifies the number of columns to scroll.
</wmisc>
</wparam>
<lparam value="int">
<lname>dy</lname>
<lmisc>dy
Value of type int that specifies the amount of vertical scrolling in pixels.
</lmisc>
</lparam>
<misc>LVM_SCROLL Message
Scrolls the content of a list-view control. You can send this message explicitly or by using the ListView_Scroll macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_SCROLL, // message ID
(WPARAM) wParam, // = (WPARAM) (int) dx;
(LPARAM) lParam // = (LPARAM) (int) dy;
);
Parameters
dx
Value of type int that specifies the amount of horizontal scrolling in pixels. If the list-view control is in list-view, this value specifies the number of columns to scroll.
dy
Value of type int that specifies the amount of vertical scrolling in pixels.
Return Value
Remarks
When the list-view control is in report view, the control can only be scrolled vertically in whole line increments. Therefore, the dy parameter will be rounded to the nearest number of pixels that form a whole line increment. For example, if the height of a line is 16 pixels and 8 is passed for dy, the list will be scrolled by 16 pixels (1 line). If 7 is passed for dy, the list will be scrolled 0 pixels (0 lines).
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1015">
<name>LVM_REDRAWITEMS</name>
<return value="BOOL">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns TRUE if successful, or FALSE otherwise.</returnmisc>
</return>
<wparam value="int">
<wname>iFirst</wname>
<wmisc>iFirst
Index of the first item to redraw. </wmisc>
</wparam>
<lparam value="int">
<lname>iLast</lname>
<lmisc>iLast
Index of the last item to redraw.
</lmisc>
</lparam>
<misc>LVM_REDRAWITEMS Message
Forces a list-view control to redraw a range of items. You can send this message explicitly or by using the ListView_RedrawItems macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_REDRAWITEMS, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iFirst;
(LPARAM) lParam // = (LPARAM) (int) iLast;
);
Parameters
iFirst
Index of the first item to redraw.
iLast
Index of the last item to redraw.
Return Value
Returns TRUE if successful, or FALSE otherwise.
Remarks
The specified items are not actually redrawn until the list-view window receives a WM_PAINT message to repaint. To repaint immediately, call the UpdateWindow function after using this macro.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95
</misc>
</message>
<message value="0x1016">
<name>LVM_ARRANGE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>code</wname>
<wmisc> code
One of the following values that specifies alignment:
LVA_ALIGNLEFT
Not implemented. Apply the LVS_ALIGNLEFT style instead.
LVA_ALIGNTOP
Not implemented. Apply the LVS_ALIGNTOP style instead.
LVA_DEFAULT
Aligns items according to the list-view control's current alignment styles (the default value).
LVA_SNAPTOGRID
Snaps all icons to the nearest grid position.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>LVM_ARRANGE Message
Arranges items in icon view. You can send this message explicitly or by using the ListView_Arrange macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_ARRANGE, // message ID
(WPARAM) wParam, // = (WPARAM) (int) code;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
code
One of the following values that specifies alignment:
LVA_ALIGNLEFT
Not implemented. Apply the LVS_ALIGNLEFT style instead.
LVA_ALIGNTOP
Not implemented. Apply the LVS_ALIGNTOP style instead.
LVA_DEFAULT
Aligns items according to the list-view control's current alignment styles (the default value).
LVA_SNAPTOGRID
Snaps all icons to the nearest grid position.
lParam
Must be zero.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1017">
<name>LVM_EDITLABELA</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns the handle to the edit control that is used to edit the item text if successful, or NULL otherwise.
</returnmisc>
</return>
<wparam value="int">
<wname>iItem</wname>
<wmisc>iItem
The index of the list-view item. To cancel editing, set iItem to -1. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.
</lmisc>
</lparam>
<misc>LVM_EDITLABEL Message
Begins in-place editing of the specified list-view item's text. The message implicitly selects and focuses the specified item. You can send this message explicitly or by using the ListView_EditLabel macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_EDITLABEL, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iItem;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
iItem
The index of the list-view item. To cancel editing, set iItem to -1.
lParam
Must be zero.
Return Value
Returns the handle to the edit control that is used to edit the item text if successful, or NULL otherwise.
Remarks
When the user completes or cancels editing, the edit control is destroyed and the handle is no longer valid. You can subclass the edit control, but you should not destroy it.
The control must have the focus before you send this message to the control. Focus can be set using the SetFocus function.
If iItem is -1, an LVN_ENDLABELEDIT notification is sent.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1076">
<name>LVM_EDITLABELW</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns the handle to the edit control that is used to edit the item text if successful, or NULL otherwise.
</returnmisc>
</return>
<wparam value="int">
<wname>iItem</wname>
<wmisc>iItem
The index of the list-view item. To cancel editing, set iItem to -1. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.
</lmisc>
</lparam>
<misc>LVM_EDITLABEL Message
Begins in-place editing of the specified list-view item's text. The message implicitly selects and focuses the specified item. You can send this message explicitly or by using the ListView_EditLabel macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_EDITLABEL, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iItem;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
iItem
The index of the list-view item. To cancel editing, set iItem to -1.
lParam
Must be zero.
Return Value
Returns the handle to the edit control that is used to edit the item text if successful, or NULL otherwise.
Remarks
When the user completes or cancels editing, the edit control is destroyed and the handle is no longer valid. You can subclass the edit control, but you should not destroy it.
The control must have the focus before you send this message to the control. Focus can be set using the SetFocus function.
If iItem is -1, an LVN_ENDLABELEDIT notification is sent.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1018">
<name>LVM_GETEDITCONTROL</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.
</lmisc>
</lparam>
<misc>LVM_GETEDITCONTROL Message
Gets the handle to the edit control being used to edit a list-view item's text. You can send this message explicitly or by using the ListView_GetEditControl macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETEDITCONTROL, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Remarks
When label editing begins, an edit control is created, positioned, and initialized. Before it is displayed, the list-view control sends its parent window an LVN_BEGINLABELEDIT notification message.
To customize label editing, implement a handler for LVN_BEGINLABELEDIT and have it send an LVM_GETEDITCONTROL message to the list-view control. If a label is being edited, the return value will be a handle to the edit control. Use this handle to customize the edit control by sending the usual EM_XXX messages.
When the user completes or cancels editing, the edit control is destroyed and the handle is no longer valid. You can subclass the edit control, but you should not destroy it. To cancel editing, send the list-view control a WM_CANCELMODE message.
The list-view item being edited is the currently focused item that is, the item in the focused state. To find an item based on its state, use the LVM_GETNEXTITEM message.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1019">
<name>LVM_GETCOLUMNA</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>iCol</wname>
<wmisc>iCol
The index of the column. </wmisc>
</wparam>
<lparam value="LVCOLUMNA">
<lname>pcol</lname>
<lmisc>pcol
A pointer to an LVCOLUMN structure that specifies the information to retrieve and receives information about the column. The mask member specifies which column attributes to retrieve. If the mask member specifies the LVCF_TEXT value, the pszText member must contain the address of the buffer that receives the item text and the cchTextMax member must specify the size of the buffer.
</lmisc>
</lparam>
<misc>LVM_GETCOLUMN Message
Gets the attributes of a list-view control's column. You can send this message explicitly or by using the ListView_GetColumn macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETCOLUMN, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iCol;
(LPARAM) lParam // = (LPARAM) (LPLVCOLUMN) pcol;
);
Parameters
iCol
The index of the column.
pcol
A pointer to an LVCOLUMN structure that specifies the information to retrieve and receives information about the column. The mask member specifies which column attributes to retrieve. If the mask member specifies the LVCF_TEXT value, the pszText member must contain the address of the buffer that receives the item text and the cchTextMax member must specify the size of the buffer.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x105f">
<name>LVM_GETCOLUMNW</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>iCol</wname>
<wmisc>iCol
The index of the column. </wmisc>
</wparam>
<lparam value="LVCOLUMNW">
<lname>pcol</lname>
<lmisc>pcol
A pointer to an LVCOLUMN structure that specifies the information to retrieve and receives information about the column. The mask member specifies which column attributes to retrieve. If the mask member specifies the LVCF_TEXT value, the pszText member must contain the address of the buffer that receives the item text and the cchTextMax member must specify the size of the buffer.
</lmisc>
</lparam>
<misc>LVM_GETCOLUMN Message
Gets the attributes of a list-view control's column. You can send this message explicitly or by using the ListView_GetColumn macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETCOLUMN, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iCol;
(LPARAM) lParam // = (LPARAM) (LPLVCOLUMN) pcol;
);
Parameters
iCol
The index of the column.
pcol
A pointer to an LVCOLUMN structure that specifies the information to retrieve and receives information about the column. The mask member specifies which column attributes to retrieve. If the mask member specifies the LVCF_TEXT value, the pszText member must contain the address of the buffer that receives the item text and the cchTextMax member must specify the size of the buffer.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x101a">
<name>LVM_SETCOLUMNA</name>
<return value="BOOL">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns TRUE if successful, or FALSE otherwise.
</returnmisc>
</return>
<wparam value="int">
<wname>iCol</wname>
<wmisc>iCol
Index of the column. </wmisc>
</wparam>
<lparam value="LVCOLUMNA">
<lname>pcol</lname>
<lmisc>pcol
Pointer to an LVCOLUMN structure that contains the new column attributes. The mask member specifies which column attributes to set. If the mask member specifies the LVCF_TEXT value, the pszText member is the address of a null-terminated string and the cchTextMax member is ignored.
</lmisc>
</lparam>
<misc>LVM_SETCOLUMN Message
Sets the attributes of a list-view column. You can send this message explicitly or by using the ListView_SetColumn macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_SETCOLUMN, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iCol;
(LPARAM) lParam // = const (LPARAM) (LPLVCOLUMN) pcol;
);
Parameters
iCol
Index of the column.
pcol
Pointer to an LVCOLUMN structure that contains the new column attributes. The mask member specifies which column attributes to set. If the mask member specifies the LVCF_TEXT value, the pszText member is the address of a null-terminated string and the cchTextMax member is ignored.
Return Value
Returns TRUE if successful, or FALSE otherwise.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1060">
<name>LVM_SETCOLUMNW</name>
<return value="BOOL">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns TRUE if successful, or FALSE otherwise.
</returnmisc>
</return>
<wparam value="int">
<wname>iCol</wname>
<wmisc>iCol
Index of the column. </wmisc>
</wparam>
<lparam value="LVCOLUMNW">
<lname>pcol</lname>
<lmisc>pcol
Pointer to an LVCOLUMN structure that contains the new column attributes. The mask member specifies which column attributes to set. If the mask member specifies the LVCF_TEXT value, the pszText member is the address of a null-terminated string and the cchTextMax member is ignored.
</lmisc>
</lparam>
<misc>LVM_SETCOLUMN Message
Sets the attributes of a list-view column. You can send this message explicitly or by using the ListView_SetColumn macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_SETCOLUMN, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iCol;
(LPARAM) lParam // = const (LPARAM) (LPLVCOLUMN) pcol;
);
Parameters
iCol
Index of the column.
pcol
Pointer to an LVCOLUMN structure that contains the new column attributes. The mask member specifies which column attributes to set. If the mask member specifies the LVCF_TEXT value, the pszText member is the address of a null-terminated string and the cchTextMax member is ignored.
Return Value
Returns TRUE if successful, or FALSE otherwise.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x101b">
<name>LVM_INSERTCOLUMNA</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>iCol</wname>
<wmisc>iCol
Index of the new column. </wmisc>
</wparam>
<lparam value="LVCOLUMNA">
<lname>pcol</lname>
<lmisc> pcol
Pointer to an LVCOLUMN structure that contains the attributes of the new column.
</lmisc>
</lparam>
<misc>LVM_INSERTCOLUMN Message
Inserts a new column in a list-view control. You can send this message explicitly or by using the ListView_InsertColumn macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_INSERTCOLUMN, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iCol;
(LPARAM) lParam // = const (LPARAM) (LPLVCOLUMN) pcol;
);
Parameters
iCol
Index of the new column.
pcol
Pointer to an LVCOLUMN structure that contains the attributes of the new column.
Return Value
Remarks
Columns are visible only in report (details) view.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1061">
<name>LVM_INSERTCOLUMNW</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>iCol</wname>
<wmisc>iCol
Index of the new column. </wmisc>
</wparam>
<lparam value="LVCOLUMNW">
<lname>pcol</lname>
<lmisc> pcol
Pointer to an LVCOLUMN structure that contains the attributes of the new column.
</lmisc>
</lparam>
<misc>LVM_INSERTCOLUMN Message
Inserts a new column in a list-view control. You can send this message explicitly or by using the ListView_InsertColumn macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_INSERTCOLUMN, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iCol;
(LPARAM) lParam // = const (LPARAM) (LPLVCOLUMN) pcol;
);
Parameters
iCol
Index of the new column.
pcol
Pointer to an LVCOLUMN structure that contains the attributes of the new column.
Return Value
Remarks
Columns are visible only in report (details) view.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x101c">
<name>LVM_DELETECOLUMN</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>iCol</wname>
<wmisc>iCol
The index of the column to delete. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>LVM_DELETECOLUMN Message
Removes a column from a list-view control. You can send this message explicitly or by using the ListView_DeleteColumn macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_DELETECOLUMN, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iCol;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
iCol
The index of the column to delete.
lParam
Must be zero.
Return Value
Remarks
Column zero of the list-view control cannot be deleted. If you must delete column zero, insert a zero length dummy column zero and delete column one and above.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x101d">
<name>LVM_GETCOLUMNWIDTH</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns the column width if successful, or zero otherwise. If this message is sent to a list-view control with the LVS_REPORT style and the specified column doesn't exist, the return value is undefined.
</returnmisc>
</return>
<wparam value="int">
<wname>iCol</wname>
<wmisc>iCol
The index of the column. This parameter is ignored in list view. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>LVM_GETCOLUMNWIDTH Message
Gets the width of a column in report or list view. You can send this message explicitly or by using the ListView_GetColumnWidth macro.
Syntax
To send this message, call the SendMessage function as follows.
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETCOLUMNWIDTH, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iCol;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
iCol
The index of the column. This parameter is ignored in list view.
lParam
Must be zero.
Return Value
Returns the column width if successful, or zero otherwise. If this message is sent to a list-view control with the LVS_REPORT style and the specified column doesn't exist, the return value is undefined.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x101e">
<name>LVM_SETCOLUMNWIDTH</name>
<return value="BOOL">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns TRUE if successful, or FALSE otherwise. </returnmisc>
</return>
<wparam value="">
<wname>iCol</wname>
<wmisc>iCol
Zero-based index of a valid column. For list-view mode, this parameter must be set to zero.
</wmisc>
</wparam>
<lparam value="">
<lname>cx</lname>
<lmisc>cx
New width of the column, in pixels. For report-view mode, the following special values are supported:
LVSCW_AUTOSIZE
Automatically sizes the column.
LVSCW_AUTOSIZE_USEHEADER
Automatically sizes the column to fit the header text. If you use this value with the last column, its width is set to fill the remaining width of the list-view control.
</lmisc>
</lparam>
<misc>LVM_SETCOLUMNWIDTH Message
Changes the width of a column in report-view mode or the width of all columns in list-view mode. You can send this message explicitly or use the ListView_SetColumnWidth macro.
To send this message, call the SendMessage function as follows.
Syntax
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_SETCOLUMNWIDTH, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iCol
(LPARAM) lParam // = (LPARAM) MAKELPARAM ((int) cx, 0)
);
Parameters
iCol
Zero-based index of a valid column. For list-view mode, this parameter must be set to zero.
cx
New width of the column, in pixels. For report-view mode, the following special values are supported:
LVSCW_AUTOSIZE
Automatically sizes the column.
LVSCW_AUTOSIZE_USEHEADER
Automatically sizes the column to fit the header text. If you use this value with the last column, its width is set to fill the remaining width of the list-view control.
Return Value
Returns TRUE if successful, or FALSE otherwise.
Remarks
Assume that you have a 2-column list-view control with a width of 500 pixels. If the width of column zero is set to 200 pixels, and you send this message with wParam = 1 and lParam = LVSCW_AUTOSIZE_USEHEADER, the second (and last) column will be 300 pixels wide.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x101f">
<name>LVM_GETHEADER</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>LVM_GETHEADER Message
Gets the handle to the header control used by the list-view control. You can send this message explicitly or use the ListView_GetHeader macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETHEADER, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x1021">
<name>LVM_CREATEDRAGIMAGE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>iItem</wname>
<wmisc>iItem
The index of the item. </wmisc>
</wparam>
<lparam value="LPPOINT">
<lname>lpptUpLeft</lname>
<lmisc>lpptUpLeft
A pointer to a POINT structure that receives the initial location of the upper-left corner of the image, in view coordinates.
</lmisc>
</lparam>
<misc>LVM_CREATEDRAGIMAGE Message
Creates a drag image list for the specified item. You can send this message explicitly or by using the ListView_CreateDragImage macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_CREATEDRAGIMAGE, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iItem;
(LPARAM) lParam // = (LPARAM) (LPPOINT) lpptUpLeft;
);
Parameters
iItem
The index of the item.
lpptUpLeft
A pointer to a POINT structure that receives the initial location of the upper-left corner of the image, in view coordinates.
Return Value
Remarks
Your application is responsible for destroying the image list when it is no longer needed.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1022">
<name>LVM_GETVIEWRECT</name>
<return value="BOOL">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns TRUE if successful, or FALSE otherwise. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="RECT">
<lname>prc</lname>
<lmisc>prc
Pointer to a RECT structure that receives the bounding rectangle. All coordinates are relative to the visible area of the list-view control.
</lmisc>
</lparam>
<misc>LVM_GETVIEWRECT Message
Retrieves the bounding rectangle of all items in the list-view control. The list view must be in icon or small icon view. You can send this message explicitly or by using the ListView_GetViewRect macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETVIEWRECT, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (RECT*) prc;
);
Parameters
wParam
Must be zero.
prc
Pointer to a RECT structure that receives the bounding rectangle. All coordinates are relative to the visible area of the list-view control.
Return Value
Returns TRUE if successful, or FALSE otherwise.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1023">
<name>LVM_GETTEXTCOLOR</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>LVM_GETTEXTCOLOR Message
Retrieves the text color of a list-view control. You can send this message explicitly or by using the ListView_GetTextColor macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETTEXTCOLOR, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1024">
<name>LVM_SETTEXTCOLOR</name>
<return value="BOOL">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns TRUE if successful, or FALSE otherwise. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="COLORREF">
<lname>clrText</lname>
<lmisc>clrText
New text color.
</lmisc>
</lparam>
<misc>LVM_SETTEXTCOLOR Message
Sets the text color of a list-view control. You can send this message explicitly or by using the ListView_SetTextColor macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_SETTEXTCOLOR, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (COLORREF) clrText;
);
Parameters
wParam
Must be zero.
clrText
New text color.
Return Value
Returns TRUE if successful, or FALSE otherwise.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1025">
<name>LVM_GETTEXTBKCOLOR</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns the background color of the text. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>LVM_GETTEXTBKCOLOR Message
Retrieves the text background color of a list-view control. You can send this message explicitly or by using the ListView_GetTextBkColor macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETTEXTBKCOLOR, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Returns the background color of the text.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1026">
<name>LVM_SETTEXTBKCOLOR</name>
<return value="BOOL">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns TRUE if successful, or FALSE otherwise. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="COLORREF">
<lname>clrText</lname>
<lmisc>clrText
New text background color. This can be CLR_NONE for no background color.</lmisc>
</lparam>
<misc>LVM_SETTEXTBKCOLOR Message
Sets the background color of text in a list-view control. You can send this message explicitly or by using the ListView_SetTextBkColor macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_SETTEXTBKCOLOR, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (COLORREF) clrText;
);
Parameters
wParam
Must be zero.
clrText
New text background color. This can be CLR_NONE for no background color.
Return Value
Returns TRUE if successful, or FALSE otherwise.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1027">
<name>LVM_GETTOPINDEX</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns the index of the item if successful, or zero if the list-view control is in icon or small icon view.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.
</lmisc>
</lparam>
<misc>LVM_GETTOPINDEX Message
Retrieves the index of the topmost visible item when in list or report view. You can send this message explicitly or by using the ListView_GetTopIndex macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETTOPINDEX, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Returns the index of the item if successful, or zero if the list-view control is in icon or small icon view.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1028">
<name>LVM_GETCOUNTPERPAGE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>LVM_GETCOUNTPERPAGE Message
Calculates the number of items that can fit vertically in the visible area of a list-view control when in list or report view. Only fully visible items are counted. You can send this message explicitly or by using the ListView_GetCountPerPage macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETCOUNTPERPAGE, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1029">
<name>LVM_GETCOUNTPERPAGE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>LVM_GETCOUNTPERPAGE Message
Calculates the number of items that can fit vertically in the visible area of a list-view control when in list or report view. Only fully visible items are counted. You can send this message explicitly or by using the ListView_GetCountPerPage macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETCOUNTPERPAGE, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x102a">
<name>LVM_UPDATE</name>
<return value="BOOL">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns TRUE if successful, or FALSE otherwise. </returnmisc>
</return>
<wparam value="int">
<wname>iItem</wname>
<wmisc>iItem
Index of the item to update. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>LVM_UPDATE Message
Updates a list-view item. If the list-view control has the LVS_AUTOARRANGE style, this macro causes the list-view control to be arranged. You can send this message explicitly or by using the ListView_Update macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_UPDATE, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iItem;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
iItem
Index of the item to update.
lParam
Must be zero.
Return Value
Returns TRUE if successful, or FALSE otherwise.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x102b">
<name>LVM_SETITEMSTATE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
If you send this message explicitly, it returns TRUE if successful or FALSE otherwise. </returnmisc>
</return>
<wparam value="int">
<wname>i</wname>
<wmisc> i
Index of the list-view item. If this parameter is -1, then the state change is applied to all items.
</wmisc>
</wparam>
<lparam value="LPLVITEM">
<lname>pitem</lname>
<lmisc>pitem
Pointer to an LVITEM structure. The stateMask member specifies which state bits to change, and the state member contains the new values for those bits. The other members are ignored.
</lmisc>
</lparam>
<misc>LVM_SETITEMSTATE Message
Changes the state of an item in a list-view control. You can send this message explicitly or by using the ListView_SetItemState macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_SETITEMSTATE, // message ID
(WPARAM) wParam, // = (WPARAM) (int) i;
(LPARAM) lParam // = (LPARAM) (LPLVITEM) pitem;
);
Parameters
i
Index of the list-view item. If this parameter is -1, then the state change is applied to all items.
pitem
Pointer to an LVITEM structure. The stateMask member specifies which state bits to change, and the state member contains the new values for those bits. The other members are ignored.
Return Value
If you send this message explicitly, it returns TRUE if successful or FALSE otherwise.
Remarks
An item's state value includes a set of bit flags that indicate the item's state. The state value can also include image list indexes that indicate the item's state image and overlay image.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x102c">
<name>LVM_GETITEMSTATE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns the current state for the specified item. The only valid bits in the return value are those that correspond to the bits set in the mask parameter.
</returnmisc>
</return>
<wparam value="int">
<wname>i</wname>
<wmisc> i
Index of the list-view item. </wmisc>
</wparam>
<lparam value="UINT">
<lname>mask</lname>
<lmisc>mask
State information to retrieve. This parameter can be a combination of the following values:
LVIS_CUT
The item is marked for a cut-and-paste operation.
LVIS_DROPHILITED
The item is highlighted as a drag-and-drop target.
LVIS_FOCUSED
The item has the focus, so it is surrounded by a standard focus rectangle. Although more than one item may be selected, only one item can have the focus.
LVIS_SELECTED
The item is selected. The appearance of a selected item depends on whether it has the focus and also on the system colors used for selection.
LVIS_OVERLAYMASK
Use this mask to retrieve the item's overlay image index.
LVIS_STATEIMAGEMASK
Use this mask to retrieve the item's state image index.
</lmisc>
</lparam>
<misc>LVM_GETITEMSTATE Message
Retrieves the state of a list-view item. You can send this message explicitly or by using the ListView_GetItemState macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETITEMSTATE, // message ID
(WPARAM) wParam, // = (WPARAM) (int) i;
(LPARAM) lParam // = (LPARAM) (UINT) mask;
);
Parameters
i
Index of the list-view item.
mask
State information to retrieve. This parameter can be a combination of the following values:
LVIS_CUT
The item is marked for a cut-and-paste operation.
LVIS_DROPHILITED
The item is highlighted as a drag-and-drop target.
LVIS_FOCUSED
The item has the focus, so it is surrounded by a standard focus rectangle. Although more than one item may be selected, only one item can have the focus.
LVIS_SELECTED
The item is selected. The appearance of a selected item depends on whether it has the focus and also on the system colors used for selection.
LVIS_OVERLAYMASK
Use this mask to retrieve the item's overlay image index.
LVIS_STATEIMAGEMASK
Use this mask to retrieve the item's state image index.
Return Value
Returns the current state for the specified item. The only valid bits in the return value are those that correspond to the bits set in the mask parameter.
Remarks
An item's state information includes a set of bit flags as well as image list indexes that indicate the item's state image and overlay image.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x102d">
<name>LVM_GETITEMTEXTA</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
If you send this message explicitly, it returns the number of characters in the pszText member of the LVITEM structure.
</returnmisc>
</return>
<wparam value="int">
<wname>iItem</wname>
<wmisc>iItem
Index of the list-view item. </wmisc>
</wparam>
<lparam value="LPLVITEM">
<lname>pitem</lname>
<lmisc>pitem
Pointer to an LVITEM structure. To retrieve the item text, set iSubItem to zero. To retrieve the text of a subitem, set iSubItem to the subitem's index. The pszText member points to a buffer that receives the text. The cchTextMax member specifies the number of characters in the buffer.
</lmisc>
</lparam>
<misc>LVM_GETITEMTEXT Message
Retrieves the text of a list-view item or subitem. You can send this message explicitly or by using the ListView_GetItemText macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETITEMTEXT, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iItem;
(LPARAM) lParam // = (LPARAM) (LPLVITEM) pitem;
);
Parameters
iItem
Index of the list-view item.
pitem
Pointer to an LVITEM structure. To retrieve the item text, set iSubItem to zero. To retrieve the text of a subitem, set iSubItem to the subitem's index. The pszText member points to a buffer that receives the text. The cchTextMax member specifies the number of characters in the buffer.
Return Value
If you send this message explicitly, it returns the number of characters in the pszText member of the LVITEM structure.
Remarks
You can also send this message by calling the ListView_GetItemText macro. However, this macro does not return the string length.
LVM_GETITEMTEXT is not supported under the LVS_OWNERDATA style.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1073">
<name>LVM_GETITEMTEXTW</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
If you send this message explicitly, it returns the number of characters in the pszText member of the LVITEM structure.
</returnmisc>
</return>
<wparam value="int">
<wname>iItem</wname>
<wmisc>iItem
Index of the list-view item. </wmisc>
</wparam>
<lparam value="LPLVITEM">
<lname>pitem</lname>
<lmisc>pitem
Pointer to an LVITEM structure. To retrieve the item text, set iSubItem to zero. To retrieve the text of a subitem, set iSubItem to the subitem's index. The pszText member points to a buffer that receives the text. The cchTextMax member specifies the number of characters in the buffer.
</lmisc>
</lparam>
<misc>LVM_GETITEMTEXT Message
Retrieves the text of a list-view item or subitem. You can send this message explicitly or by using the ListView_GetItemText macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETITEMTEXT, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iItem;
(LPARAM) lParam // = (LPARAM) (LPLVITEM) pitem;
);
Parameters
iItem
Index of the list-view item.
pitem
Pointer to an LVITEM structure. To retrieve the item text, set iSubItem to zero. To retrieve the text of a subitem, set iSubItem to the subitem's index. The pszText member points to a buffer that receives the text. The cchTextMax member specifies the number of characters in the buffer.
Return Value
If you send this message explicitly, it returns the number of characters in the pszText member of the LVITEM structure.
Remarks
You can also send this message by calling the ListView_GetItemText macro. However, this macro does not return the string length.
LVM_GETITEMTEXT is not supported under the LVS_OWNERDATA style.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x102e">
<name>LVM_SETITEMTEXTA</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>i</wname>
<wmisc>i
Index of the list-view item. </wmisc>
</wparam>
<lparam value="LPLVITEM">
<lname>pitem</lname>
<lmisc>pitem
Pointer to an LVITEM structure. The iSubItem member is the index of the subitem, or it can be zero to set the item label. The pszText member is the address of a null-terminated string containing the new text; it can also be NULL. The pszText member can also be LPSTR_TEXTCALLBACK to indicate a callback item for which the parent window stores the text. In this case, the list-view control sends the parent an LVN_GETDISPINFO notification message when it needs the text.
</lmisc>
</lparam>
<misc>LVM_SETITEMTEXT Message
Changes the text of a list-view item or subitem. You can send this message explicitly or by using the ListView_SetItemText macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_SETITEMTEXT, // message ID
(WPARAM) wParam, // = (WPARAM) (int) i;
(LPARAM) lParam // = (LPARAM) (LPLVITEM) pitem;
);
Parameters
i
Index of the list-view item.
pitem
Pointer to an LVITEM structure. The iSubItem member is the index of the subitem, or it can be zero to set the item label. The pszText member is the address of a null-terminated string containing the new text; it can also be NULL. The pszText member can also be LPSTR_TEXTCALLBACK to indicate a callback item for which the parent window stores the text. In this case, the list-view control sends the parent an LVN_GETDISPINFO notification message when it needs the text.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1074">
<name>LVM_SETITEMTEXTW</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>i</wname>
<wmisc>i
Index of the list-view item. </wmisc>
</wparam>
<lparam value="LPLVITEM">
<lname>pitem</lname>
<lmisc>pitem
Pointer to an LVITEM structure. The iSubItem member is the index of the subitem, or it can be zero to set the item label. The pszText member is the address of a null-terminated string containing the new text; it can also be NULL. The pszText member can also be LPSTR_TEXTCALLBACK to indicate a callback item for which the parent window stores the text. In this case, the list-view control sends the parent an LVN_GETDISPINFO notification message when it needs the text.
</lmisc>
</lparam>
<misc>LVM_SETITEMTEXT Message
Changes the text of a list-view item or subitem. You can send this message explicitly or by using the ListView_SetItemText macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_SETITEMTEXT, // message ID
(WPARAM) wParam, // = (WPARAM) (int) i;
(LPARAM) lParam // = (LPARAM) (LPLVITEM) pitem;
);
Parameters
i
Index of the list-view item.
pitem
Pointer to an LVITEM structure. The iSubItem member is the index of the subitem, or it can be zero to set the item label. The pszText member is the address of a null-terminated string containing the new text; it can also be NULL. The pszText member can also be LPSTR_TEXTCALLBACK to indicate a callback item for which the parent window stores the text. In this case, the list-view control sends the parent an LVN_GETDISPINFO notification message when it needs the text.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x102f">
<name>LVM_SETITEMCOUNT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns nonzero if successful, or zero otherwise. </returnmisc>
</return>
<wparam value="int">
<wname>cItems</wname>
<wmisc>cItems
Number of items that the list-view control will ultimately contain.</wmisc>
</wparam>
<lparam value="DWORD">
<lname>dwFlags</lname>
<lmisc>dwFlags
Version 4.70. Values that specify the behavior of the list-view control after resetting the item count. This value can be a combination of the following:
LVSICF_NOINVALIDATEALL
The list-view control will not repaint unless affected items are currently in view.
LVSICF_NOSCROLL
The list-view control will not change the scroll position when the item count changes.
</lmisc>
</lparam>
<misc>LVM_SETITEMCOUNT Message
Causes the list-view control to allocate memory for the specified number of items or sets the virtual number of items in a virtual list-view control. This depends on how the list-view control was created. You can send this message explicitly or use the ListView_SetItemCount or ListView_SetItemCountEx macros.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_SETITEMCOUNT, // message ID
(WPARAM) wParam, // = (WPARAM) (int) cItems;
(LPARAM) lParam // = (LPARAM) (DWORD) dwFlags;
);
Parameters
cItems
Number of items that the list-view control will ultimately contain.
dwFlags
Version 4.70. Values that specify the behavior of the list-view control after resetting the item count. This value can be a combination of the following:
LVSICF_NOINVALIDATEALL
The list-view control will not repaint unless affected items are currently in view.
LVSICF_NOSCROLL
The list-view control will not change the scroll position when the item count changes.
Return Value
Returns nonzero if successful, or zero otherwise.
Remarks
If the list-view control was created without the LVS_OWNERDATA style, sending this message causes the control to allocate its internal data structures for the specified number of items. This prevents the control from having to allocate the data structures every time an item is added.
If the list-view control was created with the LVS_OWNERDATA style (a virtual list view), sending this message sets the virtual number of items that the control contains.
The dwFlags parameter is intended only for list-view controls that use the LVS_OWNERDATA and LVS_REPORT or LVS_LIST styles.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1030">
<name>LVM_SORTITEMS</name>
<return value="BOOL">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns TRUE if successful, or FALSE otherwise. </returnmisc>
</return>
<wparam value="">
<wname>lParamSort</wname>
<wmisc>lParamSort
Application-defined value that is passed to the comparison function. </wmisc>
</wparam>
<lparam value="PFNLVCOMPARE">
<lname>pfnCompare</lname>
<lmisc>pfnCompare
Pointer to the application-defined comparison function. The comparison function is called during the sort operation each time the relative order of two list items needs to be compared.
</lmisc>
</lparam>
<misc>LVM_SORTITEMS Message
Uses an application-defined comparison function to sort the items of a list-view control. The index of each item changes to reflect the new sequence. You can send this message explicitly or by using the ListView_SortItems macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_SORTITEMS, // message ID
(WPARAM) wParam, // = (WPARAM) (LPARAM) lParamSort;
(LPARAM) lParam // = (LPARAM) (PFNLVCOMPARE) pfnCompare;
);
Parameters
lParamSort
Application-defined value that is passed to the comparison function.
pfnCompare
Pointer to the application-defined comparison function. The comparison function is called during the sort operation each time the relative order of two list items needs to be compared.
Return Value
Returns TRUE if successful, or FALSE otherwise.
Remarks
The comparison function has the following form:
Copy Code
int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2,
LPARAM lParamSort);
The lParam1 parameter is the value associated with the first item being compared, and the lParam2 parameter is the value associated with the second item. These are the values that were specified in the lParam member of the items' LVITEM structure when they were inserted into the list. The ListView_SortItems's lParamSort parameter is passed to the callback function as its third parameter.
The comparison function must return a negative value if the first item should precede the second, a positive value if the first item should follow the second, or zero if the two items are equivalent.
Note During the sorting process, the list-view contents are unstable. If the callback function sends any messages to the list-view control aside from LVM_GETITEM (ListView_GetItem), the results are unpredictable.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1031">
<name>LVM_SETITEMPOSITION32</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
No return value.
</returnmisc>
</return>
<wparam value="int">
<wname>iItem</wname>
<wmisc>iItem
Index of the list-view item for which to set the position. </wmisc>
</wparam>
<lparam value="LPPOINT">
<lname>lpptNewPos</lname>
<lmisc>lpptNewPos
Pointer to a POINT structure that contains the new position of the item, in list-view coordinates.
</lmisc>
</lparam>
<misc>LVM_SETITEMPOSITION32 Message
Moves an item to a specified position in a list-view control (must be in icon or small icon view). This message differs from the LVM_SETITEMPOSITION message in that it uses 32-bit coordinates. You can send this message explicitly or by using the ListView_SetItemPosition32 macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_SETITEMPOSITION32, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iItem;
(LPARAM) lParam // = (LPARAM) (LPPOINT) lpptNewPos;
);
Parameters
iItem
Index of the list-view item for which to set the position.
lpptNewPos
Pointer to a POINT structure that contains the new position of the item, in list-view coordinates.
Return Value
No return value.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1032">
<name>LVM_GETSELECTEDCOUNT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns the number of selected items. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc> lParam
Must be zero.
</lmisc>
</lparam>
<misc>LVM_GETSELECTEDCOUNT Message
Determines the number of selected items in a list-view control. You can send this message explicitly or by using the ListView_GetSelectedCount macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETSELECTEDCOUNT, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Returns the number of selected items.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1033">
<name>LVM_GETITEMSPACING</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns the amount of spacing between items. The horizontal spacing is contained in the low-order WORD and the vertical spacing is contained in the high-order WORD.
</returnmisc>
</return>
<wparam value="BOOL">
<wname>fSmall</wname>
<wmisc>fSmall
View for which to retrieve the item spacing. This parameter is TRUE for small icon view, or FALSE for icon view.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>LVM_GETITEMSPACING Message
Determines the spacing between items in a list-view control. You can send this message explicitly or by using the ListView_GetItemSpacing macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETITEMSPACING, // message ID
(WPARAM) wParam, // = (WPARAM) (BOOL) fSmall;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
fSmall
View for which to retrieve the item spacing. This parameter is TRUE for small icon view, or FALSE for icon view.
lParam
Must be zero.
Return Value
Returns the amount of spacing between items. The horizontal spacing is contained in the low-order WORD and the vertical spacing is contained in the high-order WORD.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1034">
<name>LVM_GETISEARCHSTRINGA</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPSTR">
<lname>lpsz</lname>
<lmisc>lpsz
Pointer to a buffer that receives the incremental search string. To just retrieve the length of the string, set lpsz to NULL.
</lmisc>
</lparam>
<misc>LVM_GETISEARCHSTRING Message
Retrieves the incremental search string of a list-view control. You can send this message explicitly or by using the ListView_GetISearchString macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETISEARCHSTRING, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPSTR) lpsz;
);
Parameters
wParam
Must be zero.
lpsz
Pointer to a buffer that receives the incremental search string. To just retrieve the length of the string, set lpsz to NULL.
Return Value
Remarks
security note Security Alert Using this message incorrectly might compromise the security of your program. This message does not provide a way for you to know the size of the buffer. If you use this message, first call the message passing NULL in the lParam, this returns the number of characters, excluding NULL that are required. Then call the message a second time to retrieve the string. You should review the Security Considerations: Microsoft Windows Controls before continuing.
The incremental search string is the character sequence that the user types while the list view has the input focus. Each time the user types a character, the system appends the character to the search string and then searches for a matching item. If the system finds a match, it selects the item and, if necessary, scrolls it into view.
A time-out period is associated with each character that the user types. If the time-out period elapses before the user types another character, the incremental search string is reset.
Make sure that the buffer is large enough to hold the string and the terminating NULL character. If it is too small, an immediate invalid page fault will result.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1075">
<name>LVM_GETISEARCHSTRINGW</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPSTR">
<lname>lpsz</lname>
<lmisc>lpsz
Pointer to a buffer that receives the incremental search string. To just retrieve the length of the string, set lpsz to NULL.
</lmisc>
</lparam>
<misc>LVM_GETISEARCHSTRING Message
Retrieves the incremental search string of a list-view control. You can send this message explicitly or by using the ListView_GetISearchString macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETISEARCHSTRING, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPSTR) lpsz;
);
Parameters
wParam
Must be zero.
lpsz
Pointer to a buffer that receives the incremental search string. To just retrieve the length of the string, set lpsz to NULL.
Return Value
Remarks
security note Security Alert Using this message incorrectly might compromise the security of your program. This message does not provide a way for you to know the size of the buffer. If you use this message, first call the message passing NULL in the lParam, this returns the number of characters, excluding NULL that are required. Then call the message a second time to retrieve the string. You should review the Security Considerations: Microsoft Windows Controls before continuing.
The incremental search string is the character sequence that the user types while the list view has the input focus. Each time the user types a character, the system appends the character to the search string and then searches for a matching item. If the system finds a match, it selects the item and, if necessary, scrolls it into view.
A time-out period is associated with each character that the user types. If the time-out period elapses before the user types another character, the incremental search string is reset.
Make sure that the buffer is large enough to hold the string and the terminating NULL character. If it is too small, an immediate invalid page fault will result.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1035">
<name>LVM_SETICONSPACING</name>
<return value="DWORD">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns a DWORD value that contains the previous cx in the low word and the previous cy in the high word.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>cx, cy</lname>
<lmisc>cx
Distance, in pixels, to set between icons on the x-axis. See Remarks.
cy
Distance, in pixels, to set between icons on the y-axis. See Remarks. </lmisc>
</lparam>
<misc>LVM_SETICONSPACING Message
Sets the spacing between icons in list-view controls that have the LVS_ICON style. You can send this message explicitly or by using the ListView_SetIconSpacing macro.
To send this message, call the SendMessage function as follows.
Syntax
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_SETICONSPACING, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) MAKELONG(cx, cy)
);
Parameters
cx
Distance, in pixels, to set between icons on the x-axis. See Remarks.
cy
Distance, in pixels, to set between icons on the y-axis. See Remarks.
Return Value
Returns a DWORD value that contains the previous cx in the low word and the previous cy in the high word.
Remarks
Values for cx and cy are relative to the upper-left corner of an icon bitmap. Therefore, to set spacing between icons that do not overlap, the cx or cy values must include the size of the icon, plus the amount of empty space desired between icons. Values that do not include the width of the icon will result in overlaps.
When defining the icon spacing, cx and cy must set to 4 or larger. Smaller values will not yield the desired layout. To reset cx and cy to the default spacing, set the lParam value to -1.
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0
</misc>
</message>
<message value="0x1036">
<name>LVM_SETEXTENDEDLISTVIEWSTYLE</name>
<return value="DWORD">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns a DWORD value that contains the previous extended list-view control styles.
</returnmisc>
</return>
<wparam value="DWORD">
<wname>dwExMask</wname>
<wmisc> dwExMask
DWORD value that specifies which styles in dwExStyle are to be affected. This parameter can be a combination of Extended List-View Styles. Only the extended styles in dwExMask will be changed. All other styles will be maintained as they are. If this parameter is zero, all of the styles in dwExStyle will be affected.
</wmisc>
</wparam>
<lparam value="DWORD">
<lname>dwExStyle</lname>
<lmisc>dwExStyle
DWORD value that specifies the extended list-view control styles to set. This parameter can be a combination of Extended List-View Styles. Styles that are not set, but that are specified in dwExMask, are removed.
</lmisc>
</lparam>
<misc>LVM_SETEXTENDEDLISTVIEWSTYLE Message
Sets extended styles in list-view controls. You can send this message explicitly or use the ListView_SetExtendedListViewStyle or ListView_SetExtendedListViewStyleEx macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_SETEXTENDEDLISTVIEWSTYLE, // message ID
(WPARAM) wParam, // = (WPARAM) (DWORD) dwExMask;
(LPARAM) lParam // = (LPARAM) (DWORD) dwExStyle;
);
Parameters
dwExMask
DWORD value that specifies which styles in dwExStyle are to be affected. This parameter can be a combination of Extended List-View Styles. Only the extended styles in dwExMask will be changed. All other styles will be maintained as they are. If this parameter is zero, all of the styles in dwExStyle will be affected.
dwExStyle
DWORD value that specifies the extended list-view control styles to set. This parameter can be a combination of Extended List-View Styles. Styles that are not set, but that are specified in dwExMask, are removed.
Return Value
Returns a DWORD value that contains the previous extended list-view control styles.
Remarks
The dwExMask parameter allows you to modify one or more extended styles without having to retrieve the existing styles first. For example, if you pass LVS_EX_FULLROWSELECT for dwExMask and 0 for dwExStyle, the LVS_EX_FULLROWSELECT style will be cleared but all other styles will remain the same.
For backward compatibility reasons, the ListView_SetExtendedListViewStyle macro has not been updated to use dwExMask. To use the dwExMask value, use the ListView_SetExtendedListViewStyleEx macro.
When you use this message to set the LVS_EX_CHECKBOXES style, any previously set state image index will be discarded. All check boxes will be initialized to the unchecked state. The state image index is contained in bits 12 through 15 of the state member of the LVITEM structure.
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x1037">
<name>LVM_GETEXTENDEDLISTVIEWSTYLE</name>
<return value="DWORD">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns a DWORD that represents the styles currently in use for a given list-view control. This value can be a combination of Extended List-View Styles.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>LVM_GETEXTENDEDLISTVIEWSTYLE Message
Gets the extended styles that are currently in use for a given list-view control. You can send this message explicitly or use the ListView_GetExtendedListViewStyle macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETEXTENDEDLISTVIEWSTYLE, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Returns a DWORD that represents the styles currently in use for a given list-view control. This value can be a combination of Extended List-View Styles.
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x1038">
<name>LVM_GETSUBITEMRECT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns nonzero if successful, or zero otherwise.
</returnmisc>
</return>
<wparam value="int">
<wname>iItem</wname>
<wmisc>iItem
Index of the subitem's parent item. </wmisc>
</wparam>
<lparam value="RECT">
<lname>lpRect</lname>
<lmisc>lpRect
Pointer to a RECT structure that will receive the subitem bounding rectangle information. Its members must be initialized according to the following member/value relationships:
top
The one-based index of the subitem.
left
Flag value (see remarks). Indicates the portion of the list-view subitem for which to retrieve the bounding rectangle.
</lmisc>
</lparam>
<misc>LVM_GETSUBITEMRECT Message
Retrieves information about the bounding rectangle for a subitem in a list-view control. You can send this message explicitly or by using the ListView_GetSubItemRect macro (recommended). This message is intended to be used only with list-view controls that use the LVS_REPORT style.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETSUBITEMRECT, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iItem;
(LPARAM) lParam // = (LPARAM) (LPRECT) lpRect;
);
Parameters
iItem
Index of the subitem's parent item.
lpRect
Pointer to a RECT structure that will receive the subitem bounding rectangle information. Its members must be initialized according to the following member/value relationships:
top
The one-based index of the subitem.
left
Flag value (see remarks). Indicates the portion of the list-view subitem for which to retrieve the bounding rectangle.
Return Value
Returns nonzero if successful, or zero otherwise.
Remarks
Following are the flag values that may be set.
Flag Value Meaning
LVIR_BOUNDS Returns the bounding rectangle of the entire item, including the icon and label.
LVIR_ICON Returns the bounding rectangle of the icon or small icon.
LVIR_LABEL Returns the bounding rectangle of the entire item, including the icon and label. This is identical to LVIR_BOUNDS.
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x1039">
<name>LVM_SUBITEMHITTEST</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns the index of the item or subitem tested, if any, or -1 otherwise. If an item or subitem is at the given coordinates, the fields of the LVHITTESTINFO structure will be filled with the applicable hit information.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc> wParam
Must be 0. Windows Vista. Should be -1 if the iGroup member of pInfo is to be retrieved.
</wmisc>
</wparam>
<lparam value="LVHITTESTINFO">
<lname>pInfo</lname>
<lmisc>pInfo
Pointer to an LVHITTESTINFO structure. The POINT structure within LVHITTESTINFO should be set to the client coordinates to be hit-tested.
</lmisc>
</lparam>
<misc>LVM_SUBITEMHITTEST Message
Determines which list-view item or subitem is at a given position. You can send this message explicitly or by using the ListView_SubItemHitTest macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_SUBITEMHITTEST, // message ID
(WPARAM) wParam, // = (WPARAM) (WPARAM) wParam;
(LPARAM) lParam // = (LPARAM) (LVHITTESTINFO) pInfo;
);
Parameters
wParam
Must be 0. Windows Vista. Should be -1 if the iGroup member of pInfo is to be retrieved.
pInfo
Pointer to an LVHITTESTINFO structure. The POINT structure within LVHITTESTINFO should be set to the client coordinates to be hit-tested.
Return Value
Returns the index of the item or subitem tested, if any, or -1 otherwise. If an item or subitem is at the given coordinates, the fields of the LVHITTESTINFO structure will be filled with the applicable hit information.
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x103a">
<name>LVM_SETCOLUMNORDERARRAY</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns nonzero if successful, or zero otherwise. </returnmisc>
</return>
<wparam value="int">
<wname>iCount</wname>
<wmisc>iCount
Size, in elements, of the buffer at lpiArray. </wmisc>
</wparam>
<lparam value="LPINT">
<lname>lpiArray</lname>
<lmisc>lpiArray
Pointer to an array that specifies the order in which columns should be displayed, from left to right. For example, if the contents of the array are {2,0,1}, the control displays column 2, column 0, and column 1 in that order.
</lmisc>
</lparam>
<misc>LVM_SETCOLUMNORDERARRAY Message
Sets the left-to-right order of columns in a list-view control. You can send this message explicitly or use the ListView_SetColumnOrderArray macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_SETCOLUMNORDERARRAY, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iCount;
(LPARAM) lParam // = (LPARAM) (LPINT) lpiArray;
);
Parameters
iCount
Size, in elements, of the buffer at lpiArray.
lpiArray
Pointer to an array that specifies the order in which columns should be displayed, from left to right. For example, if the contents of the array are {2,0,1}, the control displays column 2, column 0, and column 1 in that order.
Return Value
Returns nonzero if successful, or zero otherwise.
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x103b">
<name>LVM_GETCOLUMNORDERARRAY</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
If successful, returns nonzero, and the buffer at lpiArray receives the column index of each column in the control in the order they appear from left to right. Otherwise, the return value is zero.
</returnmisc>
</return>
<wparam value="int">
<wname>iCount</wname>
<wmisc>iCount
The number of columns in the list-view control.</wmisc>
</wparam>
<lparam value="LPINT">
<lname>lpiArray</lname>
<lmisc>lpiArray
A pointer to an array of integers that receives the index values of the columns in the list-view control. The array must be large enough to hold iCount elements.
</lmisc>
</lparam>
<misc>LVM_GETCOLUMNORDERARRAY Message
Gets the current left-to-right order of columns in a list-view control. You can send this message explicitly or use the ListView_GetColumnOrderArray macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETCOLUMNORDERARRAY, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iCount;
(LPARAM) lParam // = (LPARAM) (LPINT) lpiArray;
);
Parameters
iCount
The number of columns in the list-view control.
lpiArray
A pointer to an array of integers that receives the index values of the columns in the list-view control. The array must be large enough to hold iCount elements.
Return Value
If successful, returns nonzero, and the buffer at lpiArray receives the column index of each column in the control in the order they appear from left to right. Otherwise, the return value is zero.
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x103c">
<name>LVM_SETHOTITEM</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns the index of the item that was previously hot. </returnmisc>
</return>
<wparam value="int">
<wname>iIndex</wname>
<wmisc>iIndex
Zero-based index of the item to be set as the hot item. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>LVM_SETHOTITEM Message
Sets the hot item for a list-view control. You can send this message explicitly or use the ListView_SetHotItem macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_SETHOTITEM, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iIndex;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
iIndex
Zero-based index of the item to be set as the hot item.
lParam
Must be zero.
Return Value
Returns the index of the item that was previously hot.
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x103d">
<name>LVM_GETHOTITEM</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>LVM_GETHOTITEM Message
Retrieves the index of the hot item. You can send this message explicitly or use the ListView_GetHotItem macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETHOTITEM, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x103e">
<name>LVM_GETHOTITEM</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>LVM_GETHOTITEM Message
Retrieves the index of the hot item. You can send this message explicitly or use the ListView_GetHotItem macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETHOTITEM, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x103f">
<name>LVM_GETHOTCURSOR</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>LVM_GETHOTCURSOR Message
Retrieves the HCURSOR value used when the pointer is over an item while hot tracking is enabled. You can send this message explicitly or use the ListView_GetHotCursor macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETHOTCURSOR, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Remarks
A list-view control uses hot tracking and hover selection when the LVS_EX_TRACKSELECT style is set.
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x1040">
<name>LVM_APPROXIMATEVIEWRECT</name>
<return value="DWORD">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns a DWORD value that holds the approximate width (in the LOWORD) and height (in the HIWORD) needed to display the items, in pixels.
</returnmisc>
</return>
<wparam value="int">
<wname>iCount</wname>
<wmisc>iCount
The number of items to be displayed in the control. If this parameter is set to -1, the message uses the total number of items in the control.
</wmisc>
</wparam>
<lparam value="">
<lname>cx, cy</lname>
<lmisc>cx
The proposed x-dimension of the control, in pixels. This parameter can be set to -1 to allow the message to use the current width value.
cy
The proposed y-dimension of the control, in pixels. This parameter can be set to -1 to allow the message to use the current height value.
</lmisc>
</lparam>
<misc>LVM_APPROXIMATEVIEWRECT Message
Calculates the approximate width and height required to display a given number of items. You can send this message explicitly or use the ListView_ApproximateViewRect macro.
To send this message, call the SendMessage function as follows.
Syntax
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_APPROXIMATEVIEWRECT, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iCount
(LPARAM) lParam // = (LPARAM) MAKELPARAM (cx, cy)
);
Parameters
iCount
The number of items to be displayed in the control. If this parameter is set to -1, the message uses the total number of items in the control.
cx
The proposed x-dimension of the control, in pixels. This parameter can be set to -1 to allow the message to use the current width value.
cy
The proposed y-dimension of the control, in pixels. This parameter can be set to -1 to allow the message to use the current height value.
Return Value
Returns a DWORD value that holds the approximate width (in the LOWORD) and height (in the HIWORD) needed to display the items, in pixels.
Remarks
Setting the size of the list-view control based on the dimensions provided by this message can optimize redraw and reduce flicker.
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x1041">
<name>LVM_SETWORKAREAS</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="INT">
<wname>nWorkAreas</wname>
<wmisc>nWorkAreas
The number of structures in the array at lprc. The maximum number of working areas allowed is defined by the LV_MAX_WORKAREAS value.
</wmisc>
</wparam>
<lparam value="RECT">
<lname>lprc</lname>
<lmisc>lprc
Pointer to an array of RECT structures that contain the new working areas of the list-view control. Values in these structures are in client coordinates. If this parameter is NULL, the working area will be set to the client area of the control. nWorkAreas specifies the number of structures in this array.
</lmisc>
</lparam>
<misc>LVM_SETWORKAREAS Message
Sets the working areas within a list-view control. You can send this message explicitly or use the ListView_SetWorkAreas macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_SETWORKAREAS, // message ID
(WPARAM) wParam, // = (WPARAM) (INT) nWorkAreas;
(LPARAM) lParam // = (LPARAM) (LPRECT) lprc;
);
Parameters
nWorkAreas
The number of structures in the array at lprc. The maximum number of working areas allowed is defined by the LV_MAX_WORKAREAS value.
lprc
Pointer to an array of RECT structures that contain the new working areas of the list-view control. Values in these structures are in client coordinates. If this parameter is NULL, the working area will be set to the client area of the control. nWorkAreas specifies the number of structures in this array.
Return Value
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x1046">
<name>LVM_GETWORKAREAS</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
The return value for this message is not used. </returnmisc>
</return>
<wparam value="int">
<wname>nWorkAreas</wname>
<wmisc> nWorkAreas
The number of RECT structures in the array at lprc. </wmisc>
</wparam>
<lparam value="RECT">
<lname>lprc</lname>
<lmisc>lprc
Pointer to an array of RECT structures that receive the current working areas of the list-view control. Values in these structures are in client coordinates. nWorkAreas specifies the number of structures in this array.
</lmisc>
</lparam>
<misc>LVM_GETWORKAREAS Message
Retrieves the working areas from a list-view control. You can send this message explicitly or use the ListView_GetWorkAreas macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETWORKAREAS, // message ID
(WPARAM) wParam, // = (WPARAM) (int) nWorkAreas;
(LPARAM) lParam // = (LPARAM) (LPRECT) lprc;
);
Parameters
nWorkAreas
The number of RECT structures in the array at lprc.
lprc
Pointer to an array of RECT structures that receive the current working areas of the list-view control. Values in these structures are in client coordinates. nWorkAreas specifies the number of structures in this array.
Return Value
The return value for this message is not used.
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x1049">
<name>LVM_GETNUMBEROFWORKAREAS</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPUINT">
<lname>lpuWorkAreas</lname>
<lmisc>lpuWorkAreas
Pointer to a UINT value that receives the number of working areas in the list-view control. If zero is placed in this variable, then no working areas are currently set. This value cannot be NULL.
</lmisc>
</lparam>
<misc>LVM_GETNUMBEROFWORKAREAS Message
Retrieves the number of working areas in a list-view control. You can send this message explicitly or use the ListView_GetNumberOfWorkAreas macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETNUMBEROFWORKAREAS, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPUINT) lpuWorkAreas;
);
Parameters
wParam
Must be zero.
lpuWorkAreas
Pointer to a UINT value that receives the number of working areas in the list-view control. If zero is placed in this variable, then no working areas are currently set. This value cannot be NULL.
Return Value
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x1042">
<name>LVM_GETSELECTIONMARK</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns the zero-based selection mark, or -1 if there is no selection mark.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.
</lmisc>
</lparam>
<misc>LVM_GETSELECTIONMARK Message
Retrieves the selection mark from a list-view control. You can send this message explicitly or use the ListView_GetSelectionMark macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETSELECTIONMARK, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Returns the zero-based selection mark, or -1 if there is no selection mark.
Remarks
The selection mark is the item index from which a multiple selection starts.
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x1043">
<name>LVM_SETSELECTIONMARK</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="INT">
<lname>iIndex</lname>
<lmisc>iIndex
Zero-based index of the new selection mark. If set to -1, the selection mark is removed.
</lmisc>
</lparam>
<misc>LVM_SETSELECTIONMARK Message
Sets the selection mark in a list-view control. You can send this message explicitly or use the ListView_SetSelectionMark macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_SETSELECTIONMARK, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (INT) iIndex;
);
Parameters
wParam
Must be zero.
iIndex
Zero-based index of the new selection mark. If set to -1, the selection mark is removed.
Return Value
Remarks
The selection mark is the item index from which a multiple selection starts. This message does not affect the selection state of the item.
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x1047">
<name>LVM_SETHOVERTIME</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns the previous hover time. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="DWORD">
<lname>dwHoverTime</lname>
<lmisc>dwHoverTime
The new amount of time, in milliseconds, that the mouse cursor must hover over an item before it is selected. If this value is (DWORD)-1, then the hover time is set to the default hover time.
</lmisc>
</lparam>
<misc>LVM_SETHOVERTIME Message
Sets the amount of time which the mouse cursor must hover over an item before it is selected. You can send this message explicitly or use the ListView_SetHoverTime macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_SETHOVERTIME, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (DWORD) dwHoverTime;
);
Parameters
wParam
Must be zero.
dwHoverTime
The new amount of time, in milliseconds, that the mouse cursor must hover over an item before it is selected. If this value is (DWORD)-1, then the hover time is set to the default hover time.
Return Value
Returns the previous hover time.
Remarks
The hover time only affects list-view controls that have the LVS_EX_TRACKSELECT, LVS_EX_ONECLICKACTIVATE, or LVS_EX_TWOCLICKACTIVATE extended list-view style.
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x1048">
<name>LVM_GETHOVERTIME</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns the amount of time, in milliseconds, that the mouse cursor must hover over an item before it is selected. If the return value is (DWORD)-1, then the hover time is the default hover time.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.
</lmisc>
</lparam>
<misc>LVM_GETHOVERTIME Message
Retrieves the amount of time that the mouse cursor must hover over an item before it is selected. You can send this message explicitly or use the ListView_GetHoverTime macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETHOVERTIME, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Returns the amount of time, in milliseconds, that the mouse cursor must hover over an item before it is selected. If the return value is (DWORD)-1, then the hover time is the default hover time.
Remarks
The hover time only affects list-view controls that have the LVS_EX_TRACKSELECT, LVS_EX_ONECLICKACTIVATE, or LVS_EX_TWOCLICKACTIVATE extended list-view style.
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x104a">
<name>LVM_SETTOOLTIPS</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns the handle to the previous ToolTip control.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="HWND">
<lname>hwndToolTip</lname>
<lmisc>hwndToolTip
Handle to the ToolTip control to be set. </lmisc>
</lparam>
<misc>LVM_SETTOOLTIPS Message
Sets the ToolTip control that the list-view control will use to display ToolTips. You can send this message explicitly or use the ListView_SetToolTips macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_SETTOOLTIPS, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (HWND) hwndToolTip;
);
Parameters
wParam
Must be zero.
hwndToolTip
Handle to the ToolTip control to be set.
Return Value
Returns the handle to the previous ToolTip control.
Message Information
Minimum DLL Version comctl32.dll version 4.00 or later
Header commctrl.h
Minimum operating systems Windows NT 4.0, Windows 95</misc>
</message>
<message value="0x104e">
<name>LVM_GETTOOLTIPS</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns the handle of the ToolTip control. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>LVM_GETTOOLTIPS Message
Retrieves the ToolTip control that the list-view control uses to display ToolTips. You can send this message explicitly or use the ListView_GetToolTips macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETTOOLTIPS, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Returns the handle of the ToolTip control.
Message Information
Minimum DLL Version comctl32.dll version 4.00 or later
Header commctrl.h
Minimum operating systems Windows NT 4.0, Windows 95</misc>
</message>
<message value="0x1051">
<name>LVM_SORTITEMSEX</name>
<return value="BOOL">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns TRUE if successful, or FALSE otherwise. </returnmisc>
</return>
<wparam value="">
<wname>lParamSort</wname>
<wmisc>lParamSort
Application-defined value that is passed to the comparison function. </wmisc>
</wparam>
<lparam value="PFNLVCOMPARE">
<lname>pfnCompare</lname>
<lmisc>pfnCompare
Pointer to an application-defined comparison function. It is called during the sort operation each time the relative order of two list items needs to be compared.
</lmisc>
</lparam>
<misc>LVM_SORTITEMSEX Message
Uses an application-defined comparison function to sort the items of a list-view control. The index of each item changes to reflect the new sequence. You can send this message explicitly or by using the ListView_SortItemsEx macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_SORTITEMSEX, // message ID
(WPARAM) wParam, // = (WPARAM) (LPARAM) lParamSort;
(LPARAM) lParam // = (LPARAM) (PFNLVCOMPARE) pfnCompare;
);
Parameters
lParamSort
Application-defined value that is passed to the comparison function.
pfnCompare
Pointer to an application-defined comparison function. It is called during the sort operation each time the relative order of two list items needs to be compared.
Return Value
Returns TRUE if successful, or FALSE otherwise.
Remarks
The comparison function has the following form:
Copy Code
int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2,
LPARAM lParamSort);
This message is similar to LVM_SORTITEMS, except for the type of information passed to the comparison function. With LVM_SORTITEMSEX, lParam1 is the current index of the first item, and lParam2 is the current index of the second item. You can send an LVM_GETITEMTEXT message to retrieve more information on an item, if needed.
The comparison function must return a negative value if the first item should precede the second, a positive value if the first item should follow the second, or zero if the two items are equivalent.
Note During the sorting process, the list-view contents are unstable. If the callback function sends any messages to the list-view control aside from LVM_GETITEM (ListView_GetItem), the results are unpredictable.
Message Information
Minimum DLL Version comctl32.dll version 5.80 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 5, Windows 98</misc>
</message>
<message value="0x1044">
<name>LVM_SETBKIMAGEA</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns nonzero if successful, or zero otherwise. Returns zero if the ulFlags member of the LVBKIMAGE structure is LVBKIF_SOURCE_NONE.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPLVBKIMAGE">
<lname>plvbki</lname>
<lmisc>plvbki
Pointer to a LVBKIMAGE structure that contains the new background image information.
</lmisc>
</lparam>
<misc>LVM_SETBKIMAGE Message
Sets the background image in a list-view control. You can send this message explicitly or by using the ListView_SetBkImage macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_SETBKIMAGE, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPLVBKIMAGE) plvbki;
);
Parameters
wParam
Must be zero.
plvbki
Pointer to a LVBKIMAGE structure that contains the new background image information.
Return Value
Returns nonzero if successful, or zero otherwise. Returns zero if the ulFlags member of the LVBKIMAGE structure is LVBKIF_SOURCE_NONE.
Remarks
Because the list-view control uses OLE COM to manipulate the background images, the calling application must call CoInitialize or OleInitialize before sending this message. It is best to call one of these functions when the application is initialized and call either CoUninitialize or OleUninitialize when the application is terminating.
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x108a">
<name>LVM_SETBKIMAGEW</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns nonzero if successful, or zero otherwise. Returns zero if the ulFlags member of the LVBKIMAGE structure is LVBKIF_SOURCE_NONE.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPLVBKIMAGE">
<lname>plvbki</lname>
<lmisc>plvbki
Pointer to a LVBKIMAGE structure that contains the new background image information.
</lmisc>
</lparam>
<misc>LVM_SETBKIMAGE Message
Sets the background image in a list-view control. You can send this message explicitly or by using the ListView_SetBkImage macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_SETBKIMAGE, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPLVBKIMAGE) plvbki;
);
Parameters
wParam
Must be zero.
plvbki
Pointer to a LVBKIMAGE structure that contains the new background image information.
Return Value
Returns nonzero if successful, or zero otherwise. Returns zero if the ulFlags member of the LVBKIMAGE structure is LVBKIF_SOURCE_NONE.
Remarks
Because the list-view control uses OLE COM to manipulate the background images, the calling application must call CoInitialize or OleInitialize before sending this message. It is best to call one of these functions when the application is initialized and call either CoUninitialize or OleUninitialize when the application is terminating.
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x1045">
<name>LVM_GETBKIMAGEA</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPLVBKIMAGE">
<lname>plvbki</lname>
<lmisc>plvbki
A pointer to an LVBKIMAGE structure that will receive the background image information.
</lmisc>
</lparam>
<misc>LVM_GETBKIMAGE Message
Gets the background image in a list-view control. You can send this message explicitly or by using the ListView_GetBkImage macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETBKIMAGE, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPLVBKIMAGE) plvbki;
);
Parameters
wParam
Must be zero.
plvbki
A pointer to an LVBKIMAGE structure that will receive the background image information.
Return Value
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x108b">
<name>LVM_GETBKIMAGEW</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPLVBKIMAGE">
<lname>plvbki</lname>
<lmisc>plvbki
A pointer to an LVBKIMAGE structure that will receive the background image information.
</lmisc>
</lparam>
<misc>LVM_GETBKIMAGE Message
Gets the background image in a list-view control. You can send this message explicitly or by using the ListView_GetBkImage macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETBKIMAGE, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPLVBKIMAGE) plvbki;
);
Parameters
wParam
Must be zero.
plvbki
A pointer to an LVBKIMAGE structure that will receive the background image information.
Return Value
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x108c">
<name>LVM_SETSELECTEDCOLUMN</name>
<return value="">
<returninfo>returns nothing in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>iCol</wname>
<wmisc>iCol
Value of type int that specifies the column index.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>LVM_SETSELECTEDCOLUMN Message
Sets the index of the selected column.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns nothing in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_SETSELECTEDCOLUMN, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iCol;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
iCol
Value of type int that specifies the column index.
lParam
Must be zero.
Return Value
Remarks
The column indices are stored in an int array. See the puColumns member of LVITEM.
Note To use this API, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.
Message Information
Header commctrl.h
Minimum operating systems Windows XP</misc>
</message>
<message value="0x108e">
<name>LVM_SETVIEW</name>
<return value="int">
<returninfo>returns int in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="DWORD">
<wname>iView</wname>
<wmisc>iView
DWORD that specifies the view.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>LVM_SETVIEW Message
Sets the view of a list-view control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns int in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_SETVIEW, // message ID
(WPARAM) wParam, // = (WPARAM) (DWORD) iView;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
iView
DWORD that specifies the view.
lParam
Must be zero.
Return Value
Remarks
Following are the values for views.
* LV_VIEW_DETAILS
* LV_VIEW_ICON
* LV_VIEW_LIST
* LV_VIEW_SMALLICON
* LV_VIEW_TILE
Note To use this API, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.
Message Information
Header commctrl.h
Minimum operating systems Windows XP</misc>
</message>
<message value="0x108f">
<name>LVM_GETVIEW</name>
<return value="DWORD">
<returninfo>returns DWORD in lResult</returninfo>
<returnmisc>Return Value
Returns a DWORD that specifies the current view.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc> lParam
Must be zero.</lmisc>
</lparam>
<misc>LVM_GETVIEW Message
Retrieves the current view of a list-view control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns DWORD in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETVIEW, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Returns a DWORD that specifies the current view.
Remarks
Following are the values for views.
* LV_VIEW_DETAILS
* LV_VIEW_ICON
* LV_VIEW_LIST
* LV_VIEW_SMALLICON
* LV_VIEW_TILE
Note To use this API, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.
Message Information
Header commctrl.h
Minimum operating systems Windows XP</misc>
</message>
<message value="0x1091">
<name>LVM_INSERTGROUP</name>
<return value="int">
<returninfo>returns int in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>index</wname>
<wmisc>index
Index where the group is to be added. If this is -1, the group is added at the end of the list.
</wmisc>
</wparam>
<lparam value="PLVGROUP">
<lname>pgrp</lname>
<lmisc>pgrp
Pointer to a LVGROUP structure that contains the group to add.</lmisc>
</lparam>
<misc>LVM_INSERTGROUP Message
Inserts a group into a list-view control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns int in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_INSERTGROUP, // message ID
(WPARAM) wParam, // = (WPARAM) (int) index;
(LPARAM) lParam // = (LPARAM) (PLVGROUP) pgrp;
);
Parameters
index
Index where the group is to be added. If this is -1, the group is added at the end of the list.
pgrp
Pointer to a LVGROUP structure that contains the group to add.
Return Value
Remarks
To turn on group mode, call LVM_ENABLEGROUPVIEW or ListView_EnableGroupView.
A group cannot be inserted into an empty ListView control.
Be sure to set the iGroupId in the item(s) the group was added to. Otherwise after LVM_ENABLEGROUPVIEW message processing with TRUE the listview control will not show any items.
Note To use this API, you must provide a manifest specifying Comclt32 version 6.0. For more information on manifests, see Enabling Visual Styles.
Message Information
Header commctrl.h
Minimum operating systems Windows XP</misc>
</message>
<message value="0x1093">
<name>LVM_SETGROUPINFO</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>iGroupId</wname>
<wmisc>iGroupId
ID that specifies the group whose information is to be set.</wmisc>
</wparam>
<lparam value="PLVGROUP">
<lname>pgrp</lname>
<lmisc>pgrp
Pointer to an LVGROUP structure that contains the information to set.</lmisc>
</lparam>
<misc>LVM_SETGROUPINFO Message
Sets group information.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_SETGROUPINFO, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iGroupId;
(LPARAM) lParam // = (LPARAM) (PLVGROUP) pgrp;
);
Parameters
iGroupId
ID that specifies the group whose information is to be set.
pgrp
Pointer to an LVGROUP structure that contains the information to set.
Return Value
Remarks
Note To use this API, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.
Message Information
Header commctrl.h
Minimum operating systems Windows XP</misc>
</message>
<message value="0x1095">
<name>LVM_GETGROUPINFO</name>
<return value="int">
<returninfo>returns int in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>iGroupId</wname>
<wmisc>iGroupId
An ID that specifies the group whose information is retrieved.</wmisc>
</wparam>
<lparam value="PLVGROUP">
<lname>pgrp</lname>
<lmisc>pgrp
A pointer an LVGROUP structure that receives the retrieved information. Set the cbSize member of this structure to sizeof(LVGROUP).
</lmisc>
</lparam>
<misc>LVM_GETGROUPINFO Message
Gets group information.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns int in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETGROUPINFO, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iGroupId;
(LPARAM) lParam // = (LPARAM) (PLVGROUP) pgrp;
);
Parameters
iGroupId
An ID that specifies the group whose information is retrieved.
pgrp
A pointer an LVGROUP structure that receives the retrieved information. Set the cbSize member of this structure to sizeof(LVGROUP).
Return Value
Remarks
Note To use this message, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.
Message Information
Header commctrl.h
Minimum operating systems Windows XP</misc>
</message>
<message value="0x1096">
<name>LVM_REMOVEGROUP</name>
<return value="int">
<returninfo>returns int in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>iGroupId</wname>
<wmisc>iGroupId
ID that specifies the group to remove.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be NULL.</lmisc>
</lparam>
<misc>LVM_REMOVEGROUP Message
Removes a group from a list-view control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns int in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_REMOVEGROUP, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iGroupId;
(LPARAM) lParam // = (LPARAM) (LPARAM) lParam;
);
Parameters
iGroupId
ID that specifies the group to remove.
lParam
Must be NULL.
Return Value
Remarks
Note To use this API, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.
Message Information
Header commctrl.h
Minimum operating systems Windows XP</misc>
</message>
<message value="0x109b">
<name>LVM_SETGROUPMETRICS</name>
<return value="">
<returninfo>returns nothing in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be NULL.</wmisc>
</wparam>
<lparam value="PLVGROUPMETRICS">
<lname>pGroupMetrics</lname>
<lmisc>pGroupMetrics
Pointer to an LVGROUPMETRICS structure that contains the metrics to set.
</lmisc>
</lparam>
<misc>LVM_SETGROUPMETRICS Message
Sets information about the display of groups.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns nothing in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_SETGROUPMETRICS, // message ID
(WPARAM) wParam, // = (WPARAM) (WPARAM) wParam;
(LPARAM) lParam // = (LPARAM) (PLVGROUPMETRICS) pGroupMetrics;
);
Parameters
wParam
Must be NULL.
pGroupMetrics
Pointer to an LVGROUPMETRICS structure that contains the metrics to set.
Return Value
Remarks
Note To use this message, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.
Message Information
Header commctrl.h
Minimum operating systems Windows XP</misc>
</message>
<message value="0x109c">
<name>LVM_GETGROUPMETRICS</name>
<return value="">
<returninfo>returns nothing in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be NULL.</wmisc>
</wparam>
<lparam value="PLVGROUPMETRICS">
<lname>pGroupMetrics</lname>
<lmisc>pGroupMetrics
A pointer to an LVGROUPMETRICS structure that receives the retrieved metrics.</lmisc>
</lparam>
<misc>LVM_GETGROUPMETRICS Message
Sets information about the display of groups.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns nothing in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETGROUPMETRICS, // message ID
(WPARAM) wParam, // = (WPARAM) (WPARAM) wParam;
(LPARAM) lParam // = (LPARAM) (PLVGROUPMETRICS) pGroupMetrics;
);
Parameters
wParam
Must be NULL.
pGroupMetrics
A pointer to an LVGROUPMETRICS structure that receives the retrieved metrics.
Return Value
Remarks
Note To use this API, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.
Message Information
Header commctrl.h
Minimum operating systems Windows XP</misc>
</message>
<message value="0x109d">
<name>LVM_ENABLEGROUPVIEW</name>
<return value="int">
<returninfo>returns int in lResult</returninfo>
<returnmisc>Return Value
Returns one of the following values.
0 The ability to display list-view items as a group is already enabled or disabled.
1 The state of the control was successfully changed.
-1 The operation failed.
</returnmisc>
</return>
<wparam value="BOOL">
<wname>fEnable</wname>
<wmisc>fEnable
A BOOL that indicates whether to enable a list-view control to group displayed items. Use TRUE to enable grouping, FALSE to disable it.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be NULL.
</lmisc>
</lparam>
<misc>LVM_ENABLEGROUPVIEW Message
Enables or disables whether the items in a list-view control display as a group.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns int in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_ENABLEGROUPVIEW, // message ID
(WPARAM) wParam, // = (WPARAM) (BOOL) fEnable;
(LPARAM) lParam // = (LPARAM) (LPARAM) lParam;
);
Parameters
fEnable
A BOOL that indicates whether to enable a list-view control to group displayed items. Use TRUE to enable grouping, FALSE to disable it.
lParam
Must be NULL.
Return Value
Returns one of the following values.
0 The ability to display list-view items as a group is already enabled or disabled.
1 The state of the control was successfully changed.
-1 The operation failed.
Remarks
LVM_ENABLEGROUPVIEW is not supported under the LVS_OWNERDATA style.
Note To use this API, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.
Message Information
Header commctrl.h
Minimum operating systems Windows XP</misc>
</message>
<message value="0x109e">
<name>LVM_SORTGROUPS</name>
<return value="int">
<returninfo>returns int in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="PFNLVGROUPCOMPARE">
<wname>pfnGroupCompare</wname>
<wmisc>pfnGroupCompare
Pointer to an application-defined comparison function, LVGroupCompare.</wmisc>
</wparam>
<lparam value="LPVOID">
<lname>plv</lname>
<lmisc>plv
Void pointer to the application-defined information.</lmisc>
</lparam>
<misc>LVM_SORTGROUPS Message
Uses an application-defined comparison function to sort groups by ID within a list-view control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns int in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_SORTGROUPS, // message ID
(WPARAM) wParam, // = (WPARAM) (PFNLVGROUPCOMPARE) pfnGroupCompare;
(LPARAM) lParam // = (LPARAM) (LPVOID) plv;
);
Parameters
pfnGroupCompare
Pointer to an application-defined comparison function, LVGroupCompare.
plv
Void pointer to the application-defined information.
Return Value
Remarks
Note To use this API, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.
Message Information
Header commctrl.h
Minimum operating systems Windows XP</misc>
</message>
<message value="0x109f">
<name>LVM_INSERTGROUPSORTED</name>
<return value="">
<returninfo>returns nothing in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="PLVINSERTGROUPSORTED">
<wname>structInsert</wname>
<wmisc>structInsert
Pointer to an LVINSERTGROUPSORTED structure that contains the group to insert.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be NULL.</lmisc>
</lparam>
<misc>LVM_INSERTGROUPSORTED Message
Inserts a group into an ordered list of groups.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns nothing in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_INSERTGROUPSORTED, // message ID
(WPARAM) wParam, // = (WPARAM) (PLVINSERTGROUPSORTED) structInsert;
(LPARAM) lParam // = (LPARAM) (LPARAM) lParam;
);
Parameters
structInsert
Pointer to an LVINSERTGROUPSORTED structure that contains the group to insert.
lParam
Must be NULL.
Return Value
Remarks
The ordering of the list is based on the ID of the group. The order is defined by the application-defined ordering function, LVGroupCompare, that is passed in the LVINSERTGROUPSORTED structure by the structInsert parameter.
Note To use this API, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.
Message Information
Header commctrl.h
Minimum operating systems Windows XP</misc>
</message>
<message value="0x10a0">
<name>LVM_REMOVEALLGROUPS</name>
<return value="">
<returninfo>returns nothing in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be NULL.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be NULL.</lmisc>
</lparam>
<misc>LVM_REMOVEALLGROUPS Message
Removes all groups from a list-view control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns nothing in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_REMOVEALLGROUPS, // message ID
(WPARAM) wParam, // = (WPARAM) (WPARAM) wParam;
(LPARAM) lParam // = (LPARAM) (LPARAM) lParam;
);
Parameters
wParam
Must be NULL.
lParam
Must be NULL.
Return Value
Remarks
Note To use this API, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.
Message Information
Header commctrl.h
Minimum operating systems Windows XP</misc>
</message>
<message value="0x10a1">
<name>LVM_HASGROUP</name>
<return value="BOOL">
<returninfo>returns BOOL in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>dwGroupId</wname>
<wmisc>dwGroupId
ID of the group.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be NULL.</lmisc>
</lparam>
<misc>LVM_HASGROUP Message
Determines whether the list-view control has a specified group.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns BOOL in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_HASGROUP, // message ID
(WPARAM) wParam, // = (WPARAM) (int) dwGroupId;
(LPARAM) lParam // = (LPARAM) (LPARAM) lParam;
);
Parameters
dwGroupId
ID of the group.
lParam
Must be NULL.
Return Value
Remarks
Note To use this API, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.
Message Information
Header commctrl.h
Minimum operating systems Windows XP</misc>
</message>
<message value="0x10a2">
<name>LVM_SETTILEVIEWINFO</name>
<return value="BOOL">
<returninfo>returns BOOL in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="PLVTILEVIEWINFO">
<lname>plvtvinfo</lname>
<lmisc>plvtvinfo
Pointer to an LVTILEVIEWINFO structure that contains the information to set.</lmisc>
</lparam>
<misc>LVM_SETTILEVIEWINFO Message
Sets information that a list-view control uses in tile view.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns BOOL in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_SETTILEVIEWINFO, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (PLVTILEVIEWINFO) plvtvinfo;
);
Parameters
wParam
Must be zero.
plvtvinfo
Pointer to an LVTILEVIEWINFO structure that contains the information to set.
Return Value
Remarks
To use this message, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.
Message Information
Header commctrl.h
Minimum operating systems Windows XP</misc>
</message>
<message value="0x10a3">
<name>LVM_GETTILEVIEWINFO</name>
<return value="">
<returninfo>returns nothing in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="PLVTILEVIEWINFO">
<lname>plvtvinfo</lname>
<lmisc>plvtvinfo
Pointer to an LVTILEVIEWINFO structure that receives the retrieved information.</lmisc>
</lparam>
<misc>LVM_GETTILEVIEWINFO Message
Retrieves information about a list-view control in tile view.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns nothing in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETTILEVIEWINFO, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (PLVTILEVIEWINFO) plvtvinfo;
);
Parameters
wParam
Must be zero.
plvtvinfo
Pointer to an LVTILEVIEWINFO structure that receives the retrieved information.
Return Value
Remarks
Note To use this message, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.
Message Information
Header commctrl.h
Minimum operating systems Windows XP</misc>
</message>
<message value="0x10a4">
<name>LVM_SETTILEINFO</name>
<return value="BOOL">
<returninfo>returns BOOL in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="PLVTILEINFO">
<lname>plvtinfo</lname>
<lmisc>plvtinfo
Pointer to an LVTILEINFO structure that contains the information to set.</lmisc>
</lparam>
<misc>LVM_SETTILEINFO Message
Sets information for an existing tile of a list-view control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns BOOL in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_SETTILEINFO, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (PLVTILEINFO) plvtinfo;
);
Parameters
wParam
Must be zero.
plvtinfo
Pointer to an LVTILEINFO structure that contains the information to set.
Return Value
Remarks
LVM_SETTILEINFO is not supported under the LVS_OWNERDATA style.
Note To use this message, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.
Message Information
Header commctrl.h
Minimum operating systems Windows XP</misc>
</message>
<message value="0x10a5">
<name>LVM_GETTILEINFO</name>
<return value="">
<returninfo>returns nothing in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="PLVTILEINFO">
<lname>plvtinfo</lname>
<lmisc>plvtinfo
Pointer to an LVTILEINFO structure that receives the retrieved information.</lmisc>
</lparam>
<misc>LVM_GETTILEINFO Message
Retrieves information about a tile in a list-view control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns nothing in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETTILEINFO, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (PLVTILEINFO) plvtinfo;
);
Parameters
wParam
Must be zero.
plvtinfo
Pointer to an LVTILEINFO structure that receives the retrieved information.
Return Value
Remarks
Tile view is a new way of arranging and displaying items in a list-view control. The other views are icon, small icon, details, and list.
Note To use this API, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.
Message Information
Header commctrl.h
Minimum operating systems Windows XP</misc>
</message>
<message value="0x10a7">
<name>LVM_SETINSERTMARK</name>
<return value="BOOL">
<returninfo>returns BOOL in lResult</returninfo>
<returnmisc>Return Value
Returns TRUE if successful, or FALSE otherwise. FALSE is returned if the size in the cbSize member of the LVINSERTMARK structure does not equal the actual size of the structure, or when an insertion point does not apply in the current view.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="PLVINSERTMARK">
<lname>plvim</lname>
<lmisc> plvim
Pointer to a LVINSERTMARK structure that specifies where to set the insertion point.</lmisc>
</lparam>
<misc>LVM_SETINSERTMARK Message
Sets the insertion point to the defined position.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns BOOL in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_SETINSERTMARK, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (PLVINSERTMARK) plvim;
);
Parameters
wParam
Must be zero.
plvim
Pointer to a LVINSERTMARK structure that specifies where to set the insertion point.
Return Value
Returns TRUE if successful, or FALSE otherwise. FALSE is returned if the size in the cbSize member of the LVINSERTMARK structure does not equal the actual size of the structure, or when an insertion point does not apply in the current view.
Remarks
An insertion point can only appear if the list-view control is in icon view, small icon view, or tile view, and is not in group-view mode.
Note To use this API, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.
Message Information
Header commctrl.h
Minimum operating systems Windows XP</misc>
</message>
<message value="0x10a8">
<name>LVM_INSERTMARKHITTEST</name>
<return value="BOOL">
<returninfo>returns BOOL in lResult</returninfo>
<returnmisc>Return Value
Returns TRUE if successful, or FALSE otherwise. FALSE is returned if the size in the cbSize member of the LVINSERTMARK structure does not equal the actual size of the structure, or when an insertion point does not apply in the current view.
</returnmisc>
</return>
<wparam value="LPPOINT">
<wname>point</wname>
<wmisc>point
Pointer to a POINT structure that contains the hit test coordinates.</wmisc>
</wparam>
<lparam value="PLVINSERTMARK">
<lname>plvim</lname>
<lmisc>plvim
Pointer to an LVINSERTMARK structure that specifies the insertion point closest to the coordinates defined by the point parameter.
</lmisc>
</lparam>
<misc>LVM_INSERTMARKHITTEST Message
Retrieves the insertion point closest to a specified point.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns BOOL in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_INSERTMARKHITTEST, // message ID
(WPARAM) wParam, // = (WPARAM) (LPPOINT) point;
(LPARAM) lParam // = (LPARAM) (PLVINSERTMARK) plvim;
);
Parameters
point
Pointer to a POINT structure that contains the hit test coordinates.
plvim
Pointer to an LVINSERTMARK structure that specifies the insertion point closest to the coordinates defined by the point parameter.
Return Value
Returns TRUE if successful, or FALSE otherwise. FALSE is returned if the size in the cbSize member of the LVINSERTMARK structure does not equal the actual size of the structure, or when an insertion point does not apply in the current view.
Remarks
An insertion point can only appear if the list-view control is in icon view, small icon view, or tile view and is not in group-view mode.
If insertion points do not apply for the view, the LVINSERTMARK structure contains a -1 in the iItem member.
Note To use this API, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.
Message Information
Header commctrl.h
Minimum operating systems Windows XP</misc>
</message>
<message value="0x10a9">
<name>LVM_GETINSERTMARKRECT</name>
<return value="int">
<returninfo>returns int in lResult</returninfo>
<returnmisc>Return Value
Returns one of the following values.
0 No insertion point found.
1 Insertion point found.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used; must be zero.</wmisc>
</wparam>
<lparam value="RECT">
<lname>prc</lname>
<lmisc>prc
Pointer to a RECT structure that contains the coordinates of a rectangle that bounds the insertion point.
</lmisc>
</lparam>
<misc>LVM_GETINSERTMARKRECT Message
Retrieves the rectangle that bounds the insertion point.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns int in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETINSERTMARKRECT, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPRECT) prc;
);
Parameters
wParam
Not used; must be zero.
prc
Pointer to a RECT structure that contains the coordinates of a rectangle that bounds the insertion point.
Return Value
Returns one of the following values.
0 No insertion point found.
1 Insertion point found.
Remarks
Note To use this API, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.
Message Information
Header commctrl.h
Minimum operating systems Windows XP</misc>
</message>
<message value="0x10aa">
<name>LVM_GETINSERTMARKRECT</name>
<return value="int">
<returninfo>returns int in lResult</returninfo>
<returnmisc>Return Value
Returns one of the following values.
0 No insertion point found.
1 Insertion point found.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used; must be zero.</wmisc>
</wparam>
<lparam value="RECT">
<lname>prc</lname>
<lmisc>prc
Pointer to a RECT structure that contains the coordinates of a rectangle that bounds the insertion point.
</lmisc>
</lparam>
<misc>LVM_GETINSERTMARKRECT Message
Retrieves the rectangle that bounds the insertion point.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns int in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETINSERTMARKRECT, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPRECT) prc;
);
Parameters
wParam
Not used; must be zero.
prc
Pointer to a RECT structure that contains the coordinates of a rectangle that bounds the insertion point.
Return Value
Returns one of the following values.
0 No insertion point found.
1 Insertion point found.
Remarks
Note To use this API, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.
Message Information
Header commctrl.h
Minimum operating systems Windows XP</misc>
</message>
<message value="0x10ab">
<name>LVM_GETINSERTMARKCOLOR</name>
<return value="COLORREF">
<returninfo>returns COLORREF in lResult</returninfo>
<returnmisc>Return Value
Returns a COLORREF structure that contains the color of the insertion point.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>LVM_GETINSERTMARKCOLOR Message
Retrieves the color of the insertion point.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns COLORREF in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETINSERTMARKCOLOR, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Returns a COLORREF structure that contains the color of the insertion point.
Remarks
Note To use this API, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.
Message Information
Header commctrl.h
Minimum operating systems Windows XP</misc>
</message>
<message value="0x10ad">
<name>LVM_SETINFOTIP</name>
<return value="BOOL">
<returninfo>returns BOOL in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="PLVSETINFOTIP">
<lname>plvSetInfoTip</lname>
<lmisc>plvSetInfoTip
Pointer to a LVSETINFOTIP structure that contains the information to set.</lmisc>
</lparam>
<misc>LVM_SETINFOTIP Message
Sets ToolTip text.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns BOOL in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_SETINFOTIP, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (PLVSETINFOTIP) plvSetInfoTip;
);
Parameters
wParam
Must be zero.
plvSetInfoTip
Pointer to a LVSETINFOTIP structure that contains the information to set.
Return Value
Remarks
Note To use this API, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.
Message Information
Header commctrl.h
Minimum operating systems Windows XP</misc>
</message>
<message value="0x10ae">
<name>LVM_GETSELECTEDCOLUMN</name>
<return value="UINT">
<returninfo>returns UINT in lResult</returninfo>
<returnmisc>Return Value
Returns an UINT that specifies the selected column.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>LVM_GETSELECTEDCOLUMN Message
Retrieves an integer that specifies the selected column.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns UINT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETSELECTEDCOLUMN, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Returns an UINT that specifies the selected column.
Remarks
Note To use this API, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.
Message Information
Header commctrl.h
Minimum operating systems Windows XP</misc>
</message>
<message value="0x10af">
<name>LVM_ISGROUPVIEWENABLED</name>
<return value="BOOL">
<returninfo>returns BOOL in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>LVM_ISGROUPVIEWENABLED Message
Checks whether the list-view control has group view enabled.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns BOOL in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_ISGROUPVIEWENABLED, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Remarks
Note To use this API, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.
Message Information
Header commctrl.h
Minimum operating systems Windows XP</misc>
</message>
<message value="0x10b0">
<name>LVM_GETOUTLINECOLOR</name>
<return value="COLORREF">
<returninfo>returns COLORREF in lResult</returninfo>
<returnmisc>Return Value
Returns a COLORREF structure that contains the color of the border of a list-view control.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>LVM_GETOUTLINECOLOR Message
Retrieves the color of the border of a list-view control if the LVS_EX_BORDERSELECT extended window style is set.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns COLORREF in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_GETOUTLINECOLOR, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Returns a COLORREF structure that contains the color of the border of a list-view control.
Remarks
Note To use this API, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.
Message Information
Header commctrl.h
Minimum operating systems Windows XP</misc>
</message>
<message value="0x10b1">
<name>LVM_SETOUTLINECOLOR</name>
<return value="COLORREF">
<returninfo>returns COLORREF in lResult</returninfo>
<returnmisc>Return Value
Returns COLORREF structure that contains the outline color.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="COLORREF">
<lname>color</lname>
<lmisc>color
COLORREF structure that specifies the color to set the border.</lmisc>
</lparam>
<misc>LVM_SETOUTLINECOLOR Message
Sets the color of the border of a list-view control if the LVS_EX_BORDERSELECT extended window style is set.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns COLORREF in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_SETOUTLINECOLOR, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (COLORREF) color;
);
Parameters
wParam
Must be zero.
color
COLORREF structure that specifies the color to set the border.
Return Value
Returns COLORREF structure that contains the outline color.
Remarks
Note To use this API, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.
Message Information
Header commctrl.h
Minimum operating systems Windows XP</misc>
</message>
<message value="0x10b3">
<name>LVM_CANCELEDITLABEL</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
No return value.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>LVM_CANCELEDITLABEL Message
Cancels an item text editing operation.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage(
(HWND) hWndControl, // handle to destination control
(UINT) LVM_CANCELEDITLABEL, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
No return value.
Remarks
Note To use this API, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.
This message causes a an LVN_ENDLABELEDIT notification to be sent.
Message Information
Header commctrl.h
Minimum operating systems Windows XP</misc>
</message>
<message value="0x10b4">
<name>LVM_MAPINDEXTOID</name>
<return value="UINT">
<returninfo>returns UINT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="UINT">
<wname>index</wname>
<wmisc>index
UINT that contains the index of an item.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>LVM_MAPINDEXTOID Message
Maps the index of an item to a unique ID.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns UINT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_MAPINDEXTOID, // message ID
(WPARAM) wParam, // = (WPARAM) (UINT) index;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
index
UINT that contains the index of an item.
lParam
Must be zero.
Return Value
Remarks
List-view controls internally track items by index. This can present problems because indexes can change during the control's lifetime.
The list-view control can tag an item with an ID when the item is created. You can use this ID to guarantee uniqueness during the lifetime of the list-view control.
To uniquely identify an item, take the index that is returned from a call such as IComponent::GetDisplayInfo and call LVM_MAPINDEXTOID. The return value is a unique ID.
Note In a multithreaded environment, the index is only guaranteed on the thread that hosts the list-view control, not on background threads.
Note To use this API, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.
Message Information
Header commctrl.h
Minimum operating systems Windows XP</misc>
</message>
<message value="0x10b5">
<name>LVM_MAPIDTOINDEX</name>
<return value="UINT">
<returninfo>returns UINT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="UINT">
<wname>id</wname>
<wmisc>id
UINT that contains the unique ID of an item.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.
</lmisc>
</lparam>
<misc>LVM_MAPIDTOINDEX Message
Maps the ID of an item to an index.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns UINT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) LVM_MAPIDTOINDEX, // message ID
(WPARAM) wParam, // = (WPARAM) (UINT) id;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
id
UINT that contains the unique ID of an item.
lParam
Must be zero.
Return Value
Remarks
List-view controls internally track items by index. This can present problems because indexes can change during the control's lifetime.
The list-view control can tag an item with an ID when the item is created. You can use this ID to guarantee uniqueness during the lifetime of the list-view control.
To uniquely identify an item, take the index that is returned from a call such as IComponent::GetDisplayInfo and call LVM_MAPINDEXTOID. The return value is a unique ID.
If you need the index of an item after an ID is created you can call LVM_MAPIDTOINDEX with the unique ID and it returns the most current index.
LVM_MAPIDTOINDEX is not supported under the LVS_OWNERDATA style.
Note In a multithreaded environment, the index is only guaranteed on the thread that hosts the list-view control, not on background threads.
Note To use this API, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.
Message Information
Header commctrl.h
Minimum operating systems Windows XP</misc>
</message>
<message value="0x108d">
<name>LVM_SETTILEWIDTH</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc>LVM_SETTILEWIDTH Message
Not currently supported.
Remarks
This message is supported only through Microsoft Windows XP. It is not defined in Windows Vista.
Message Information
Header commctrl.h
Minimum operating systems Windows XP</misc>
</message>
<message value="0x1097">
<name>LVM_MOVEGROUP</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc>LVM_MOVEGROUP Message
Not implemented.
Message Information
Header commctrl.h
Minimum operating systems Windows XP</misc>
</message>
<message value="0x109a">
<name>LVM_MOVEITEMTOGROUP</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc>LVM_MOVEITEMTOGROUP Message
Not implemented.
Message Information
Header commctrl.h
Minimum operating systems Windows XP</misc>
</message>
<message value="0x1400">
<name>PGM_FIRST</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x1403">
<name>PGM_FORWARDMOUSE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
The return value is not used.
</returnmisc>
</return>
<wparam value="BOOL">
<wname>bForward</wname>
<wmisc>bForward
BOOL value that determines if mouse forwarding is enabled or disabled. If this value is nonzero, mouse forwarding is enabled. If this value is zero, mouse forwarding is disabled.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>PGM_FORWARDMOUSE Message
Enables or disables mouse forwarding for the pager control. When mouse forwarding is enabled, the pager control forwards WM_MOUSEMOVE messages to the contained window. You can send this message explicitly or use the Pager_ForwardMouse macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) PGM_FORWARDMOUSE, // message ID
(WPARAM) wParam, // = (WPARAM) (BOOL) bForward;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
bForward
BOOL value that determines if mouse forwarding is enabled or disabled. If this value is nonzero, mouse forwarding is enabled. If this value is zero, mouse forwarding is disabled.
lParam
Must be zero.
Return Value
The return value is not used.
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x1405">
<name>PGM_GETBKCOLOR</name>
<return value="COLORREF">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns a COLORREF value that contains the current background color.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>PGM_GETBKCOLOR Message
Retrieves the current background color for the pager control. You can send this message explicitly or use the Pager_GetBkColor macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) PGM_GETBKCOLOR, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Returns a COLORREF value that contains the current background color.
Remarks
By default, the pager control will use the system button face color as the background color. This is the same color that can be retrieved by calling GetSysColorBrush with COLOR_BTNFACE.
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0
</misc>
</message>
<message value="0x1407">
<name>PGM_GETBORDER</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>PGM_GETBORDER Message
Retrieves the current border size for the pager control. You can send this message explicitly or use the Pager_GetBorder macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) PGM_GETBORDER, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x140b">
<name>PGM_GETBUTTONSIZE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>PGM_GETBUTTONSIZE Message
Retrieves the current button size for the pager control. You can send this message explicitly or use the Pager_GetButtonSize macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) PGM_GETBUTTONSIZE, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x140c">
<name>PGM_GETBUTTONSTATE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns the state of the button specified in iButton. This will be one or more of the following values (if more then one value is returned they will be combined using a bitwise OR):
PGF_INVISIBLE The button is not visible.
PGF_NORMAL The button is in normal state.
PGF_GRAYED The button is in grayed state.
PGF_DEPRESSED The button is in pressed state.
PGF_HOT The button is in hot state.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="int">
<lname>iButton</lname>
<lmisc>iButton
Indicates which button to retrieve the state for. This can be one of the following values:
PGB_TOPORLEFT
Indicates the top button in a PGS_VERT pager control or the left button in a PGS_HORZ pager control.
PGB_BOTTOMORRIGHT
Indicates the bottom button in a PGS_VERT pager control or the right button in a PGS_HORZ pager control.
</lmisc>
</lparam>
<misc>PGM_GETBUTTONSTATE Message
Retrieves the state of the specified button in a pager control. You can send this message explicitly or use the Pager_GetButtonState macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) PGM_GETBUTTONSTATE, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (int) iButton;
);
Parameters
wParam
Must be zero.
iButton
Indicates which button to retrieve the state for. This can be one of the following values:
PGB_TOPORLEFT
Indicates the top button in a PGS_VERT pager control or the left button in a PGS_HORZ pager control.
PGB_BOTTOMORRIGHT
Indicates the bottom button in a PGS_VERT pager control or the right button in a PGS_HORZ pager control.
Return Value
Returns the state of the button specified in iButton. This will be one or more of the following values (if more then one value is returned they will be combined using a bitwise OR):
PGF_INVISIBLE The button is not visible.
PGF_NORMAL The button is in normal state.
PGF_GRAYED The button is in grayed state.
PGF_DEPRESSED The button is in pressed state.
PGF_HOT The button is in hot state.
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x1409">
<name>PGM_GETPOS</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>PGM_GETPOS Message
Retrieves the current scroll position of the pager control. You can send this message explicitly or use the Pager_GetPos macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) PGM_GETPOS, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x1402">
<name>PGM_RECALCSIZE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>PGM_RECALCSIZE Message
Forces the pager control to recalculate the size of the contained window. Sending this message will result in a PGN_CALCSIZE notification being sent. You can send this message explicitly or use the Pager_RecalcSize macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) PGM_RECALCSIZE, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x1404">
<name>PGM_SETBKCOLOR</name>
<return value="COLORREF">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns a COLORREF value that contains the previous background color.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="COLORREF">
<lname>clrBk</lname>
<lmisc>clrBk
COLORREF value that contains the new background color of the pager control. </lmisc>
</lparam>
<misc>PGM_SETBKCOLOR Message
Sets the current background color for the pager control. You can send this message explicitly or use the Pager_SetBkColor macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) PGM_SETBKCOLOR, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (COLORREF) clrBk;
);
Parameters
wParam
Must be zero.
clrBk
COLORREF value that contains the new background color of the pager control.
Return Value
Returns a COLORREF value that contains the previous background color.
Remarks
By default, the pager control will use the system button face color as the background color. This is the same color that can be retrieved by calling GetSysColorBrush with COLOR_BTNFACE.
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x1406">
<name>PGM_SETBORDER</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="int">
<lname>iBorder</lname>
<lmisc>iBorder
New size of the border, in pixels. This value should not be larger than the pager button or less than zero. If iBorder is too large, the border will be drawn the same size as the button. If iBorder is negative, the border size will be set to zero.
</lmisc>
</lparam>
<misc>PGM_SETBORDER Message
Sets the current border size for the pager control. You can send this message explicitly or use the Pager_SetBorder macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) PGM_SETBORDER, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (int) iBorder;
);
Parameters
wParam
Must be zero.
iBorder
New size of the border, in pixels. This value should not be larger than the pager button or less than zero. If iBorder is too large, the border will be drawn the same size as the button. If iBorder is negative, the border size will be set to zero.
Return Value
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x140a">
<name>PGM_SETBUTTONSIZE</name>
<return value="int">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns an int value that contains the previous button size, in pixels.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="int">
<lname>iButtonSize</lname>
<lmisc>iButtonSize
Value of type int that contains the new button size, in pixels. </lmisc>
</lparam>
<misc>PGM_SETBUTTONSIZE Message
Sets the current button size for the pager control. You can send this message explicitly or use the Pager_SetButtonSize macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) PGM_SETBUTTONSIZE, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (int) iButtonSize;
);
Parameters
wParam
Must be zero.
iButtonSize
Value of type int that contains the new button size, in pixels.
Return Value
Returns an int value that contains the previous button size, in pixels.
Remarks
If the pager control has the PGS_HORZ style, the button size determines the width of the pager buttons. If the pager control has the PGS_VERT style, the button size determines the height of the pager buttons. By default, the pager control sets its button size to three-fourths of the width of the scroll bar.
There is a minimum size to the pager button, currently 12 pixels. However, this can change so you should not depend on this value.
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x1401">
<name>PGM_SETCHILD</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
The return value is not used. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>hwndChild</lname>
<lmisc>hwndChild
Handle to the window to be contained. </lmisc>
</lparam>
<misc>PGM_SETCHILD Message
Sets the contained window for the pager control. This message will not change the parent of the contained window; it only assigns a window handle to the pager control for scrolling. In most cases, the contained window will be a child window. If this is the case, the contained window should be a child of the pager control. You can send this message explicitly or use the Pager_SetChild macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) PGM_SETCHILD, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (HWND) hwndChild;
);
Parameters
wParam
Must be zero.
hwndChild
Handle to the window to be contained.
Return Value
The return value is not used.
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x1408">
<name>PGM_SETPOS</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="int">
<lname>iPos</lname>
<lmisc>iPos
Value of type int that contains the new scroll position, in pixels. </lmisc>
</lparam>
<misc>PGM_SETPOS Message
Sets the current scroll position for the pager control. You can send this message explicitly or use the Pager_SetPos macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) PGM_SETPOS, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (int) iPos;
);
Parameters
wParam
Must be zero.
iPos
Value of type int that contains the new scroll position, in pixels.
Return Value
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x413">
<name>TB_ADDBITMAP</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>nButtons</wname>
<wmisc>nButtons
Number of button images in the bitmap. If lptbab specifies a system-defined bitmap, this parameter is ignored.
</wmisc>
</wparam>
<lparam value="LPTBADDBITMAP">
<lname>lptbab</lname>
<lmisc>lptbab
Pointer to a TBADDBITMAP structure that contains the identifier of a bitmap resource and the handle to the module instance with the executable file that contains the bitmap resource.
</lmisc>
</lparam>
<misc>TB_ADDBITMAP Message
Adds one or more images to the list of button images available for a toolbar.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_ADDBITMAP, // message ID
(WPARAM) wParam, // = (WPARAM) (int) nButtons;
(LPARAM) lParam // = (LPARAM) (LPTBADDBITMAP) lptbab;
);
Parameters
nButtons
Number of button images in the bitmap. If lptbab specifies a system-defined bitmap, this parameter is ignored.
lptbab
Pointer to a TBADDBITMAP structure that contains the identifier of a bitmap resource and the handle to the module instance with the executable file that contains the bitmap resource.
Return Value
Remarks
If the toolbar was created using the CreateWindowEx function, you must send the TB_BUTTONSTRUCTSIZE message to the toolbar before sending TB_ADDBITMAP.
Example
The following example creates a bitmap from a resource (IDB_BITMAP1), maps the background color (black in this case) to the system button face color, and adds it to the toolbar.
Copy Code
DWORD backgroundColor = GetSysColor(COLOR_BTNFACE);
COLORMAP colorMap;
colorMap.from = RGB(0, 0, 0);
colorMap.to = backgroundColor;
HBITMAP hbm = CreateMappedBitmap(g_hInst, IDB_BITMAP1, 0, colorMap, 1);
TBADDBITMAP tb;
tb.hInst = NULL;
tb.nID = (UINT_PTR)hbm;
// hWndToolbar is the window handle of the toolbar.
// Don't forget to send TB_BUTTONSTRUCTSIZE if the toolbar was
// created by using CreateWindowEx.
int index = SendMessage (hWndToolbar, TB_ADDBITMAP, 0, (LPARAM)tb);
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x414">
<name>TB_ADDBUTTONS</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="UINT">
<wname>uNumButtons</wname>
<wmisc>uNumButtons
Number of buttons to add.</wmisc>
</wparam>
<lparam value="LPTBBUTTON">
<lname>lpButtons</lname>
<lmisc>lpButtons
Pointer to an array of TBBUTTON structures that contain information about the buttons to add. There must be the same number of elements in the array as buttons specified by uNumButtons.
</lmisc>
</lparam>
<misc>TB_ADDBUTTONS Message
Adds one or more buttons to a toolbar.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_ADDBUTTONS, // message ID
(WPARAM) wParam, // = (WPARAM) (UINT) uNumButtons;
(LPARAM) lParam // = (LPARAM) (LPTBBUTTON) lpButtons;
);
Parameters
uNumButtons
Number of buttons to add.
lpButtons
Pointer to an array of TBBUTTON structures that contain information about the buttons to add. There must be the same number of elements in the array as buttons specified by uNumButtons.
Return Value
Remarks
If the toolbar was created using the CreateWindowEx function, you must send the TB_BUTTONSTRUCTSIZE message to the toolbar before sending TB_ADDBUTTONS.
See TB_SETIMAGELIST for a discussion of how to assign bitmaps to toolbar buttons from one or more image lists.
Example
The following example code adds three buttons to a toolbar, using the standard system bitmap for view buttons. The TB_ADDBITMAP message returns the index of the first button image within the image list. Individual images are identified by their offsets from that value.
Copy Code
TBADDBITMAP tbAddBitmap;
tbAddBitmap.hInst = HINST_COMMCTRL;
tbAddBitmap.nID = IDB_VIEW_SMALL_COLOR;
// There are 12 items in IDB_VIEW_SMALL_COLOR. However, because this is a standard
// system-defined bitmap, the wParam (nButtons) is ignored.
//
// hWndToolbar is the handle of the toolbar window.
//
// Don't forget to send TB_BUTTONSTRUCTSIZE if the toolbar was created
// by using CreateWindowEx.
//
int stdidx = SendMessage(hWndToolbar, TB_ADDBITMAP, 0, (LPARAM)tb);
// Define the buttons.
// IDM_SETLARGEICONVIEW and so on are application-defined command IDs.
const int numButtons = 3;
TBBUTTON tbButtonsAdd[numButtons] =
{
{stdidx + VIEW_LARGEICONS, IDM_SETLARGEICONVIEW, TBSTATE_ENABLED, BTNS_BUTTON},
{stdidx + VIEW_SMALLICONS, IDM_SETSMALLICONVIEW, TBSTATE_ENABLED, BTNS_BUTTON},
{stdidx + VIEW_DETAILS, IDM_SETDETAILSVIEW, TBSTATE_ENABLED, BTNS_BUTTON}
};
// Add the view buttons.
SendMessage(hWndToolbar, TB_ADDBUTTONS, numButtons, (LPARAM)tbButtonsAdd);
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x444">
<name>TB_ADDBUTTONSW</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="UINT">
<wname>uNumButtons</wname>
<wmisc>uNumButtons
Number of buttons to add.</wmisc>
</wparam>
<lparam value="LPTBBUTTON">
<lname>lpButtons</lname>
<lmisc>lpButtons
Pointer to an array of TBBUTTON structures that contain information about the buttons to add. There must be the same number of elements in the array as buttons specified by uNumButtons.
</lmisc>
</lparam>
<misc>TB_ADDBUTTONS Message
Adds one or more buttons to a toolbar.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_ADDBUTTONS, // message ID
(WPARAM) wParam, // = (WPARAM) (UINT) uNumButtons;
(LPARAM) lParam // = (LPARAM) (LPTBBUTTON) lpButtons;
);
Parameters
uNumButtons
Number of buttons to add.
lpButtons
Pointer to an array of TBBUTTON structures that contain information about the buttons to add. There must be the same number of elements in the array as buttons specified by uNumButtons.
Return Value
Remarks
If the toolbar was created using the CreateWindowEx function, you must send the TB_BUTTONSTRUCTSIZE message to the toolbar before sending TB_ADDBUTTONS.
See TB_SETIMAGELIST for a discussion of how to assign bitmaps to toolbar buttons from one or more image lists.
Example
The following example code adds three buttons to a toolbar, using the standard system bitmap for view buttons. The TB_ADDBITMAP message returns the index of the first button image within the image list. Individual images are identified by their offsets from that value.
Copy Code
TBADDBITMAP tbAddBitmap;
tbAddBitmap.hInst = HINST_COMMCTRL;
tbAddBitmap.nID = IDB_VIEW_SMALL_COLOR;
// There are 12 items in IDB_VIEW_SMALL_COLOR. However, because this is a standard
// system-defined bitmap, the wParam (nButtons) is ignored.
//
// hWndToolbar is the handle of the toolbar window.
//
// Don't forget to send TB_BUTTONSTRUCTSIZE if the toolbar was created
// by using CreateWindowEx.
//
int stdidx = SendMessage(hWndToolbar, TB_ADDBITMAP, 0, (LPARAM)tb);
// Define the buttons.
// IDM_SETLARGEICONVIEW and so on are application-defined command IDs.
const int numButtons = 3;
TBBUTTON tbButtonsAdd[numButtons] =
{
{stdidx + VIEW_LARGEICONS, IDM_SETLARGEICONVIEW, TBSTATE_ENABLED, BTNS_BUTTON},
{stdidx + VIEW_SMALLICONS, IDM_SETSMALLICONVIEW, TBSTATE_ENABLED, BTNS_BUTTON},
{stdidx + VIEW_DETAILS, IDM_SETDETAILSVIEW, TBSTATE_ENABLED, BTNS_BUTTON}
};
// Add the view buttons.
SendMessage(hWndToolbar, TB_ADDBUTTONS, numButtons, (LPARAM)tbButtonsAdd);
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x41c">
<name>TB_ADDSTRINGA</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="HINSTANCE">
<wname>hinst</wname>
<wmisc>hinst
Handle to the module instance with an executable file that contains the string resource. If idString instead points to a character array with one or more strings, set this parameter to NULL.
</wmisc>
</wparam>
<lparam value="">
<lname>idString</lname>
<lmisc>idString
Resource identifier for the string resource, or a pointer to a TCHAR array. See Remarks.
</lmisc>
</lparam>
<misc>TB_ADDSTRING Message
Adds a new string to the toolbar's string pool.
To send this message, call the SendMessage function as follows.
Syntax
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_ADDSTRING, // message ID
(WPARAM) wParam, // = (WPARAM) (HINSTANCE) hinst
(LPARAM) lParam // = (LPARAM)idString
);
Parameters
hinst
Handle to the module instance with an executable file that contains the string resource. If idString instead points to a character array with one or more strings, set this parameter to NULL.
idString
Resource identifier for the string resource, or a pointer to a TCHAR array. See Remarks.
Return Value
Remarks
If hinst is NULL, idString points to a character array with one or more null-terminated strings. The last string in the array must be terminated with two null characters.
If hinst is the HINSTANCE of the application or of another module containing a string resource, idString is the resource identifier of the string. Each item in the string must begin with an arbitrary separator character, and the string must end with two such characters. For example, the text for three buttons might appear in the string table as "/New/Open/Save//". The message returns the index of "New" in the toolbar's string pool, and the other items are in consecutive positions.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x44d">
<name>TB_ADDSTRINGW</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="HINSTANCE">
<wname>hinst</wname>
<wmisc>hinst
Handle to the module instance with an executable file that contains the string resource. If idString instead points to a character array with one or more strings, set this parameter to NULL.
</wmisc>
</wparam>
<lparam value="">
<lname>idString</lname>
<lmisc>idString
Resource identifier for the string resource, or a pointer to a TCHAR array. See Remarks.
</lmisc>
</lparam>
<misc>TB_ADDSTRING Message
Adds a new string to the toolbar's string pool.
To send this message, call the SendMessage function as follows.
Syntax
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_ADDSTRING, // message ID
(WPARAM) wParam, // = (WPARAM) (HINSTANCE) hinst
(LPARAM) lParam // = (LPARAM)idString
);
Parameters
hinst
Handle to the module instance with an executable file that contains the string resource. If idString instead points to a character array with one or more strings, set this parameter to NULL.
idString
Resource identifier for the string resource, or a pointer to a TCHAR array. See Remarks.
Return Value
Remarks
If hinst is NULL, idString points to a character array with one or more null-terminated strings. The last string in the array must be terminated with two null characters.
If hinst is the HINSTANCE of the application or of another module containing a string resource, idString is the resource identifier of the string. Each item in the string must begin with an arbitrary separator character, and the string must end with two such characters. For example, the text for three buttons might appear in the string table as "/New/Open/Save//". The message returns the index of "New" in the toolbar's string pool, and the other items are in consecutive positions.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x421">
<name>TB_AUTOSIZE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TB_AUTOSIZE Message
Causes a toolbar to be resized.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_AUTOSIZE, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Remarks
An application sends the TB_AUTOSIZE message after causing the size of a toolbar to change either by setting the button or bitmap size or by adding strings for the first time.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x7">
<name>TB_BOTTOM</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x418">
<name>TB_BUTTONCOUNT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TB_BUTTONCOUNT Message
Retrieves a count of the buttons currently in the toolbar.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_BUTTONCOUNT, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x41e">
<name>TB_BUTTONSTRUCTSIZE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>cb</wname>
<wmisc>cb
Size, in bytes, of the TBBUTTON structure. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TB_BUTTONSTRUCTSIZE Message
Specifies the size of the TBBUTTON structure.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_BUTTONSTRUCTSIZE, // message ID
(WPARAM) wParam, // = (WPARAM) (int) cb;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
cb
Size, in bytes, of the TBBUTTON structure.
lParam
Must be zero.
Return Value
Remarks
The system uses the size to determine which version of the common control dynamic-link library (DLL) is being used.
If an application uses the CreateWindowEx function to create the toolbar, the application must send this message to the toolbar before sending the TB_ADDBITMAP or TB_ADDBUTTONS message. The CreateToolbarEx function automatically sends TB_BUTTONSTRUCTSIZE, and the size of the TBBUTTON structure is a parameter of the function.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x42b">
<name>TB_CHANGEBITMAP</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>idButton</wname>
<wmisc>idButton
Command identifier of the button that is to receive a new bitmap. </wmisc>
</wparam>
<lparam value="">
<lname>iBitmap</lname>
<lmisc>iBitmap
Zero-based index of an image in the toolbar's image list. The system displays the specified image in the button. Set this member to I_IMAGECALLBACK, and the toolbar will send the TBN_GETDISPINFO notification to retrieve the image index when it is needed.
Version 5.81. Set this member to I_IMAGENONE to indicate that the button does not have an image. The button layout will not include any space for a bitmap, only text.
</lmisc>
</lparam>
<misc>TB_CHANGEBITMAP Message
Changes the bitmap for a button in a toolbar.
To send this message, call the SendMessage function as follows.
Syntax
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_CHANGEBITMAP, // message ID
(WPARAM) wParam, // = (WPARAM) (int) idButton
(LPARAM) lParam // = (LPARAM) MAKELPARAM (iBitmap, 0)
);
Parameters
idButton
Command identifier of the button that is to receive a new bitmap.
iBitmap
Zero-based index of an image in the toolbar's image list. The system displays the specified image in the button. Set this member to I_IMAGECALLBACK, and the toolbar will send the TBN_GETDISPINFO notification to retrieve the image index when it is needed.
Version 5.81. Set this member to I_IMAGENONE to indicate that the button does not have an image. The button layout will not include any space for a bitmap, only text.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x402">
<name>TB_CHECKBUTTON</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>idButton</wname>
<wmisc>idButton
Command identifier of the button to check. </wmisc>
</wparam>
<lparam value="">
<lname>fCheck</lname>
<lmisc>fCheck
Check flag. If this parameter is TRUE, the check is added. If it is FALSE, the check is removed. </lmisc>
</lparam>
<misc>TB_CHECKBUTTON Message
Checks or unchecks a given button in a toolbar.
To send this message, call the SendMessage function as follows.
Syntax
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_CHECKBUTTON, // message ID
(WPARAM) wParam, // = (WPARAM) (int) idButton
(LPARAM) lParam // = (LPARAM) MAKELONG (fCheck, 0)
);
Parameters
idButton
Command identifier of the button to check.
fCheck
Check flag. If this parameter is TRUE, the check is added. If it is FALSE, the check is removed.
Return Value
Remarks
When a button is checked, it is displayed in the pressed state.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x419">
<name>TB_COMMANDTOINDEX</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>idButton</wname>
<wmisc>idButton
Command identifier associated with the button. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.
</lmisc>
</lparam>
<misc>TB_COMMANDTOINDEX Message
Retrieves the zero-based index for the button associated with the specified command identifier.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_COMMANDTOINDEX, // message ID
(WPARAM) wParam, // = (WPARAM) (int) idButton;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
idButton
Command identifier associated with the button.
lParam
Must be zero.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x41b">
<name>TB_CUSTOMIZE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TB_CUSTOMIZE Message
Displays the Customize Toolbar dialog box.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_CUSTOMIZE, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Remarks
Note The toolbar must handle the TBN_QUERYINSERT and TBN_QUERYDELETE notifications for the Customize Toolbar dialog box to appear. If the toolbar does not handle those notifications, TB_CUSTOMIZE has no effect.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="416">
<name>TB_DELETEBUTTON</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>iButton</wname>
<wmisc>iButton
Zero-based index of the button to delete. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TB_DELETEBUTTON Message
Deletes a button from the toolbar.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_DELETEBUTTON, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iButton;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
iButton
Zero-based index of the button to delete.
lParam
Must be zero.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x401">
<name>TB_ENABLEBUTTON</name>
<return value="BOOL">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns TRUE if successful, or FALSE otherwise. </returnmisc>
</return>
<wparam value="int">
<wname>idButton</wname>
<wmisc>idButton
Command identifier of the button to enable or disable.</wmisc>
</wparam>
<lparam value="">
<lname>fEnable</lname>
<lmisc>fEnable
Enable flag. If this parameter is TRUE, the button is enabled. If it is FALSE, the button is disabled.
</lmisc>
</lparam>
<misc>TB_ENABLEBUTTON Message
Enables or disables the specified button in a toolbar.
To send this message, call the SendMessage function as follows.
Syntax
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_ENABLEBUTTON, // message ID
(WPARAM) wParam, // = (WPARAM) (int) idButton
(LPARAM) lParam // = (LPARAM) MAKELONG (fEnable, 0)
);
Parameters
idButton
Command identifier of the button to enable or disable.
fEnable
Enable flag. If this parameter is TRUE, the button is enabled. If it is FALSE, the button is disabled.
Return Value
Returns TRUE if successful, or FALSE otherwise.
Remarks
When a button has been enabled, it can be pressed and checked.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x408">
<name>TB_ENDTRACK</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x44a">
<name>TB_GETANCHORHIGHLIGHT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TB_GETANCHORHIGHLIGHT Message
Retrieves the anchor highlight setting for a toolbar.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_GETANCHORHIGHLIGHT, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x42c">
<name>TB_GETBITMAP</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns the index of the bitmap if successful, or zero otherwise. </returnmisc>
</return>
<wparam value="int">
<wname>idButton</wname>
<wmisc>idButton
Command identifier of the button whose bitmap index is to be retrieved. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TB_GETBITMAP Message
Retrieves the index of the bitmap associated with a button in a toolbar.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_GETBITMAP, // message ID
(WPARAM) wParam, // = (WPARAM) (int) idButton;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
idButton
Command identifier of the button whose bitmap index is to be retrieved.
lParam
Must be zero.
Return Value
Returns the index of the bitmap if successful, or zero otherwise.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x429">
<name>TB_GETBITMAPFLAGS</name>
<return value="DWORD">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns a DWORD value that describes the type of bitmap that should be used. If this return value has the TBBF_LARGE flag set, applications should use large bitmaps (24 x 24); otherwise, applications should use small bitmaps (16 x 16). All other bits are reserved.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TB_GETBITMAPFLAGS Message
Retrieves the flags that describe the type of bitmap to be used.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_GETBITMAPFLAGS, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Returns a DWORD value that describes the type of bitmap that should be used. If this return value has the TBBF_LARGE flag set, applications should use large bitmaps (24 x 24); otherwise, applications should use small bitmaps (16 x 16). All other bits are reserved.
Remarks
The value returned by TB_GETBITMAPFLAGS is only advisory. The toolbar control recommends large or small bitmaps based upon whether the user has chosen large or small fonts.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x417">
<name>TB_GETBUTTON</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>iButton</wname>
<wmisc>iButton
Zero-based index of the button for which to retrieve information. </wmisc>
</wparam>
<lparam value="LPTBBUTTON">
<lname>lpButton</lname>
<lmisc>lpButton
Pointer to the TBBUTTON structure that receives the button information.
</lmisc>
</lparam>
<misc>TB_GETBUTTON Message
Retrieves information about the specified button in a toolbar.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_GETBUTTON, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iButton;
(LPARAM) lParam // = (LPARAM) (LPTBBUTTON) lpButton;
);
Parameters
iButton
Zero-based index of the button for which to retrieve information.
lpButton
Pointer to the TBBUTTON structure that receives the button information.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x441">
<name>TB_GETBUTTONINFOA</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="INT">
<wname>iID</wname>
<wmisc>iID
Command identifier of the button. </wmisc>
</wparam>
<lparam value="LPTBBUTTONINFO">
<lname>lptbbi</lname>
<lmisc>lptbbi
Pointer to a TBBUTTONINFO structure that receives the button information. The cbSize and dwMask members of this structure must be filled in prior to sending this message.
</lmisc>
</lparam>
<misc>TB_GETBUTTONINFO Message
Retrieves extended information for a button in a toolbar.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_GETBUTTONINFO, // message ID
(WPARAM) wParam, // = (WPARAM) (INT) iID;
(LPARAM) lParam // = (LPARAM) (LPTBBUTTONINFO) lptbbi;
);
Parameters
iID
Command identifier of the button.
lptbbi
Pointer to a TBBUTTONINFO structure that receives the button information. The cbSize and dwMask members of this structure must be filled in prior to sending this message.
Return Value
Remarks
When you use TB_ADDBUTTONS or TB_INSERTBUTTON to place buttons on the toolbar, the button text is commonly specified by its string pool index. TB_GETBUTTONINFO will not retrieve this string. To use TB_GETBUTTONINFO to retrieve button text, you must first set the text string with TB_SETBUTTONINFO. Once you have set the button text with TB_SETBUTTONINFO, you can no longer use the string pool index.
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x43f">
<name>TB_GETBUTTONINFOW</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="INT">
<wname>iID</wname>
<wmisc>iID
Command identifier of the button. </wmisc>
</wparam>
<lparam value="LPTBBUTTONINFO">
<lname>lptbbi</lname>
<lmisc>lptbbi
Pointer to a TBBUTTONINFO structure that receives the button information. The cbSize and dwMask members of this structure must be filled in prior to sending this message.
</lmisc>
</lparam>
<misc>TB_GETBUTTONINFO Message
Retrieves extended information for a button in a toolbar.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_GETBUTTONINFO, // message ID
(WPARAM) wParam, // = (WPARAM) (INT) iID;
(LPARAM) lParam // = (LPARAM) (LPTBBUTTONINFO) lptbbi;
);
Parameters
iID
Command identifier of the button.
lptbbi
Pointer to a TBBUTTONINFO structure that receives the button information. The cbSize and dwMask members of this structure must be filled in prior to sending this message.
Return Value
Remarks
When you use TB_ADDBUTTONS or TB_INSERTBUTTON to place buttons on the toolbar, the button text is commonly specified by its string pool index. TB_GETBUTTONINFO will not retrieve this string. To use TB_GETBUTTONINFO to retrieve button text, you must first set the text string with TB_SETBUTTONINFO. Once you have set the button text with TB_SETBUTTONINFO, you can no longer use the string pool index.
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x43a">
<name>TB_GETBUTTONSIZE</name>
<return value="DWORD">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns a DWORD value that contains the width and height values in the low word and high word, respectively.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.
</lmisc>
</lparam>
<misc>TB_GETBUTTONSIZE Message
Retrieves the current width and height of toolbar buttons, in pixels.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_GETBUTTONSIZE, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Returns a DWORD value that contains the width and height values in the low word and high word, respectively.
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x42d">
<name>TB_GETBUTTONTEXTA</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns the length, in characters, of the string pointed to by lpszText. The length does not include the terminating null character. If unsuccessful, the return value is -1.
</returnmisc>
</return>
<wparam value="int">
<wname>idButton</wname>
<wmisc>idButton
Command identifier of the button whose text is to be retrieved. </wmisc>
</wparam>
<lparam value="LPTSTR">
<lname>lpszText</lname>
<lmisc>lpszText
Pointer to a buffer that receives the button text. </lmisc>
</lparam>
<misc>TB_GETBUTTONTEXT Message
Retrieves the display text of a button on a toolbar.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_GETBUTTONTEXT, // message ID
(WPARAM) wParam, // = (WPARAM) (int) idButton;
(LPARAM) lParam // = (LPARAM) (LPTSTR) lpszText;
);
Parameters
idButton
Command identifier of the button whose text is to be retrieved.
lpszText
Pointer to a buffer that receives the button text.
Return Value
Returns the length, in characters, of the string pointed to by lpszText. The length does not include the terminating null character. If unsuccessful, the return value is -1.
Remarks
security note Security Alert Using this message incorrectly might compromise the security of your program. This message does not provide a way for you to know the size of the buffer. If you use this message, first call the message passing NULL in the lParam, this returns the number of characters, excluding NULL that are required. Then call the message a second time to retrieve the string. You should review the Security Considerations: Microsoft Windows Controls before continuing.
The returned string corresponds to the text that is currently displayed by the button.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x44b">
<name>TB_GETBUTTONTEXTW</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns the length, in characters, of the string pointed to by lpszText. The length does not include the terminating null character. If unsuccessful, the return value is -1.
</returnmisc>
</return>
<wparam value="int">
<wname>idButton</wname>
<wmisc>idButton
Command identifier of the button whose text is to be retrieved. </wmisc>
</wparam>
<lparam value="LPTSTR">
<lname>lpszText</lname>
<lmisc>lpszText
Pointer to a buffer that receives the button text. </lmisc>
</lparam>
<misc>TB_GETBUTTONTEXT Message
Retrieves the display text of a button on a toolbar.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_GETBUTTONTEXT, // message ID
(WPARAM) wParam, // = (WPARAM) (int) idButton;
(LPARAM) lParam // = (LPARAM) (LPTSTR) lpszText;
);
Parameters
idButton
Command identifier of the button whose text is to be retrieved.
lpszText
Pointer to a buffer that receives the button text.
Return Value
Returns the length, in characters, of the string pointed to by lpszText. The length does not include the terminating null character. If unsuccessful, the return value is -1.
Remarks
security note Security Alert Using this message incorrectly might compromise the security of your program. This message does not provide a way for you to know the size of the buffer. If you use this message, first call the message passing NULL in the lParam, this returns the number of characters, excluding NULL that are required. Then call the message a second time to retrieve the string. You should review the Security Considerations: Microsoft Windows Controls before continuing.
The returned string corresponds to the text that is currently displayed by the button.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x437">
<name>TB_GETDISABLEDIMAGELIST</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TB_GETDISABLEDIMAGELIST Message
Retrieves the image list that a toolbar control uses to display inactive buttons.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_GETDISABLEDIMAGELIST, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x455">
<name>TB_GETEXTENDEDSTYLE</name>
<return value="DWORD">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns a DWORD that represents the styles currently in use for the toolbar control. This value can be a combination of extended styles.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TB_GETEXTENDEDSTYLE Message
Retrieves the extended styles for a toolbar control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_GETEXTENDEDSTYLE, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Returns a DWORD that represents the styles currently in use for the toolbar control. This value can be a combination of extended styles.
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x435">
<name>TB_GETHOTIMAGELIST</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TB_GETHOTIMAGELIST Message
Retrieves the image list that a toolbar control uses to display hot buttons.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_GETHOTIMAGELIST, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Remarks
A button is hot when the cursor is over it. Toolbar controls must have the TBSTYLE_FLAT or TBSTYLE_LIST style to have hot items.
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x447">
<name>TB_GETHOTITEM</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns the index of the hot item, or -1 if no hot item is set. Toolbar controls that do not have the TBSTYLE_FLAT style do not have hot items.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TB_GETHOTITEM Message
Retrieves the index of the hot item in a toolbar.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_GETHOTITEM, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Returns the index of the hot item, or -1 if no hot item is set. Toolbar controls that do not have the TBSTYLE_FLAT style do not have hot items.
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x431">
<name>TB_GETIMAGELIST</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TB_GETIMAGELIST Message
Retrieves the image list that a toolbar control uses to display buttons in their default state. A toolbar control uses this image list to display buttons when they are not hot or disabled.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_GETIMAGELIST, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x44f">
<name>TB_GETINSERTMARK</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPTBINSERTMARK">
<lname>lptbim</lname>
<lmisc>lptbim
Pointer to a TBINSERTMARK structure that receives the insertion mark. </lmisc>
</lparam>
<misc>TB_GETINSERTMARK Message
Retrieves the current insertion mark for the toolbar.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_GETINSERTMARK, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPTBINSERTMARK) lptbim;
);
Parameters
wParam
Must be zero.
lptbim
Pointer to a TBINSERTMARK structure that receives the insertion mark.
Return Value
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x459">
<name>TB_GETINSERTMARKCOLOR</name>
<return value="COLORREF">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns a COLORREF value that contains the current insertion mark color. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TB_GETINSERTMARKCOLOR Message
Retrieves the color used to draw the insertion mark for the toolbar.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_GETINSERTMARKCOLOR, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Returns a COLORREF value that contains the current insertion mark color.
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x41d">
<name>TB_GETITEMRECT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>iButton</wname>
<wmisc>iButton
Zero-based index of the button for which to retrieve information. </wmisc>
</wparam>
<lparam value="RECT">
<lname>lprc</lname>
<lmisc>lprc
Pointer to a RECT structure that receives the coordinates of the bounding rectangle. </lmisc>
</lparam>
<misc>TB_GETITEMRECT Message
Retrieves the bounding rectangle of a button in a toolbar.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_GETITEMRECT, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iButton;
(LPARAM) lParam // = (LPARAM) (LPRECT) lprc;
);
Parameters
iButton
Zero-based index of the button for which to retrieve information.
lprc
Pointer to a RECT structure that receives the coordinates of the bounding rectangle.
Return Value
Remarks
This message does not retrieve the bounding rectangle for buttons whose state is set to the TBSTATE_HIDDEN value.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x453">
<name>TB_GETMAXSIZE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPSIZE">
<lname>lpSize</lname>
<lmisc>lpSize
Pointer to a SIZE structure that receives the size of the items. </lmisc>
</lparam>
<misc>TB_GETMAXSIZE Message
Retrieves the total size of all of the visible buttons and separators in the toolbar.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_GETMAXSIZE, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPSIZE) lpSize;
);
Parameters
wParam
Must be zero.
lpSize
Pointer to a SIZE structure that receives the size of the items.
Return Value
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x465">
<name>TB_GETMETRICS</name>
<return value="">
<returninfo>returns nothing in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="TBMETRICS">
<lname>ptbMetrics</lname>
<lmisc>ptbMetrics
Pointer to a TBMETRICS structure that receives the toolbar metrics.</lmisc>
</lparam>
<misc>TB_GETMETRICS Message
Retrieves the metrics of a toolbar control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns nothing in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_GETMETRICS, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (TBMETRICS) ptbMetrics;
);
Parameters
wParam
Must be zero.
ptbMetrics
Pointer to a TBMETRICS structure that receives the toolbar metrics.
Return Value
Remarks
Note To use this API, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.
Message Information
Header commctrl.h
Minimum operating systems Windows XP</misc>
</message>
<message value="0x43e">
<name>TB_GETOBJECT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="REFIID">
<wname>iid</wname>
<wmisc>iid
Identifier of the interface being requested. This value must point to IID_IDropTarget. </wmisc>
</wparam>
<lparam value="LPVOID">
<lname>ppvObject</lname>
<lmisc> ppvObject
Address that receives the interface pointer. If an error occurs, a NULL pointer is placed in this address. </lmisc>
</lparam>
<misc>TB_GETOBJECT Message
Retrieves the IDropTarget for a toolbar control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_GETOBJECT, // message ID
(WPARAM) wParam, // = (WPARAM) (REFIID) iid;
(LPARAM) lParam // = (LPARAM) (LPVOID*) ppvObject;
);
Parameters
iid
Identifier of the interface being requested. This value must point to IID_IDropTarget.
ppvObject
Address that receives the interface pointer. If an error occurs, a NULL pointer is placed in this address.
Return Value
Remarks
The toolbar's IDropTarget is used by the toolbar when objects are dragged over or dropped onto it.
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0
</misc>
</message>
<message value="0x456">
<name>TB_GETPADDING</name>
<return value="DWORD">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns a DWORD value that contains the horizontal padding in the low word and the vertical padding in the high word, in pixels.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TB_GETPADDING Message
Retrieves the padding for a toolbar control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_GETPADDING, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Returns a DWORD value that contains the horizontal padding in the low word and the vertical padding in the high word, in pixels.
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x433">
<name>TB_GETRECT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="INT">
<wname>iID</wname>
<wmisc>iID
Command identifier of the button. </wmisc>
</wparam>
<lparam value="RECT">
<lname>lprc</lname>
<lmisc>lprc
Pointer to a RECT structure that will receive the bounding rectangle information. </lmisc>
</lparam>
<misc>TB_GETRECT Message
Retrieves the bounding rectangle for a specified toolbar button.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_GETRECT, // message ID
(WPARAM) wParam, // = (WPARAM) (INT) iID;
(LPARAM) lParam // = (LPARAM) (LPRECT) lprc;
);
Parameters
iID
Command identifier of the button.
lprc
Pointer to a RECT structure that will receive the bounding rectangle information.
Return Value
Remarks
This message does not retrieve the bounding rectangle for buttons whose state is set to the TBSTATE_HIDDEN value.
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x428">
<name>TB_GETROWS</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TB_GETROWS Message
Retrieves the number of rows of buttons in a toolbar with the TBSTYLE_WRAPABLE style.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_GETROWS, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x412">
<name>TB_GETSTATE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns the button state information if successful, or -1 otherwise. The button state information can be a combination of the values listed in Toolbar Button States.
</returnmisc>
</return>
<wparam value="int">
<wname>idButton</wname>
<wmisc>idButton
Command identifier of the button for which to retrieve information. </wmisc>
</wparam>
<lparam value="">
<lname>wParam</lname>
<lmisc>wParam
Must be zero.</lmisc>
</lparam>
<misc>TB_GETSTATE Message
Retrieves information about the state of the specified button in a toolbar, such as whether it is enabled, pressed, or checked.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_GETSTATE, // message ID
(WPARAM) wParam, // = (WPARAM) (int) idButton;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
idButton
Command identifier of the button for which to retrieve information.
wParam
Must be zero.
Return Value
Returns the button state information if successful, or -1 otherwise. The button state information can be a combination of the values listed in Toolbar Button States.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x45c">
<name>TB_GETSTRINGA</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns the string length if successful, or -1 otherwise. </returnmisc>
</return>
<wparam value="">
<wname>cchMax, iString</wname>
<wmisc>iString
Index of the string.
cchMax
Length of the pszText buffer in bytes. </wmisc>
</wparam>
<lparam value="LPTSTR">
<lname>pszString</lname>
<lmisc>pszString
Pointer to a buffer used to return the string. </lmisc>
</lparam>
<misc>TB_GETSTRING Message
Retrieves a string from a toolbar's string pool.
To send this message, call the SendMessage function as follows.
Syntax
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_GETSTRING, // message ID
(WPARAM) wParam, // = (WPARAM) MAKEWPARAM (cchMax, iString)
(LPARAM) lParam // = (LPARAM) (LPTSTR) (pszString)
);
Parameters
iString
Index of the string.
cchMax
Length of the pszText buffer in bytes.
pszString
Pointer to a buffer used to return the string.
Return Value
Returns the string length if successful, or -1 otherwise.
Remarks
This message returns the specified string from the toolbar's string pool. It does not necessarily correspond to the text string currently being displayed by a button. To retrieve a button's current text string, send the toolbar a TB_GETBUTTONTEXT message.
Message Information
Minimum DLL Version comctl32.dll version 5.80 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 5, Windows 98, Windows 95 with Internet Explorer 5</misc>
</message>
<message value="0x45b">
<name>TB_GETSTRINGW</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns the string length if successful, or -1 otherwise. </returnmisc>
</return>
<wparam value="">
<wname>cchMax, iString</wname>
<wmisc>iString
Index of the string.
cchMax
Length of the pszText buffer in bytes. </wmisc>
</wparam>
<lparam value="LPTSTR">
<lname>pszString</lname>
<lmisc>pszString
Pointer to a buffer used to return the string. </lmisc>
</lparam>
<misc>TB_GETSTRING Message
Retrieves a string from a toolbar's string pool.
To send this message, call the SendMessage function as follows.
Syntax
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_GETSTRING, // message ID
(WPARAM) wParam, // = (WPARAM) MAKEWPARAM (cchMax, iString)
(LPARAM) lParam // = (LPARAM) (LPTSTR) (pszString)
);
Parameters
iString
Index of the string.
cchMax
Length of the pszText buffer in bytes.
pszString
Pointer to a buffer used to return the string.
Return Value
Returns the string length if successful, or -1 otherwise.
Remarks
This message returns the specified string from the toolbar's string pool. It does not necessarily correspond to the text string currently being displayed by a button. To retrieve a button's current text string, send the toolbar a TB_GETBUTTONTEXT message.
Message Information
Minimum DLL Version comctl32.dll version 5.80 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 5, Windows 98, Windows 95 with Internet Explorer 5</misc>
</message>
<message value="0x439">
<name>TB_GETSTYLE</name>
<return value="DWORD">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns a DWORD value that is a combination of toolbar control styles.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TB_GETSTYLE Message
Retrieves the styles currently in use for a toolbar control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_GETSTYLE, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Returns a DWORD value that is a combination of toolbar control styles.
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x43d">
<name>TB_GETTEXTROWS</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TB_GETTEXTROWS Message
Retrieves the maximum number of text rows that can be displayed on a toolbar button.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_GETTEXTROWS, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x423">
<name>TB_GETTOOLTIPS</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TB_GETTOOLTIPS Message
Retrieves the handle to the ToolTip control, if any, associated with the toolbar.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_GETTOOLTIPS, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95
</misc>
</message>
<message value="0x404">
<name>TB_HIDEBUTTON</name>
<return value="BOOL">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns TRUE if successful, or FALSE otherwise. </returnmisc>
</return>
<wparam value="int">
<wname>idButton</wname>
<wmisc>idButton
Command identifier of the button to hide or show. </wmisc>
</wparam>
<lparam value="">
<lname>fShow</lname>
<lmisc>fShow
Show flag. If this parameter is TRUE, the button is hidden. If it is FALSE, the button is shown. </lmisc>
</lparam>
<misc>TB_HIDEBUTTON Message
Hides or shows the specified button in a toolbar.
To send this message, call the SendMessage function as follows.
Syntax
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_HIDEBUTTON, // message ID
(WPARAM) wParam, // = (WPARAM) (int) idButton
(LPARAM) lParam // = (LPARAM) MAKELONG (fShow, 0)
);
Parameters
idButton
Command identifier of the button to hide or show.
fShow
Show flag. If this parameter is TRUE, the button is hidden. If it is FALSE, the button is shown.
Return Value
Returns TRUE if successful, or FALSE otherwise.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x445">
<name>TB_HITTEST</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPPOINT">
<lname>pptHitTest</lname>
<lmisc>pptHitTest
Pointer to a POINT structure that contains the x-coordinate of the hit test in the x member and the y-coordinate of the hit test in the y member. The coordinates are relative to the toolbar's client area.
</lmisc>
</lparam>
<misc>TB_HITTEST Message
Determines where a point lies in a toolbar control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_HITTEST, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPPOINT) pptHitTest;
);
Parameters
wParam
Must be zero.
pptHitTest
Pointer to a POINT structure that contains the x-coordinate of the hit test in the x member and the y-coordinate of the hit test in the y member. The coordinates are relative to the toolbar's client area.
Return Value
Message Information
Minimum DLL Version comctl32.dll version 4.00 or later
Header commctrl.h
Minimum operating systems Windows NT 4.0, Windows 95</misc>
</message>
<message value="0x405">
<name>TB_INDETERMINATE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>idButton</wname>
<wmisc>idButton
Command identifier of the button whose indeterminate state is to be set or cleared. </wmisc>
</wparam>
<lparam value="">
<lname>fIndeterminate</lname>
<lmisc>fIndeterminate
Indeterminate flag. If this parameter is TRUE, the indeterminate state is set. If it is FALSE, the state is cleared.
</lmisc>
</lparam>
<misc>TB_INDETERMINATE Message
Sets or clears the indeterminate state of the specified button in a toolbar.
To send this message, call the SendMessage function as follows.
Syntax
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_INDETERMINATE, // message ID
(WPARAM) wParam, // = (WPARAM) (int) idButton
(LPARAM) lParam // = (LPARAM) MAKELONG (fIndeterminate, 0)
);
Parameters
idButton
Command identifier of the button whose indeterminate state is to be set or cleared.
fIndeterminate
Indeterminate flag. If this parameter is TRUE, the indeterminate state is set. If it is FALSE, the state is cleared.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x415">
<name>TB_INSERTBUTTON</name>
<return value="BOOL">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns TRUE if successful, or FALSE otherwise.</returnmisc>
</return>
<wparam value="int">
<wname>iButton</wname>
<wmisc>iButton
Zero-based index of a button. The message inserts the new button to the left of this button.</wmisc>
</wparam>
<lparam value="LPTBBUTTON">
<lname>lpButton</lname>
<lmisc>lpButton
Pointer to a TBBUTTON structure containing information about the button to insert. </lmisc>
</lparam>
<misc>TB_INSERTBUTTON Message
Inserts a button in a toolbar.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_INSERTBUTTON, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iButton;
(LPARAM) lParam // = (LPARAM) (LPTBBUTTON) lpButton;
);
Parameters
iButton
Zero-based index of a button. The message inserts the new button to the left of this button.
lpButton
Pointer to a TBBUTTON structure containing information about the button to insert.
Return Value
Returns TRUE if successful, or FALSE otherwise.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x443">
<name>TB_INSERTBUTTONW</name>
<return value="BOOL">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns TRUE if successful, or FALSE otherwise.</returnmisc>
</return>
<wparam value="int">
<wname>iButton</wname>
<wmisc>iButton
Zero-based index of a button. The message inserts the new button to the left of this button.</wmisc>
</wparam>
<lparam value="LPTBBUTTON">
<lname>lpButton</lname>
<lmisc>lpButton
Pointer to a TBBUTTON structure containing information about the button to insert. </lmisc>
</lparam>
<misc>TB_INSERTBUTTON Message
Inserts a button in a toolbar.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_INSERTBUTTON, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iButton;
(LPARAM) lParam // = (LPARAM) (LPTBBUTTON) lpButton;
);
Parameters
iButton
Zero-based index of a button. The message inserts the new button to the left of this button.
lpButton
Pointer to a TBBUTTON structure containing information about the button to insert.
Return Value
Returns TRUE if successful, or FALSE otherwise.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x451">
<name>TB_INSERTMARKHITTEST</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="LPPOINT">
<wname>lppt</wname>
<wmisc>lppt
Pointer to a POINT structure that contains the hit test coordinates, relative to the client area of the toolbar.
</wmisc>
</wparam>
<lparam value="LPTBINSERTMARK">
<lname>lptbim</lname>
<lmisc>lptbim
Pointer to a TBINSERTMARK structure that receives the insertion mark information. </lmisc>
</lparam>
<misc>TB_INSERTMARKHITTEST Message
Retrieves the insertion mark information for a point in a toolbar.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_INSERTMARKHITTEST, // message ID
(WPARAM) wParam, // = (WPARAM) (LPPOINT) lppt;
(LPARAM) lParam // = (LPARAM) (LPTBINSERTMARK) lptbim;
);
Parameters
lppt
Pointer to a POINT structure that contains the hit test coordinates, relative to the client area of the toolbar.
lptbim
Pointer to a TBINSERTMARK structure that receives the insertion mark information.
Return Value
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x40a">
<name>TB_ISBUTTONCHECKED</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>idButton</wname>
<wmisc>idButton
Command identifier of the button.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TB_ISBUTTONCHECKED Message
Determines whether the specified button in a toolbar is checked.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_ISBUTTONCHECKED, // message ID
(WPARAM) wParam, // = (WPARAM) (int) idButton;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
idButton
Command identifier of the button.
lParam
Must be zero.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x409">
<name>TB_ISBUTTONENABLED</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>idButton</wname>
<wmisc>idButton
Command identifier of the button. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TB_ISBUTTONENABLED Message
Determines whether the specified button in a toolbar is enabled.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_ISBUTTONENABLED, // message ID
(WPARAM) wParam, // = (WPARAM) (int) idButton;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
idButton
Command identifier of the button.
lParam
Must be zero.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x40c">
<name>TB_ISBUTTONHIDDEN</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>idButton</wname>
<wmisc>idButton
Command identifier of the button. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TB_ISBUTTONHIDDEN Message
Determines whether the specified button in a toolbar is hidden.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_ISBUTTONHIDDEN, // message ID
(WPARAM) wParam, // = (WPARAM) (int) idButton;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
idButton
Command identifier of the button.
lParam
Must be zero.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x40e">
<name>TB_ISBUTTONHIGHLIGHTED</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>idButton</wname>
<wmisc>idButton
Command identifier for a toolbar button.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TB_ISBUTTONHIGHLIGHTED Message
Checks the highlight state of a toolbar button.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_ISBUTTONHIGHLIGHTED, // message ID
(WPARAM) wParam, // = (WPARAM) (int) idButton;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
idButton
Command identifier for a toolbar button.
lParam
Must be zero.
Return Value
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x40d">
<name>TB_ISBUTTONINDETERMINATE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>idButton</wname>
<wmisc>idButton
Command identifier of the button.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TB_ISBUTTONINDETERMINATE Message
Determines whether the specified button in a toolbar is indeterminate.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_ISBUTTONINDETERMINATE, // message ID
(WPARAM) wParam, // = (WPARAM) (int) idButton;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
idButton
Command identifier of the button.
lParam
Must be zero.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x40b">
<name>TB_ISBUTTONPRESSED</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>idButton</wname>
<wmisc>idButton
Command identifier of the button. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TB_ISBUTTONPRESSED Message
Determines whether the specified button in a toolbar is pressed.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_ISBUTTONPRESSED, // message ID
(WPARAM) wParam, // = (WPARAM) (int) idButton;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
idButton
Command identifier of the button.
lParam
Must be zero.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1">
<name>TB_LINEDOWN</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x0">
<name>TB_LINEUP</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x432">
<name>TB_LOADIMAGES</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="INT">
<wname>iBitmapID</wname>
<wmisc>iBitmapID
Identifier of a system-defined button image list. This parameter can be set to one of the following values.
IDB_HIST_LARGE_COLOR
Microsoft Windows Explorer bitmaps in large size.
IDB_HIST_SMALL_COLOR
Windows Explorer bitmaps in small size.
IDB_STD_LARGE_COLOR
Standard bitmaps in large size.
IDB_STD_SMALL_COLOR
Standard bitmaps in small size.
IDB_VIEW_LARGE_COLOR
View bitmaps in large size.
IDB_VIEW_SMALL_COLOR
View bitmaps in small size.
IDB_HIST_NORMAL
Windows Explorer travel buttons and favorites bitmaps in normal state.
IDB_HIST_HOT
Windows Explorer travel buttons and favorites bitmaps in hot state.
IDB_HIST_DISABLED
Windows Explorer travel buttons and favorites bitmaps in disabled state.
IDB_HIST_PRESSED
Windows Explorer travel buttons and favorites bitmaps in pressed state.</wmisc>
</wparam>
<lparam value="HINSTANCE">
<lname>hinst</lname>
<lmisc>hinst
Instance handle. This parameter must be set to HINST_COMMCTRL. </lmisc>
</lparam>
<misc>TB_LOADIMAGES Message
Loads system-defined button images into a toolbar control's image list.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_LOADIMAGES, // message ID
(WPARAM) wParam, // = (WPARAM) (INT) iBitmapID;
(LPARAM) lParam // = (LPARAM) (HINSTANCE) hinst;
);
Parameters
iBitmapID
Identifier of a system-defined button image list. This parameter can be set to one of the following values.
IDB_HIST_LARGE_COLOR
Microsoft Windows Explorer bitmaps in large size.
IDB_HIST_SMALL_COLOR
Windows Explorer bitmaps in small size.
IDB_STD_LARGE_COLOR
Standard bitmaps in large size.
IDB_STD_SMALL_COLOR
Standard bitmaps in small size.
IDB_VIEW_LARGE_COLOR
View bitmaps in large size.
IDB_VIEW_SMALL_COLOR
View bitmaps in small size.
IDB_HIST_NORMAL
Windows Explorer travel buttons and favorites bitmaps in normal state.
IDB_HIST_HOT
Windows Explorer travel buttons and favorites bitmaps in hot state.
IDB_HIST_DISABLED
Windows Explorer travel buttons and favorites bitmaps in disabled state.
IDB_HIST_PRESSED
Windows Explorer travel buttons and favorites bitmaps in pressed state.
hinst
Instance handle. This parameter must be set to HINST_COMMCTRL.
Return Value
Remarks
You must use the proper image index values when you prepare TBBUTTON structures prior to sending the TB_ADDBUTTONS message. For a list of image index values for these preset bitmaps, see Toolbar Standard Button Image Index Values.
Example
The following sample code loads the system standard small color images.
Copy Code
// hWndToobar is the window handle of the toolbar control.
SendMessage(hWndToolbar, TB_LOADIMAGES, (WPARAM)IDB_STD_SMALL_COLOR, (LPARAM)HINST_COMMCTRL);
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x44e">
<name>TB_MAPACCELERATORA</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns a nonzero value if one of the buttons has chAccel as its accelerator character, or zero otherwise.</returnmisc>
</return>
<wparam value="TCHAR">
<wname>chAccel</wname>
<wmisc>chAccel
[in] The accelerator character. </wmisc>
</wparam>
<lparam value="LPUINT">
<lname>pIDBtn</lname>
<lmisc>pIDBtn
[out] Pointer to a UINT. On return, if successful, this parameter will hold the id of the button that has chAccel as its accelerator character.
</lmisc>
</lparam>
<misc>TB_MAPACCELERATOR Message
Determines the ID of the button that corresponds to the specified accelerator character.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_MAPACCELERATOR, // message ID
(WPARAM) wParam, // = (WPARAM) (TCHAR) chAccel;
(LPARAM) lParam // = (LPARAM) (LPUINT) pIDBtn;
);
Parameters
chAccel
[in] The accelerator character.
pIDBtn
[out] Pointer to a UINT. On return, if successful, this parameter will hold the id of the button that has chAccel as its accelerator character.
Return Value
Returns a nonzero value if one of the buttons has chAccel as its accelerator character, or zero otherwise.
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x45a">
<name>TB_MAPACCELERATORW</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns a nonzero value if one of the buttons has chAccel as its accelerator character, or zero otherwise.</returnmisc>
</return>
<wparam value="TCHAR">
<wname>chAccel</wname>
<wmisc>chAccel
[in] The accelerator character. </wmisc>
</wparam>
<lparam value="LPUINT">
<lname>pIDBtn</lname>
<lmisc>pIDBtn
[out] Pointer to a UINT. On return, if successful, this parameter will hold the id of the button that has chAccel as its accelerator character.
</lmisc>
</lparam>
<misc>TB_MAPACCELERATOR Message
Determines the ID of the button that corresponds to the specified accelerator character.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_MAPACCELERATOR, // message ID
(WPARAM) wParam, // = (WPARAM) (TCHAR) chAccel;
(LPARAM) lParam // = (LPARAM) (LPUINT) pIDBtn;
);
Parameters
chAccel
[in] The accelerator character.
pIDBtn
[out] Pointer to a UINT. On return, if successful, this parameter will hold the id of the button that has chAccel as its accelerator character.
Return Value
Returns a nonzero value if one of the buttons has chAccel as its accelerator character, or zero otherwise.
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x406">
<name>TB_MARKBUTTON</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>idButton</wname>
<wmisc>idButton
Command identifier for a toolbar button. </wmisc>
</wparam>
<lparam value="">
<lname>fHighlight</lname>
<lmisc>fHighlight
Value that specifies the highlight state to be set. If this value is TRUE, the button is highlighted. If it's FALSE, the button is set to its default state.
</lmisc>
</lparam>
<misc>TB_MARKBUTTON Message
Sets the highlight state of a given button in a toolbar control.
To send this message, call the SendMessage function as follows.
Syntax
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_MARKBUTTON, // message ID
(WPARAM) wParam, // = (WPARAM) (int) idButton
(LPARAM) lParam // = (LPARAM) MAKELONG (fHighlight, 0)
);
Parameters
idButton
Command identifier for a toolbar button.
fHighlight
Value that specifies the highlight state to be set. If this value is TRUE, the button is highlighted. If it's FALSE, the button is set to its default state.
Return Value
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x452">
<name>TB_MOVEBUTTON</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="UINT">
<wname>uOldPos</wname>
<wmisc>uOldPos
Zero-based index of the button to be moved. </wmisc>
</wparam>
<lparam value="UINT">
<lname>uNewPos</lname>
<lmisc>uNewPos
Zero-based index where the button will be moved. </lmisc>
</lparam>
<misc>TB_MOVEBUTTON Message
Moves a button from one index to another.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_MOVEBUTTON, // message ID
(WPARAM) wParam, // = (WPARAM) (UINT) uOldPos;
(LPARAM) lParam // = (LPARAM) (UINT) uNewPos;
);
Parameters
uOldPos
Zero-based index of the button to be moved.
uNewPos
Zero-based index where the button will be moved.
Return Value
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x3">
<name>TB_PAGEDOWN</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x2">
<name>TB_PAGEUP</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x403">
<name>TB_PRESSBUTTON</name>
<return value="BOOL">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns TRUE if successful, or FALSE otherwise. </returnmisc>
</return>
<wparam value="int">
<wname>idButton</wname>
<wmisc>idButton
Command identifier of the button to press or release. </wmisc>
</wparam>
<lparam value="">
<lname>fPress</lname>
<lmisc>fPress
Press flag. If this parameter is TRUE, the button is pressed. If it is FALSE, the button is released. </lmisc>
</lparam>
<misc>TB_PRESSBUTTON Message
Presses or releases the specified button in a toolbar.
To send this message, call the SendMessage function as follows.
Syntax
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_PRESSBUTTON, // message ID
(WPARAM) wParam, // = (WPARAM) (int) idButton
(LPARAM) lParam // = (LPARAM) MAKELONG (fPress, 0)
);
Parameters
idButton
Command identifier of the button to press or release.
fPress
Press flag. If this parameter is TRUE, the button is pressed. If it is FALSE, the button is released.
Return Value
Returns TRUE if successful, or FALSE otherwise.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x42e">
<name>TB_REPLACEBITMAP</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPTBREPLACEBITMAP">
<lname>ptbrb</lname>
<lmisc>ptbrb
Pointer to a TBREPLACEBITMAP structure that contains the information of the bitmap to be replaced and the new bitmap.
</lmisc>
</lparam>
<misc>TB_REPLACEBITMAP Message
Replaces an existing bitmap with a new bitmap.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_REPLACEBITMAP, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPTBREPLACEBITMAP) ptbrb;
);
Parameters
wParam
Must be zero.
ptbrb
Pointer to a TBREPLACEBITMAP structure that contains the information of the bitmap to be replaced and the new bitmap.
Return Value
Message Information
Minimum DLL Version comctl32.dll version 4.00 or later
Header commctrl.h
Minimum operating systems Windows NT 4.0, Windows 95</misc>
</message>
<message value="0x41a">
<name>TB_SAVERESTOREA</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="BOOL">
<wname>fSave</wname>
<wmisc>fSave
Save or restore flag. If this parameter is TRUE, the information is saved. If it is FALSE, the information is restored.
</wmisc>
</wparam>
<lparam value="TBSAVEPARAMS">
<lname>ptbsp</lname>
<lmisc>ptbsp
Pointer to a TBSAVEPARAMS structure that specifies the registry key, subkey, and value name for the toolbar state information.
</lmisc>
</lparam>
<misc>TB_SAVERESTORE Message
Send this message to initiate saving or restoring a toolbar state.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_SAVERESTORE, // message ID
(WPARAM) wParam, // = (WPARAM) (BOOL) fSave;
(LPARAM) lParam // = (LPARAM) (TBSAVEPARAMS*) ptbsp;
);
Parameters
fSave
Save or restore flag. If this parameter is TRUE, the information is saved. If it is FALSE, the information is restored.
ptbsp
Pointer to a TBSAVEPARAMS structure that specifies the registry key, subkey, and value name for the toolbar state information.
Return Value
Remarks
For version 4.72 and earlier, to use this message to save or restore a toolbar, the parent window of the toolbar control must implement a handler for the TBN_GETBUTTONINFO notification message. The toolbar issues this notification to retrieve information about each button as it is restored.
Version 5.80 includes a new save/restore option. At the beginning of the process, and as each button is saved or restored, your application will receive a TBN_SAVE or TBN_RESTORE notification. To use this option, you must implement notification handlers to provide the Shell with the bitmap and state information it needs to successfully save or restore the toolbar state.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x44c">
<name>TB_SAVERESTOREW</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="BOOL">
<wname>fSave</wname>
<wmisc>fSave
Save or restore flag. If this parameter is TRUE, the information is saved. If it is FALSE, the information is restored.
</wmisc>
</wparam>
<lparam value="TBSAVEPARAMS">
<lname>ptbsp</lname>
<lmisc>ptbsp
Pointer to a TBSAVEPARAMS structure that specifies the registry key, subkey, and value name for the toolbar state information.
</lmisc>
</lparam>
<misc>TB_SAVERESTORE Message
Send this message to initiate saving or restoring a toolbar state.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_SAVERESTORE, // message ID
(WPARAM) wParam, // = (WPARAM) (BOOL) fSave;
(LPARAM) lParam // = (LPARAM) (TBSAVEPARAMS*) ptbsp;
);
Parameters
fSave
Save or restore flag. If this parameter is TRUE, the information is saved. If it is FALSE, the information is restored.
ptbsp
Pointer to a TBSAVEPARAMS structure that specifies the registry key, subkey, and value name for the toolbar state information.
Return Value
Remarks
For version 4.72 and earlier, to use this message to save or restore a toolbar, the parent window of the toolbar control must implement a handler for the TBN_GETBUTTONINFO notification message. The toolbar issues this notification to retrieve information about each button as it is restored.
Version 5.80 includes a new save/restore option. At the beginning of the process, and as each button is saved or restored, your application will receive a TBN_SAVE or TBN_RESTORE notification. To use this option, you must implement notification handlers to provide the Shell with the bitmap and state information it needs to successfully save or restore the toolbar state.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x449">
<name>TB_SETANCHORHIGHLIGHT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="BOOL">
<wname>fAnchor</wname>
<wmisc>fAnchor
BOOL value that specifies if anchor highlighting is enabled or disabled. If this value is nonzero, anchor highlighting will be enabled. If this value is zero, anchor highlighting will be disabled.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TB_SETANCHORHIGHLIGHT Message
Sets the anchor highlight setting for a toolbar.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_SETANCHORHIGHLIGHT, // message ID
(WPARAM) wParam, // = (WPARAM) (BOOL) fAnchor;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
fAnchor
BOOL value that specifies if anchor highlighting is enabled or disabled. If this value is nonzero, anchor highlighting will be enabled. If this value is zero, anchor highlighting will be disabled.
lParam
Must be zero.
Return Value
Remarks
Anchor highlighting in a toolbar means that the last highlighted item will remain highlighted until another item is highlighted. This occurs even if the cursor leaves the toolbar control.
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x420">
<name>TB_SETBITMAPSIZE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname>dxBitmap, dyBitmap</lname>
<lmisc>dxBitmap
Width, in pixels, of the bitmapped images.
dyBitmap
Height, in pixels, of the bitmapped images. </lmisc>
</lparam>
<misc>TB_SETBITMAPSIZE Message
Sets the size of the bitmapped images to be added to a toolbar.
To send this message, call the SendMessage function as follows.
Syntax
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_SETBITMAPSIZE, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) MAKELONG (dxBitmap, dyBitmap)
);
Parameters
dxBitmap
Width, in pixels, of the bitmapped images.
dyBitmap
Height, in pixels, of the bitmapped images.
Return Value
Remarks
The size can be set only before adding any bitmaps to the toolbar. If an application does not explicitly set the bitmap size, the size defaults to 16 by 15 pixels.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x442">
<name>TB_SETBUTTONINFOA</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns nonzero if successful, or zero otherwise.</returnmisc>
</return>
<wparam value="INT">
<wname>iID</wname>
<wmisc>iID
Button identifier. </wmisc>
</wparam>
<lparam value="LPTBBUTTONINFO">
<lname></lname>
<lmisc>lptbbi
Pointer to a TBBUTTONINFO structure that contains the new button information. The cbSize and dwMask members of this structure must be filled in prior to sending this message.
</lmisc>
</lparam>
<misc>TB_SETBUTTONINFO Message
Sets the information for an existing button in a toolbar.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_SETBUTTONINFO, // message ID
(WPARAM) wParam, // = (WPARAM) (INT) iID;
(LPARAM) lParam // = (LPARAM) (LPTBBUTTONINFO) lptbbi;
);
Parameters
iID
Button identifier.
lptbbi
Pointer to a TBBUTTONINFO structure that contains the new button information. The cbSize and dwMask members of this structure must be filled in prior to sending this message.
Return Value
Returns nonzero if successful, or zero otherwise.
Remarks
Text is commonly assigned to buttons when they are added to a toolbar by specifying the index of a string in the toolbar's string pool. If you use a TB_SETBUTTONINFO to assign new text to a button, it will permanently override the text from the string pool. You can change the text by calling TB_SETBUTTONINFO again, but you cannot reassign the string from the string pool.
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x440">
<name>TB_SETBUTTONINFOW</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns nonzero if successful, or zero otherwise.</returnmisc>
</return>
<wparam value="INT">
<wname>iID</wname>
<wmisc>iID
Button identifier. </wmisc>
</wparam>
<lparam value="LPTBBUTTONINFO">
<lname></lname>
<lmisc>lptbbi
Pointer to a TBBUTTONINFO structure that contains the new button information. The cbSize and dwMask members of this structure must be filled in prior to sending this message.
</lmisc>
</lparam>
<misc>TB_SETBUTTONINFO Message
Sets the information for an existing button in a toolbar.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_SETBUTTONINFO, // message ID
(WPARAM) wParam, // = (WPARAM) (INT) iID;
(LPARAM) lParam // = (LPARAM) (LPTBBUTTONINFO) lptbbi;
);
Parameters
iID
Button identifier.
lptbbi
Pointer to a TBBUTTONINFO structure that contains the new button information. The cbSize and dwMask members of this structure must be filled in prior to sending this message.
Return Value
Returns nonzero if successful, or zero otherwise.
Remarks
Text is commonly assigned to buttons when they are added to a toolbar by specifying the index of a string in the toolbar's string pool. If you use a TB_SETBUTTONINFO to assign new text to a button, it will permanently override the text from the string pool. You can change the text by calling TB_SETBUTTONINFO again, but you cannot reassign the string from the string pool.
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x41f">
<name>TB_SETBUTTONSIZE</name>
<return value="BOOL">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns TRUE if successful, or FALSE otherwise. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>not used, must be zero </wmisc>
</wparam>
<lparam value="">
<lname>dxButton, dyButton</lname>
<lmisc></lmisc>
</lparam>
<misc>TB_SETBUTTONSIZE Message
Sets the size of buttons on a toolbar.
To send this message, call the SendMessage function as follows.
Syntax
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_SETBUTTONSIZE, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) MAKELONG (dxButton, dyButton)
);
Parameters
dxButton
Width, in pixels, of the buttons.
dyButton
Height, in pixels, of the buttons.
Return Value
Returns TRUE if successful, or FALSE otherwise.
Remarks
TB_SETBUTTONSIZE should generally be called after adding buttons.
Use TB_SETBUTTONWIDTH to set the maximum and minimum allowed widths for buttons before they are added. Use TB_SETBUTTONSIZE to set the actual size of buttons.
Example
The following example code sets the width of buttons to 80 pixels and the height to 30 pixels.
Copy Code
// hWndToolbar is a handle to the toolbar window.
SendMessage(hWndToolbar, TB_SETBUTTONSIZE, 0, MAKELPARAM(80, 30);
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x43b">
<name>TB_SETBUTTONWIDTH</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>not used, must be zero </wmisc>
</wparam>
<lparam value="">
<lname>cxMin, cxMax</lname>
<lmisc>cxMin
Minimum button width, in pixels. Toolbar buttons will never be narrower than this value.
cxMax
Maximum button width, in pixels. If button text is too wide, the control displays it with ellipsis points.
</lmisc>
</lparam>
<misc>TB_SETBUTTONWIDTH Message
Sets the minimum and maximum button widths in the toolbar control.
To send this message, call the SendMessage function as follows.
Syntax
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_SETBUTTONWIDTH, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) MAKELONG (cxMin, cxMax)
);
Parameters
cxMin
Minimum button width, in pixels. Toolbar buttons will never be narrower than this value.
cxMax
Maximum button width, in pixels. If button text is too wide, the control displays it with ellipsis points.
Return Value
Remarks
Use TB_SETBUTTONWIDTH to set the maximum and minimum allowed widths for buttons before they are added. Use TB_SETBUTTONSIZE to set the actual size of buttons.
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x42a">
<name>TB_SETCMDID</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="UINT">
<wname>index</wname>
<wmisc>index
Zero-based index of the button whose command identifier is to be set. </wmisc>
</wparam>
<lparam value="UINT">
<lname>cmdId</lname>
<lmisc>cmdId
Command identifier.</lmisc>
</lparam>
<misc>TB_SETCMDID Message
Sets the command identifier of a toolbar button.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_SETCMDID, // message ID
(WPARAM) wParam, // = (WPARAM) (UINT) index;
(LPARAM) lParam // = (LPARAM) (UINT) cmdId;
);
Parameters
index
Zero-based index of the button whose command identifier is to be set.
cmdId
Command identifier.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x436">
<name>TB_SETDISABLEDIMAGELIST</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="HIMAGELIST">
<lname>himlNewDisabled</lname>
<lmisc>himlNewDisabled
Handle to the image list that will be set. </lmisc>
</lparam>
<misc>TB_SETDISABLEDIMAGELIST Message
Sets the image list that the toolbar control will use to display disabled buttons.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_SETDISABLEDIMAGELIST, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (HIMAGELIST) himlNewDisabled;
);
Parameters
wParam
Must be zero.
himlNewDisabled
Handle to the image list that will be set.
Return Value
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x446">
<name>TB_SETDRAWTEXTFLAGS</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="DWORD">
<wname>dwMask</wname>
<wmisc>dwMask
One or more of the DT_ flags, specified in DrawText, that indicate which bits in dwDTFlags will be used when drawing the text.
</wmisc>
</wparam>
<lparam value="DWORD">
<lname>dwDTFlags</lname>
<lmisc>dwDTFlags
One or more of the DT_ flags, specified in DrawText, that indicate how the button text will be drawn. This value will be passed to the DrawText API when the button text is drawn.
</lmisc>
</lparam>
<misc>TB_SETDRAWTEXTFLAGS Message
Sets the text drawing flags for the toolbar.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_SETDRAWTEXTFLAGS, // message ID
(WPARAM) wParam, // = (WPARAM) (DWORD) dwMask;
(LPARAM) lParam // = (LPARAM) (DWORD) dwDTFlags;
);
Parameters
dwMask
One or more of the DT_ flags, specified in DrawText, that indicate which bits in dwDTFlags will be used when drawing the text.
dwDTFlags
One or more of the DT_ flags, specified in DrawText, that indicate how the button text will be drawn. This value will be passed to the DrawText API when the button text is drawn.
Return Value
Remarks
The dwMask parameter allows you to specify which flags will be used when drawing the text, even if these flags are turned off. For example, if you don't want the DT_CENTER flag used when drawing text, you would add the DT_CENTER flag to dwMask and not specify the DT_CENTER flag in dwDTFlags. This prevents the control from passing the DT_CENTER flag to the DrawText API.
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x454">
<name>TB_SETEXTENDEDSTYLE</name>
<return value="DWORD">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns a DWORD that represents the previous extended styles. This value can be a combination of extended styles.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="DWORD">
<lname>dwExStyle</lname>
<lmisc>dwExStyle
Value specifying the new extended styles. This parameter can be a combination of extended styles.
</lmisc>
</lparam>
<misc>TB_SETEXTENDEDSTYLE Message
Sets the extended styles for a toolbar control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_SETEXTENDEDSTYLE, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (DWORD) dwExStyle;
);
Parameters
wParam
Must be zero.
dwExStyle
Value specifying the new extended styles. This parameter can be a combination of extended styles.
Return Value
Returns a DWORD that represents the previous extended styles. This value can be a combination of extended styles.
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x434">
<name>TB_SETHOTIMAGELIST</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="HIMAGELIST">
<lname>himlNewHot</lname>
<lmisc>himlNewHot
Handle to the image list that will be set.
</lmisc>
</lparam>
<misc>TB_SETHOTIMAGELIST Message
Sets the image list that the toolbar control will use to display hot buttons.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_SETHOTIMAGELIST, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (HIMAGELIST) himlNewHot;
);
Parameters
wParam
Must be zero.
himlNewHot
Handle to the image list that will be set.
Return Value
Remarks
A button is hot when the cursor is over it. Toolbar controls must have the TBSTYLE_FLAT or TBSTYLE_LIST style to have hot items.
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x448">
<name>TB_SETHOTITEM</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="INT">
<wname>iHot</wname>
<wmisc>iHot
Index of the item that will be made hot. If this value is -1, none of the items will be hot.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TB_SETHOTITEM Message
Sets the hot item in a toolbar.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_SETHOTITEM, // message ID
(WPARAM) wParam, // = (WPARAM) (INT) iHot;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
iHot
Index of the item that will be made hot. If this value is -1, none of the items will be hot.
lParam
Must be zero.
Return Value
Remarks
The behavior of this message is not defined for toolbars that do not have the TBSTYLE_FLAT style.
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x430">
<name>TB_SETIMAGELIST</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="INT">
<wname>iImageID</wname>
<wmisc>iImageID
Version 5.80. The index of the list. If you use only one image list, or an earlier version of the common controls, set iImageID to zero. See Remarks for details on using multiple image lists.
</wmisc>
</wparam>
<lparam value="">
<lname>himlNew</lname>
<lmisc>himlNew
Handle to the image list to set. If this parameter is NULL, no images are displayed in the buttons.
</lmisc>
</lparam>
<misc>TB_SETIMAGELIST Message
Sets the image list that the toolbar uses to display buttons that are in their default state.
To send this message, call the SendMessage function as follows.
Syntax
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_SETIMAGELIST, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
-or-
(WPARAM) wParam, // = (WPARAM) (INT) iImageID //Version 5.80 or later
(LPARAM) lParam // = (LPARAM) himlNew
);
Parameters
iImageID
Version 5.80. The index of the list. If you use only one image list, or an earlier version of the common controls, set iImageID to zero. See Remarks for details on using multiple image lists.
himlNew
Handle to the image list to set. If this parameter is NULL, no images are displayed in the buttons.
Return Value
Remarks
Note Your application is responsible for freeing the image list after the toolbar is destroyed.
The TB_SETIMAGELIST message cannot be combined with TB_ADDBITMAP. It also cannot be used with toolbars created with CreateToolbarEx, which calls TB_ADDBITMAP internally. When you create a toolbar with CreateToolbarEx or use TB_ADDBITMAP to add images, the toolbar manages the image list internally. Attempting to modify it with TB_SETIMAGELIST has unpredictable consequences.
With version 5.80 or later of the common controls, button images need not come from the same image list. To use multiple image lists for your toolbar button images:
1. Enable multiple image lists by sending the toolbar control a CCM_SETVERSION message with iVersion set to 5.
2. For each image list you want to use, send the toolbar control a TB_SETIMAGELIST message. Set wParam to an application-defined iImageID value that will be used to identify the list. Set lParam to the list's HIMAGELIST handle.
3. For each button, set the iBitmap member of the button's TBBUTTON structure to MAKELONG(iIndex, iImageID). The iImageID value is the ID of the appropriate image list that was defined in step two. The iIndex value is the index of the particular image within that list.
4. Add the buttons by sending the toolbar control a TB_ADDBUTTONS message.
The following code fragment illustrates how to add five buttons to a toolbar, with images from three different image lists. Support for multiple image lists is enabled with a CCM_SETVERSION message. The image lists are then set and assigned IDs of 0-2. The buttons are assigned images from the image lists as follows:
* Button 0 is from image list zero (ahim[0]) with index of 1.
* Button 1 is from image list one (ahim[1]) with an index of 1.
* Button 2 is from image list two (ahim[2]) with an index of 1.
* Button 3 is from image list zero (ahim[0]) with an index of 2.
* Button 4 is from image list one (ahim[1]) with an index of 3.
Finally, the buttons are added to the toolbar control with a TB_ADDBUTTONS message.
Copy Code
//Enable multiple image lists
SendMessage(hwndTB, CCM_SETVERSION, (WPARAM) 5, 0);
//Set the image lists and assign them IDs of 0-2
SendMessage(hwndTB, TB_SETIMAGELIST, 0, (LPARAM)ahiml[0]);
SendMessage(hwndTB, TB_SETIMAGELIST, 1, (LPARAM)ahiml[1]);
SendMessage(hwndTB, TB_SETIMAGELIST, 2, (LPARAM)ahiml[2]);
// Create the five buttons
TBBUTTON rgtb[5];
//... initialize the TBBUTTON structures as usual ...
//Assign images to each button
rgtb[0].iBitmap = MAKELONG(1, 0);
rgtb[1].iBitmap = MAKELONG(1, 1);
rgtb[2].iBitmap = MAKELONG(1, 2);
rgtb[3].iBitmap = MAKELONG(2, 0);
rgtb[4].iBitmap = MAKELONG(3, 1);
// Add the five buttons to the toolbar control
SendMessage(hwndTB, TB_ADDBUTTONS, 5, (LPARAM)(rgtb);
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x42f">
<name>TB_SETINDENT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="INT">
<wname>iIndent</wname>
<wmisc>iIndent
Value specifying the indentation, in pixels. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TB_SETINDENT Message
Sets the indentation for the first button in a toolbar control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_SETINDENT, // message ID
(WPARAM) wParam, // = (WPARAM) (INT) iIndent;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
iIndent
Value specifying the indentation, in pixels.
lParam
Must be zero.
Return Value
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x450">
<name>TB_SETINSERTMARK</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPTBINSERTMARK">
<lname>lptbim</lname>
<lmisc>lptbim
Pointer to a TBINSERTMARK structure that contains the insertion mark. </lmisc>
</lparam>
<misc>TB_SETINSERTMARK Message
Sets the current insertion mark for the toolbar.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_SETINSERTMARK, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPTBINSERTMARK) lptbim;
);
Parameters
wParam
Must be zero.
lptbim
Pointer to a TBINSERTMARK structure that contains the insertion mark.
Return Value
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x458">
<name>TB_SETINSERTMARKCOLOR</name>
<return value="COLORREF">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns a COLORREF value that contains the previous insertion mark color.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="COLORREF">
<lname>clrInsertMark</lname>
<lmisc>clrInsertMark
COLORREF value that contains the new insertion mark color. </lmisc>
</lparam>
<misc>TB_SETINSERTMARKCOLOR Message
Sets the color used to draw the insertion mark for the toolbar.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_SETINSERTMARKCOLOR, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (COLORREF) clrInsertMark;
);
Parameters
wParam
Must be zero.
clrInsertMark
COLORREF value that contains the new insertion mark color.
Return Value
Returns a COLORREF value that contains the previous insertion mark color.
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x43c">
<name>TB_SETMAXTEXTROWS</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="INT">
<wname>iMaxRows</wname>
<wmisc>iMaxRows
Maximum number of rows of text that can be displayed. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TB_SETMAXTEXTROWS Message
Sets the maximum number of text rows displayed on a toolbar button.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_SETMAXTEXTROWS, // message ID
(WPARAM) wParam, // = (WPARAM) (INT) iMaxRows;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
iMaxRows
Maximum number of rows of text that can be displayed.
lParam
Must be zero.
Return Value
Remarks
To cause text to wrap, you must set the maximum button width by sending a TB_SETBUTTONWIDTH message. The text wraps at a word break; line breaks ("\n") in the text are ignored. Text in TBSTYLE_LIST toolbars is always shown on a single line.
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x466">
<name>TB_SETMETRICS</name>
<return value="">
<returninfo>returns nothing in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="TBMETRICS">
<lname>tbMetrics</lname>
<lmisc>tbMetrics
TBMETRICS structure that contains the toolbar metrics to set.</lmisc>
</lparam>
<misc>TB_SETMETRICS Message
Sets the metrics of a toolbar control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns nothing in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_SETMETRICS, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (TBMETRICS) tbMetrics;
);
Parameters
wParam
Must be zero.
tbMetrics
TBMETRICS structure that contains the toolbar metrics to set.
Return Value
Remarks
Note To use this API, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.
Message Information
Header commctrl.h
Minimum operating systems Windows XP</misc>
</message>
<message value="0x457">
<name>TB_SETPADDING</name>
<return value="DWORD">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns a DWORD value that contains the previous horizontal padding in the low word and the previous vertical padding in the high word, in pixels.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>not used, must be zero</wmisc>
</wparam>
<lparam value="">
<lname>cx, cy</lname>
<lmisc>cx
The horizontal padding, in pixels.
cy
The vertical padding, in pixels. </lmisc>
</lparam>
<misc>TB_SETPADDING Message
Sets the padding for a toolbar control.
To send this message, call the SendMessage function as follows.
Syntax
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_SETPADDING, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) MAKELPARAM (cx, cy)
);
Parameters
cx
The horizontal padding, in pixels.
cy
The vertical padding, in pixels.
Return Value
Returns a DWORD value that contains the previous horizontal padding in the low word and the previous vertical padding in the high word, in pixels.
Remarks
The padding values are used to create a blank area between the edge of the button and the button's image and/or text. The horizontal padding value is applied to both the right and left of the button, and the vertical padding value is applied to both the top and bottom of the button. Padding is only applied to buttons that have the TBSTYLE_AUTOSIZE style.
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x425">
<name>TB_SETPARENT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="HWND">
<wname>hwndParent</wname>
<wmisc>hwndParent
Handle to the window to receive notification messages. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.
</lmisc>
</lparam>
<misc>TB_SETPARENT Message
Sets the window to which the toolbar control sends notification messages.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_SETPARENT, // message ID
(WPARAM) wParam, // = (WPARAM) (HWND) hwndParent;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
hwndParent
Handle to the window to receive notification messages.
lParam
Must be zero.
Return Value
Remarks
The TB_SETPARENT message does not change the parent window that was specified when the control was created. Calling the GetParent function for a toolbar control will return the actual parent window, not the window specified in TB_SETPARENT. To change the control's parent window, call the SetParent function.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x427">
<name>TB_SETROWS</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>cRows, fLarger</wname>
<wmisc>cRows
Number of rows requested. The minimum number of rows is one, and the maximum number of rows is equal to the number of buttons in the toolbar.
fLarger
Flag that indicates whether to create more rows than requested when the system cannot create the number of rows specified by cRows. If this parameter is TRUE, the system creates more rows. If it is FALSE, the system creates fewer rows.
</wmisc>
</wparam>
<lparam value="RECT">
<lname>lprc</lname>
<lmisc>lprc
Pointer to a RECT structure that receives the bounding rectangle of the toolbar after the rows are set.
</lmisc>
</lparam>
<misc>TB_SETROWS Message
Sets the number of rows of buttons in a toolbar.
To send this message, call the SendMessage function as follows.
Syntax
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_SETROWS, // message ID
(WPARAM) wParam, // = (WPARAM) MAKEWPARAM (cRows, fLarger)
(LPARAM) lParam // = (LPARAM) (LPRECT) (lprc)
);
Parameters
cRows
Number of rows requested. The minimum number of rows is one, and the maximum number of rows is equal to the number of buttons in the toolbar.
fLarger
Flag that indicates whether to create more rows than requested when the system cannot create the number of rows specified by cRows. If this parameter is TRUE, the system creates more rows. If it is FALSE, the system creates fewer rows.
lprc
Pointer to a RECT structure that receives the bounding rectangle of the toolbar after the rows are set.
Return Value
Remarks
Because the system does not break up button groups when setting the number of rows, the resulting number of rows might differ from the number requested.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x411">
<name>TB_SETSTATE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>idButton</wname>
<wmisc>idButton
Command identifier of the button. </wmisc>
</wparam>
<lparam value="">
<lname>fState, 0</lname>
<lmisc>fState
State flags. This parameter can be a combination of the values listed in Toolbar Button States.
</lmisc>
</lparam>
<misc>TB_SETSTATE Message
Sets the state for the specified button in a toolbar.
To send this message, call the SendMessage function as follows.
Syntax
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_SETSTATE, // message ID
(WPARAM) wParam, // = (WPARAM) (int) idbutton
(LPARAM) lParam // = (LPARAM) MAKELONG (fState, 0)
);
Parameters
idButton
Command identifier of the button.
fState
State flags. This parameter can be a combination of the values listed in Toolbar Button States.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x438">
<name>TB_SETSTYLE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="DWORD">
<lname>dwStyle</lname>
<lmisc>dwStyle
Value specifying the styles to be set for the control. This value can be a combination of toolbar control styles.
</lmisc>
</lparam>
<misc>TB_SETSTYLE Message
Sets the style for a toolbar control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_SETSTYLE, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (DWORD) dwStyle;
);
Parameters
wParam
Must be zero.
dwStyle
Value specifying the styles to be set for the control. This value can be a combination of toolbar control styles.
Return Value
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x424">
<name>TB_SETTOOLTIPS</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="HWND">
<wname>hwndToolTip</wname>
<wmisc>hwndToolTip
Handle to the ToolTip control. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TB_SETTOOLTIPS Message
Associates a ToolTip control with a toolbar.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TB_SETTOOLTIPS, // message ID
(WPARAM) wParam, // = (WPARAM) (HWND) hwndToolTip;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
hwndToolTip
Handle to the ToolTip control.
lParam
Must be zero.
Return Value
Remarks
Any buttons added to a toolbar before sending the TB_SETTOOLTIPS message will not be registered with the ToolTip control.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x4">
<name>TB_THUMBPOSITION</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x5">
<name>TB_THUMBTRACK</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x6">
<name>TB_TOP</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x1328">
<name>TCM_ADJUSTRECT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="BOOL">
<wname>fLarger</wname>
<wmisc>fLarger
Operation to perform. If this parameter is TRUE, prc specifies a display rectangle and receives the corresponding window rectangle. If this parameter is FALSE, prc specifies a window rectangle and receives the corresponding display area.
</wmisc>
</wparam>
<lparam value="RECT">
<lname>prc</lname>
<lmisc>prc
Pointer to a RECT structure that specifies the given rectangle and receives the calculated rectangle. </lmisc>
</lparam>
<misc>TCM_ADJUSTRECT Message
Calculates a tab control's display area given a window rectangle, or calculates the window rectangle that would correspond to a specified display area. You can send this message explicitly or by using the TabCtrl_AdjustRect macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TCM_ADJUSTRECT, // message ID
(WPARAM) wParam, // = (WPARAM) (BOOL) fLarger;
(LPARAM) lParam // = (LPARAM) (LPRECT) prc;
);
Parameters
fLarger
Operation to perform. If this parameter is TRUE, prc specifies a display rectangle and receives the corresponding window rectangle. If this parameter is FALSE, prc specifies a window rectangle and receives the corresponding display area.
prc
Pointer to a RECT structure that specifies the given rectangle and receives the calculated rectangle.
Return Value
Remarks
This message applies only to tab controls that are at the top. It does not apply to tab controls that are on the sides or bottom.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95
</misc>
</message>
<message value="0x1309">
<name>TCM_DELETEALLITEMS</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TCM_DELETEALLITEMS Message
Removes all items from a tab control. You can send this message explicitly or by using the TabCtrl_DeleteAllItems macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TCM_DELETEALLITEMS, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1308">
<name>TCM_DELETEITEM</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>iItem</wname>
<wmisc>iItem
Index of the item to delete. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TCM_DELETEITEM Message
Removes an item from a tab control. You can send this message explicitly or by using the TabCtrl_DeleteItem macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TCM_DELETEITEM, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iItem;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
iItem
Index of the item to delete.
lParam
Must be zero.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1332">
<name>TCM_DESELECTALL</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="DWORD">
<wname>fExcludeFocus</wname>
<wmisc>fExcludeFocus
Flag that specifies the scope of the item deselection. If this parameter is set to FALSE, all tab items will be reset. If it is set to TRUE, then all tab items except for the one currently selected will be reset.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TCM_DESELECTALL Message
Resets items in a tab control, clearing any that were set to the TCIS_BUTTONPRESSED state. You can send this message explicitly or by using the TabCtrl_DeselectAll macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TCM_DESELECTALL, // message ID
(WPARAM) wParam, // = (WPARAM) (DWORD) fExcludeFocus;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
fExcludeFocus
Flag that specifies the scope of the item deselection. If this parameter is set to FALSE, all tab items will be reset. If it is set to TRUE, then all tab items except for the one currently selected will be reset.
lParam
Must be zero.
Return Value
Remarks
This message is only meaningful if the TCS_BUTTONS style flag has been set.
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x1300">
<name>TCM_FIRST</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x132f">
<name>TCM_GETCURFOCUS</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TCM_GETCURFOCUS Message
Returns the index of the item that has the focus in a tab control. You can send this message explicitly or by using the TabCtrl_GetCurFocus macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TCM_GETCURFOCUS, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Remarks
The item that has the focus may be different than the selected item.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x130b">
<name>TCM_GETCURSEL</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TCM_GETCURSEL Message
Determines the currently selected tab in a tab control. You can send this message explicitly or by using the TabCtrl_GetCurSel macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TCM_GETCURSEL, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1335">
<name>TCM_GETEXTENDEDSTYLE</name>
<return value="DWORD">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns a DWORD value that represents the extended styles currently in use for the tab control. This value is a combination of tab control extended styles.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TCM_GETEXTENDEDSTYLE Message
Retrieves the extended styles that are currently in use for the tab control. You can send this message explicitly or by using the TabCtrl_GetExtendedStyle macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TCM_GETEXTENDEDSTYLE, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Returns a DWORD value that represents the extended styles currently in use for the tab control. This value is a combination of tab control extended styles.
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x1302">
<name>TCM_GETIMAGELIST</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TCM_GETIMAGELIST Message
Retrieves the image list associated with a tab control. You can send this message explicitly or by using the TabCtrl_GetImageList macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TCM_GETIMAGELIST, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1305">
<name>TCM_GETITEMA</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>iItem</wname>
<wmisc>iItem
Index of the tab. </wmisc>
</wparam>
<lparam value="LPTCITEM">
<lname>pitem</lname>
<lmisc>pitem
Pointer to a TCITEM structure that specifies the information to retrieve and receives information about the tab. When the message is sent, the mask member specifies which attributes to return. If the mask member specifies the TCIF_TEXT value, the pszText member must contain the address of the buffer that receives the item text, and the cchTextMax member must specify the size of the buffer.
</lmisc>
</lparam>
<misc>TCM_GETITEM Message
Retrieves information about a tab in a tab control. You can send this message explicitly or by using the TabCtrl_GetItem macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TCM_GETITEM, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iItem;
(LPARAM) lParam // = (LPARAM) (LPTCITEM) pitem;
);
Parameters
iItem
Index of the tab.
pitem
Pointer to a TCITEM structure that specifies the information to retrieve and receives information about the tab. When the message is sent, the mask member specifies which attributes to return. If the mask member specifies the TCIF_TEXT value, the pszText member must contain the address of the buffer that receives the item text, and the cchTextMax member must specify the size of the buffer.
Return Value
Remarks
If the TCIF_TEXT flag is set in the mask member of the TCITEM structure, the control may change the pszText member of the structure to point to the new text instead of filling the buffer with the requested text. The control may set the pszText member to NULL to indicate that no text is associated with the item.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95
</misc>
</message>
<message value="0x1304">
<name>TCM_GETITEMCOUNT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TCM_GETITEMCOUNT Message
Retrieves the number of tabs in the tab control. You can send this message explicitly or by using the TabCtrl_GetItemCount macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TCM_GETITEMCOUNT, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x130a">
<name>TCM_GETITEMRECT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>iItem</wname>
<wmisc>iItem
Index of the tab. </wmisc>
</wparam>
<lparam value="RECT">
<lname>prc</lname>
<lmisc>prc
Pointer to a RECT structure that receives the bounding rectangle of the tab, in viewport coordinates.
</lmisc>
</lparam>
<misc>TCM_GETITEMRECT Message
Retrieves the bounding rectangle for a tab in a tab control. You can send this message explicitly or by using the TabCtrl_GetItemRect macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TCM_GETITEMRECT, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iItem;
(LPARAM) lParam // = (LPARAM) (RECT*) prc;
);
Parameters
iItem
Index of the tab.
prc
Pointer to a RECT structure that receives the bounding rectangle of the tab, in viewport coordinates.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x133c">
<name>TCM_GETITEMW</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>iItem</wname>
<wmisc>iItem
Index of the tab. </wmisc>
</wparam>
<lparam value="RECT">
<lname>prc</lname>
<lmisc>prc
Pointer to a RECT structure that receives the bounding rectangle of the tab, in viewport coordinates.
</lmisc>
</lparam>
<misc>TCM_GETITEMRECT Message
Retrieves the bounding rectangle for a tab in a tab control. You can send this message explicitly or by using the TabCtrl_GetItemRect macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TCM_GETITEMRECT, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iItem;
(LPARAM) lParam // = (LPARAM) (RECT*) prc;
);
Parameters
iItem
Index of the tab.
prc
Pointer to a RECT structure that receives the bounding rectangle of the tab, in viewport coordinates.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x132c">
<name>TCM_GETROWCOUNT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TCM_GETROWCOUNT Message
Retrieves the current number of rows of tabs in a tab control. You can send this message explicitly or by using the TabCtrl_GetRowCount macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TCM_GETROWCOUNT, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Remarks
Only tab controls that have the TCS_MULTILINE style can have multiple rows of tabs.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x132d">
<name>TCM_GETTOOLTIPS</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TCM_GETTOOLTIPS Message
Retrieves the handle to the ToolTip control associated with a tab control. You can send this message explicitly or by using the TabCtrl_GetToolTips macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TCM_GETTOOLTIPS, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Remarks
A tab control creates a ToolTip control if it has the TCS_TOOLTIPS style. You can also assign a ToolTip control to a tab control by using the TCM_SETTOOLTIPS message.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1333">
<name>TCM_HIGHLIGHTITEM</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="INT">
<wname>idItem</wname>
<wmisc>idItem
Zero-based index of a tab control item. </wmisc>
</wparam>
<lparam value="">
<lname>fHighlight, 0</lname>
<lmisc>fHighlight
Value specifying the highlight state to be set. If this value is TRUE, the tab is highlighted; if FALSE, the tab is set to its default state.
</lmisc>
</lparam>
<misc>TCM_HIGHLIGHTITEM Message
Sets the highlight state of a tab item. You can send this message explicitly or by using the TabCtrl_HighlightItem macro.
To send this message, call the SendMessage function as follows.
Syntax
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TCM_HIGHLIGHTITEM, // message ID
(WPARAM) wParam, // = (WPARAM) (INT) idItem
(LPARAM) lParam // = (LPARAM) MAKELONG (fHighlight, 0)
);
Parameters
idItem
Zero-based index of a tab control item.
fHighlight
Value specifying the highlight state to be set. If this value is TRUE, the tab is highlighted; if FALSE, the tab is set to its default state.
Return Value
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x130d">
<name>TCM_HITTEST</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPTCHITTESTINFO">
<lname>pinfo</lname>
<lmisc>pinfo
Pointer to a TCHITTESTINFO structure that specifies the screen position to test. </lmisc>
</lparam>
<misc>TCM_HITTEST Message
Determines which tab, if any, is at a specified screen position. You can send this message explicitly or by using the TabCtrl_HitTest macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TCM_HITTEST, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPTCHITTESTINFO) pinfo;
);
Parameters
wParam
Must be zero.
pinfo
Pointer to a TCHITTESTINFO structure that specifies the screen position to test.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1307">
<name>TCM_INSERTITEMA</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>iItem</wname>
<wmisc>iItem
Index of the new tab. </wmisc>
</wparam>
<lparam value="LPTCITEM">
<lname>pitem</lname>
<lmisc>pitem
Pointer to a TCITEM structure that specifies the attributes of the tab. The dwState and dwStateMask members of this structure are ignored by this message.
</lmisc>
</lparam>
<misc>TCM_INSERTITEM Message
Inserts a new tab in a tab control. You can send this message explicitly or by using the TabCtrl_InsertItem macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TCM_INSERTITEM, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iItem;
(LPARAM) lParam // = const (LPARAM) (LPTCITEM) pitem;
);
Parameters
iItem
Index of the new tab.
pitem
Pointer to a TCITEM structure that specifies the attributes of the tab. The dwState and dwStateMask members of this structure are ignored by this message.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x133e">
<name>TCM_INSERTITEMW</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>iItem</wname>
<wmisc>iItem
Index of the new tab. </wmisc>
</wparam>
<lparam value="LPTCITEM">
<lname>pitem</lname>
<lmisc>pitem
Pointer to a TCITEM structure that specifies the attributes of the tab. The dwState and dwStateMask members of this structure are ignored by this message.
</lmisc>
</lparam>
<misc>TCM_INSERTITEM Message
Inserts a new tab in a tab control. You can send this message explicitly or by using the TabCtrl_InsertItem macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TCM_INSERTITEM, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iItem;
(LPARAM) lParam // = const (LPARAM) (LPTCITEM) pitem;
);
Parameters
iItem
Index of the new tab.
pitem
Pointer to a TCITEM structure that specifies the attributes of the tab. The dwState and dwStateMask members of this structure are ignored by this message.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x132a">
<name>TCM_REMOVEIMAGE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>iImage</wname>
<wmisc>iImage
Index of the image to remove.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TCM_REMOVEIMAGE Message
Removes an image from a tab control's image list. You can send this message explicitly or by using the TabCtrl_RemoveImage macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TCM_REMOVEIMAGE, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iImage;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
iImage
Index of the image to remove.
lParam
Must be zero.
Return Value
Remarks
The tab control updates each tab's image index, so each tab remains associated with the same image as before. If a tab is using the image being removed, the tab will be set to have no image.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1330">
<name>TCM_SETCURFOCUS</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>iItem</wname>
<wmisc>iItem
Index of the tab that gets the focus.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TCM_SETCURFOCUS Message
Sets the focus to a specified tab in a tab control. You can send this message explicitly or by using the TabCtrl_SetCurFocus macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TCM_SETCURFOCUS, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iItem;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
iItem
Index of the tab that gets the focus.
lParam
Must be zero.
Return Value
Remarks
If the tab control has the TCS_BUTTONS style (button mode), the tab with the focus may be different from the selected tab. For example, when a tab is selected, the user can press the arrow keys to set the focus to a different tab without changing the selected tab. In button mode, TCM_SETCURFOCUS sets the input focus to the button associated with the specified tab, but it does not change the selected tab.
If the tab control does not have the TCS_BUTTONS style, changing the focus also changes the selected tab. In this case, the tab control sends the TCN_SELCHANGING and TCN_SELCHANGE notification messages to its parent window.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x130c">
<name>TCM_SETCURSEL</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>iItem</wname>
<wmisc>iItem
Index of the tab to select.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TCM_SETCURSEL Message
Selects a tab in a tab control. You can send this message explicitly or by using the TabCtrl_SetCurSel macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TCM_SETCURSEL, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iItem;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
iItem
Index of the tab to select.
lParam
Must be zero.
Return Value
Remarks
A tab control does not send a TCN_SELCHANGING or TCN_SELCHANGE notification message when a tab is selected using this message.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1334">
<name>TCM_SETEXTENDEDSTYLE</name>
<return value="DWORD">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns a DWORD value that contains the previous tab control extended styles.</returnmisc>
</return>
<wparam value="DWORD">
<wname>dwExMask</wname>
<wmisc>dwExMask
A DWORD value that indicates which styles in dwExStyle are to be affected. Only the extended styles in dwExMask will be changed. All other styles will be maintained as they are. If this parameter is zero, then all of the styles in dwExStyle will be affected.
</wmisc>
</wparam>
<lparam value="DWORD">
<lname>dwExStyle</lname>
<lmisc>dwExStyle
Value specifying the extended tab control styles. This value is a combination of tab control extended styles.
</lmisc>
</lparam>
<misc>TCM_SETEXTENDEDSTYLE Message
Sets the extended styles that the tab control will use. You can send this message explicitly or by using the TabCtrl_SetExtendedStyle macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TCM_SETEXTENDEDSTYLE, // message ID
(WPARAM) wParam, // = (WPARAM) (DWORD) dwExMask;
(LPARAM) lParam // = (LPARAM) (DWORD) dwExStyle;
);
Parameters
dwExMask
A DWORD value that indicates which styles in dwExStyle are to be affected. Only the extended styles in dwExMask will be changed. All other styles will be maintained as they are. If this parameter is zero, then all of the styles in dwExStyle will be affected.
dwExStyle
Value specifying the extended tab control styles. This value is a combination of tab control extended styles.
Return Value
Returns a DWORD value that contains the previous tab control extended styles.
Remarks
The dwExMask parameter allows you to modify one or more extended styles without having to retrieve the existing styles first. For example, if you pass TCS_EX_FLATSEPARATORS for dwExMask and 0 for dwExStyle, the TCS_EX_FLATSEPARATORS style will be cleared, but all other styles will remain the same.
For backward compatibility reasons, the TabCtrl_SetExtendedStyle macro has not been updated to use dwExMask.
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x1303">
<name>TCM_SETIMAGELIST</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="HIMAGELIST">
<lname>himl</lname>
<lmisc>himl
Handle to the image list to assign to the tab control.</lmisc>
</lparam>
<misc>TCM_SETIMAGELIST Message
Assigns an image list to a tab control. You can send this message explicitly or by using the TabCtrl_SetImageList macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TCM_SETIMAGELIST, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (HIMAGELIST) himl;
);
Parameters
wParam
Must be zero.
himl
Handle to the image list to assign to the tab control.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1306">
<name>TCM_SETITEMA</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>iItem</wname>
<wmisc>iItem
Index of the item.</wmisc>
</wparam>
<lparam value="LPTCITEM">
<lname>pitem</lname>
<lmisc>pitem
Pointer to a TCITEM structure that contains the new item attributes. The mask member specifies which attributes to set. If the mask member specifies the TCIF_TEXT value, the pszText member is the address of a null-terminated string and the cchTextMax member is ignored.
</lmisc>
</lparam>
<misc>TCM_SETITEM Message
Sets some or all of a tab's attributes. You can send this message explicitly or by using the TabCtrl_SetItem macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TCM_SETITEM, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iItem;
(LPARAM) lParam // = (LPARAM) (LPTCITEM) pitem;
);
Parameters
iItem
Index of the item.
pitem
Pointer to a TCITEM structure that contains the new item attributes. The mask member specifies which attributes to set. If the mask member specifies the TCIF_TEXT value, the pszText member is the address of a null-terminated string and the cchTextMax member is ignored.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x130e">
<name>TCM_SETITEMEXTRA</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>cb</wname>
<wmisc>cb
Number of extra bytes.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TCM_SETITEMEXTRA Message
Sets the number of bytes per tab reserved for application-defined data in a tab control. You can send this message explicitly or by using the TabCtrl_SetItemExtra macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TCM_SETITEMEXTRA, // message ID
(WPARAM) wParam, // = (WPARAM) (int) cb;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
cb
Number of extra bytes.
lParam
Must be zero.
Return Value
Remarks
By default, the number of extra bytes is four. An application that changes the number of extra bytes cannot use the TCITEM structure to retrieve and set the application-defined data for a tab. Instead, you must define a new structure that consists of the TCITEMHEADER structure followed by application-defined members.
An application should only change the number of extra bytes when a tab control does not contain any tabs.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1329">
<name>TCM_SETITEMSIZE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>cx, cy</lname>
<lmisc>cx
New width, in pixels.
cy
New height, in pixels. </lmisc>
</lparam>
<misc>TCM_SETITEMSIZE Message
Sets the width and height of tabs in a fixed-width or owner-drawn tab control. You can send this message explicitly or by using the TabCtrl_SetItemSize macro.
To send this message, call the SendMessage function as follows.
Syntax
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TCM_SETITEMSIZE, // message ID
(WPARAM) wParam, // = (WPARAM) 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) MAKELPARAM (cx, cy)
);
Parameters
wParam
Must be zero.
cx
New width, in pixels.
cy
New height, in pixels.
Return Value
Remarks
If the width is set to a value less than the image width set by ImageList_Create, the width of the tab is set to the lowest value that is greater than the image width.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x133d">
<name>TCM_SETITEMW</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>iItem</wname>
<wmisc>iItem
Index of the item. </wmisc>
</wparam>
<lparam value="LPTCITEM">
<lname>pitem</lname>
<lmisc>pitem
Pointer to a TCITEM structure that contains the new item attributes. The mask member specifies which attributes to set. If the mask member specifies the TCIF_TEXT value, the pszText member is the address of a null-terminated string and the cchTextMax member is ignored.
</lmisc>
</lparam>
<misc>TCM_SETITEM Message
Sets some or all of a tab's attributes. You can send this message explicitly or by using the TabCtrl_SetItem macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TCM_SETITEM, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iItem;
(LPARAM) lParam // = (LPARAM) (LPTCITEM) pitem;
);
Parameters
iItem
Index of the item.
pitem
Pointer to a TCITEM structure that contains the new item attributes. The mask member specifies which attributes to set. If the mask member specifies the TCIF_TEXT value, the pszText member is the address of a null-terminated string and the cchTextMax member is ignored.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1331">
<name>TCM_SETMINTABWIDTH</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="INT">
<lname>cx</lname>
<lmisc>cx
Minimum width to be set for a tab control item. If this parameter is set to -1, the control will use the default tab width.
</lmisc>
</lparam>
<misc>TCM_SETMINTABWIDTH Message
Sets the minimum width of items in a tab control. You can send this message explicitly or by using the TabCtrl_SetMinTabWidth macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TCM_SETMINTABWIDTH, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (INT) cx;
);
Parameters
wParam
Must be zero.
cx
Minimum width to be set for a tab control item. If this parameter is set to -1, the control will use the default tab width.
Return Value
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x132b">
<name>TCM_SETPADDING</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam not used, must be zero </wmisc>
</wparam>
<lparam value="">
<lname>cx, cy</lname>
<lmisc>cx
Amount of horizontal padding, in pixels.
cy
Amount of vertical padding, in pixels.</lmisc>
</lparam>
<misc>TCM_SETPADDING Message
Sets the amount of space (padding) around each tab's icon and label in a tab control. You can send this message explicitly or by using the TabCtrl_SetPadding macro.
To send this message, call the SendMessage function as follows.
Syntax
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TCM_SETPADDING, // message ID
(WPARAM) wParam, // = (WPARAM) 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) MAKELPARAM (cx, cy)
);
Parameters
cx
Amount of horizontal padding, in pixels.
cy
Amount of vertical padding, in pixels.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x132e">
<name>TCM_SETTOOLTIPS</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="HWND">
<wname>hwndTT</wname>
<wmisc> hwndTT
Handle to the ToolTip control.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TCM_SETTOOLTIPS Message
Assigns a ToolTip control to a tab control. You can send this message explicitly or by using the TabCtrl_SetToolTips macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TCM_SETTOOLTIPS, // message ID
(WPARAM) wParam, // = (WPARAM) (HWND) hwndTT;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
hwndTT
Handle to the ToolTip control.
lParam
Must be zero.
Return Value
Remarks
You can retrieve the ToolTip control associated with a tab control by using the TCM_GETTOOLTIPS message.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x401">
<name>TTM_ACTIVATE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="BOOL">
<wname>fActivate</wname>
<wmisc>fActivate
Activation flag. If this parameter is TRUE, the ToolTip control is activated. If it is FALSE, the ToolTip control is deactivated.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TTM_ACTIVATE Message
Activates or deactivates a ToolTip control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TTM_ACTIVATE, // message ID
(WPARAM) wParam, // = (WPARAM) (BOOL) fActivate;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
fActivate
Activation flag. If this parameter is TRUE, the ToolTip control is activated. If it is FALSE, the ToolTip control is deactivated.
lParam
Must be zero.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x404">
<name>TTM_ADDTOOLA</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPTOOLINFO">
<lname>lpti</lname>
<lmisc>lpti
Pointer to a TOOLINFO structure containing information that the ToolTip control needs to display text for the tool. The cbSize member of this structure must be filled in before sending this message.
</lmisc>
</lparam>
<misc>TTM_ADDTOOL Message
Registers a tool with a ToolTip control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TTM_ADDTOOL, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPTOOLINFO) lpti;
);
Parameters
wParam
Must be zero.
lpti
Pointer to a TOOLINFO structure containing information that the ToolTip control needs to display text for the tool. The cbSize member of this structure must be filled in before sending this message.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x432">
<name>TTM_ADDTOOLW</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPTOOLINFO">
<lname>lpti</lname>
<lmisc>lpti
Pointer to a TOOLINFO structure containing information that the ToolTip control needs to display text for the tool. The cbSize member of this structure must be filled in before sending this message.
</lmisc>
</lparam>
<misc>TTM_ADDTOOL Message
Registers a tool with a ToolTip control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TTM_ADDTOOL, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPTOOLINFO) lpti;
);
Parameters
wParam
Must be zero.
lpti
Pointer to a TOOLINFO structure containing information that the ToolTip control needs to display text for the tool. The cbSize member of this structure must be filled in before sending this message.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x41f">
<name>TTM_ADJUSTRECT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="BOOL">
<wname>fLarger</wname>
<wmisc>fLarger
Value that specifies which operation to perform. If TRUE, prc is used to specify a text-display rectangle and it receives the corresponding window rectangle. If FALSE, prc is used to specify a window rectangle and it receives the corresponding text display rectangle.
</wmisc>
</wparam>
<lparam value="RECT">
<lname>prc</lname>
<lmisc>prc
RECT structure to hold either a ToolTip window rectangle or a text display rectangle. </lmisc>
</lparam>
<misc>TTM_ADJUSTRECT Message
Calculates a ToolTip control's text display rectangle from its window rectangle, or the ToolTip window rectangle needed to display a specified text display rectangle.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TTM_ADJUSTRECT, // message ID
(WPARAM) wParam, // = (WPARAM) (BOOL) fLarger;
(LPARAM) lParam // = (LPARAM) (LPRECT) prc;
);
Parameters
fLarger
Value that specifies which operation to perform. If TRUE, prc is used to specify a text-display rectangle and it receives the corresponding window rectangle. If FALSE, prc is used to specify a window rectangle and it receives the corresponding text display rectangle.
prc
RECT structure to hold either a ToolTip window rectangle or a text display rectangle.
Return Value
Remarks
This message is particularly useful when you want to use a ToolTip control to display the full text of a string that is usually truncated. It is commonly used with listview and treeview controls. You typically send this message in response to a TTN_SHOW notification message so that you can position the ToolTip control properly.
The ToolTip's window rectangle is somewhat larger than the text display rectangle that bounds the ToolTip string. The window origin is also offset up and to the left from the origin of the text display rectangle. To position the text display rectangle, you must calculate the corresponding window rectangle and use that rectangle to position the ToolTip. TTM_ADJUSTRECT handles this calculation for you.
If you set fLarger to TRUE, TTM_ADJUSTRECT takes the size and position of the desired ToolTip text display rectangle, and passes back the size and position of the ToolTip window needed to display the text in the specified position. If you set fLarger to FALSE, you can specify a ToolTip window rectangle and TTM_ADJUSTRECT will return the size and position of its text rectangle.
The following code fragment illustrates the use of the TTM_ADJUSTRECT message to position a ToolTip control to display the full text of a control's string in place of a truncated string. The application-defined GetMyItemRect function returns the text rectangle that will be needed to display the ToolTip text directly over the truncated string. The details of how this function is implemented will depend on the particular control. TTM_ADJUSTRECT is used to send this text rectangle to the ToolTip control. It returns an appropriately sized and positioned window rectangle that is then used to position the ToolTip window.
Copy Code
case TTN_SHOW:
if (MyStringIsTruncated) {
RECT rc;
GetMyItemRect(rc);
SendMessage(hwndToolTip, TTM_ADJUSTRECT, TRUE, (LPARAM)rc);
SetWindowPos(hwndToolTip,
NULL,
rc.left, rc.top,
0, 0,
SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE);
}
Message Information
Minimum DLL Version comctl32.dll version 5.80 or later
Header comctl32.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 5, Windows 98, Windows 95 with Internet Explorer 5</misc>
</message>
<message value="0x405">
<name>TTM_DELTOOLA</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPTOOLINFO">
<lname>lpti</lname>
<lmisc>lpti
Pointer to a TOOLINFO structure. The hwnd and uId members identify the tool to remove, and the cbSize member must specify the size of the structure. All other members are ignored.
</lmisc>
</lparam>
<misc>TTM_DELTOOL Message
Removes a tool from a ToolTip control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TTM_DELTOOL, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPTOOLINFO) lpti;
);
Parameters
wParam
Must be zero.
lpti
Pointer to a TOOLINFO structure. The hwnd and uId members identify the tool to remove, and the cbSize member must specify the size of the structure. All other members are ignored.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x433">
<name>TTM_DELTOOLW</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPTOOLINFO">
<lname>lpti</lname>
<lmisc>lpti
Pointer to a TOOLINFO structure. The hwnd and uId members identify the tool to remove, and the cbSize member must specify the size of the structure. All other members are ignored.
</lmisc>
</lparam>
<misc>TTM_DELTOOL Message
Removes a tool from a ToolTip control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TTM_DELTOOL, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPTOOLINFO) lpti;
);
Parameters
wParam
Must be zero.
lpti
Pointer to a TOOLINFO structure. The hwnd and uId members identify the tool to remove, and the cbSize member must specify the size of the structure. All other members are ignored.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x40e">
<name>TTM_ENUMTOOLSA</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="UINT">
<wname>iTool</wname>
<wmisc>iTool
Zero-based index of the tool for which to retrieve information.</wmisc>
</wparam>
<lparam value="LPTOOLINFO">
<lname>lpti</lname>
<lmisc>lpti
Pointer to a TOOLINFO structure that receives information about the tool. Set the cbSize member of this structure to sizeof(LPTOOLINFO) before sending this message. Allocate a buffer. Set the lpszText member to point to the buffer to receive the tool text. There is no way to determine the required buffer size. However, tool text, as returned at the lpszText member of the TOOLINFO structure, has a maximum length of 80 TCHARs, including the terminating NULL. If the text exceeds this length, it is truncated.
</lmisc>
</lparam>
<misc>TTM_ENUMTOOLS Message
Retrieves the information that a ToolTip control maintains about the current tool that is, the tool for which the ToolTip is currently displaying text.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TTM_ENUMTOOLS, // message ID
(WPARAM) wParam, // = (WPARAM) (UINT) iTool;
(LPARAM) lParam // = (LPARAM) (LPTOOLINFO) lpti;
);
Parameters
iTool
Zero-based index of the tool for which to retrieve information.
lpti
Pointer to a TOOLINFO structure that receives information about the tool. Set the cbSize member of this structure to sizeof(LPTOOLINFO) before sending this message. Allocate a buffer. Set the lpszText member to point to the buffer to receive the tool text. There is no way to determine the required buffer size. However, tool text, as returned at the lpszText member of the TOOLINFO structure, has a maximum length of 80 TCHARs, including the terminating NULL. If the text exceeds this length, it is truncated.
Return Value
Remarks
security note Security Alert Using this message might compromise the security of your program. This message does not provide a way for the message receiver to know the size of the buffer or to specify the size of the buffer. You should review the Security Considerations: Microsoft Windows Controls before continuing.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x43a">
<name>TTM_ENUMTOOLSW</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="UINT">
<wname>iTool</wname>
<wmisc>iTool
Zero-based index of the tool for which to retrieve information.</wmisc>
</wparam>
<lparam value="LPTOOLINFO">
<lname>lpti</lname>
<lmisc>lpti
Pointer to a TOOLINFO structure that receives information about the tool. Set the cbSize member of this structure to sizeof(LPTOOLINFO) before sending this message. Allocate a buffer. Set the lpszText member to point to the buffer to receive the tool text. There is no way to determine the required buffer size. However, tool text, as returned at the lpszText member of the TOOLINFO structure, has a maximum length of 80 TCHARs, including the terminating NULL. If the text exceeds this length, it is truncated.
</lmisc>
</lparam>
<misc>TTM_ENUMTOOLS Message
Retrieves the information that a ToolTip control maintains about the current tool that is, the tool for which the ToolTip is currently displaying text.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TTM_ENUMTOOLS, // message ID
(WPARAM) wParam, // = (WPARAM) (UINT) iTool;
(LPARAM) lParam // = (LPARAM) (LPTOOLINFO) lpti;
);
Parameters
iTool
Zero-based index of the tool for which to retrieve information.
lpti
Pointer to a TOOLINFO structure that receives information about the tool. Set the cbSize member of this structure to sizeof(LPTOOLINFO) before sending this message. Allocate a buffer. Set the lpszText member to point to the buffer to receive the tool text. There is no way to determine the required buffer size. However, tool text, as returned at the lpszText member of the TOOLINFO structure, has a maximum length of 80 TCHARs, including the terminating NULL. If the text exceeds this length, it is truncated.
Return Value
Remarks
security note Security Alert Using this message might compromise the security of your program. This message does not provide a way for the message receiver to know the size of the buffer or to specify the size of the buffer. You should review the Security Considerations: Microsoft Windows Controls before continuing.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x41e">
<name>TTM_GETBUBBLESIZE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPTOOLINFO">
<lname>pTtm</lname>
<lmisc>pTtm
Pointer to the ToolTip's TOOLINFO structure.
</lmisc>
</lparam>
<misc>TTM_GETBUBBLESIZE Message
Returns the width and height of a ToolTip control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TTM_GETBUBBLESIZE, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPTOOLINFO) pTtm;
);
Parameters
wParam
Must be zero.
pTtm
Pointer to the ToolTip's TOOLINFO structure.
Return Value
Remarks
If the TTF_TRACK and TTF_ABSOLUTE flags are set in the uFlags member of the ToolTip's TOOLINFO structure, this message can be used to help position the ToolTip accurately.
Message Information
Minimum DLL Version comctl32.dll version 5.80 or later
Header comctl32.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 5, Windows 98, Windows 95 with Internet Explorer 5</misc>
</message>
<message value="0x40f">
<name>TTM_GETCURRENTTOOLA</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns nonzero if successful, or zero otherwise. If lpti is NULL, returns nonzero if a current tool exists, or zero otherwise.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPTOOLINFO">
<lname>lpti</lname>
<lmisc>lpti
Pointer to a TOOLINFO structure that receives information about the current tool. If this value is NULL, the return value indicates the existence of the current tool without actually retrieving the tool information. If this value is not NULL, the cbSize member of the TOOLINFO structure must be filled in before sending this message.
</lmisc>
</lparam>
<misc>TTM_GETCURRENTTOOL Message
Retrieves the information for the current tool in a ToolTip control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TTM_GETCURRENTTOOL, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPTOOLINFO) lpti;
);
Parameters
wParam
Must be zero.
lpti
Pointer to a TOOLINFO structure that receives information about the current tool. If this value is NULL, the return value indicates the existence of the current tool without actually retrieving the tool information. If this value is not NULL, the cbSize member of the TOOLINFO structure must be filled in before sending this message.
Return Value
Returns nonzero if successful, or zero otherwise. If lpti is NULL, returns nonzero if a current tool exists, or zero otherwise.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95
</misc>
</message>
<message value="0x43b">
<name>TTM_GETCURRENTTOOLW</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns nonzero if successful, or zero otherwise. If lpti is NULL, returns nonzero if a current tool exists, or zero otherwise.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPTOOLINFO">
<lname>lpti</lname>
<lmisc>lpti
Pointer to a TOOLINFO structure that receives information about the current tool. If this value is NULL, the return value indicates the existence of the current tool without actually retrieving the tool information. If this value is not NULL, the cbSize member of the TOOLINFO structure must be filled in before sending this message.
</lmisc>
</lparam>
<misc>TTM_GETCURRENTTOOL Message
Retrieves the information for the current tool in a ToolTip control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TTM_GETCURRENTTOOL, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPTOOLINFO) lpti;
);
Parameters
wParam
Must be zero.
lpti
Pointer to a TOOLINFO structure that receives information about the current tool. If this value is NULL, the return value indicates the existence of the current tool without actually retrieving the tool information. If this value is not NULL, the cbSize member of the TOOLINFO structure must be filled in before sending this message.
Return Value
Returns nonzero if successful, or zero otherwise. If lpti is NULL, returns nonzero if a current tool exists, or zero otherwise.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95
</misc>
</message>
<message value="0x415">
<name>TTM_GETDELAYTIME</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="DWORD">
<wname>dwDuration</wname>
<wmisc>dwDuration
Flag that specifies which duration value will be retrieved. This parameter can have one of the following values:
TTDT_AUTOPOP
Retrieve the amount of time the ToolTip window remains visible if the pointer is stationary within a tool's bounding rectangle.
TTDT_INITIAL
Retrieve the amount of time the pointer must remain stationary within a tool's bounding rectangle before the ToolTip window appears.
TTDT_RESHOW
Retrieve the amount of time it takes for subsequent ToolTip windows to appear as the pointer moves from one tool to another.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.
</lmisc>
</lparam>
<misc>TTM_GETDELAYTIME Message
Retrieves the initial, pop-up, and reshow durations currently set for a ToolTip control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TTM_GETDELAYTIME, // message ID
(WPARAM) wParam, // = (WPARAM) (DWORD) dwDuration;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
dwDuration
Flag that specifies which duration value will be retrieved. This parameter can have one of the following values:
TTDT_AUTOPOP
Retrieve the amount of time the ToolTip window remains visible if the pointer is stationary within a tool's bounding rectangle.
TTDT_INITIAL
Retrieve the amount of time the pointer must remain stationary within a tool's bounding rectangle before the ToolTip window appears.
TTDT_RESHOW
Retrieve the amount of time it takes for subsequent ToolTip windows to appear as the pointer moves from one tool to another.
lParam
Must be zero.
Return Value
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x41b">
<name>TTM_GETMARGIN</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
The return value for this message is not used. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="RECT">
<lname>lprc</lname>
<lmisc>lprc
Pointer to a RECT structure that will receive the margin information. The members of the RECT structure do not define a bounding rectangle. For the purpose of this message, the structure members are interpreted as follows:
top
Distance between top border and top of ToolTip text, in pixels.
left
Distance between left border and left end of ToolTip text, in pixels.
bottom
Distance between bottom border and bottom of ToolTip text, in pixels.
right
Distance between right border and right end of ToolTip text, in pixels.
</lmisc>
</lparam>
<misc>TTM_GETMARGIN Message
Retrieves the top, left, bottom, and right margins set for a ToolTip window. A margin is the distance, in pixels, between the ToolTip window border and the text contained within the ToolTip window.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TTM_GETMARGIN, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPRECT) lprc;
);
Parameters
wParam
Must be zero.
lprc
Pointer to a RECT structure that will receive the margin information. The members of the RECT structure do not define a bounding rectangle. For the purpose of this message, the structure members are interpreted as follows:
top
Distance between top border and top of ToolTip text, in pixels.
left
Distance between left border and left end of ToolTip text, in pixels.
bottom
Distance between bottom border and bottom of ToolTip text, in pixels.
right
Distance between right border and right end of ToolTip text, in pixels.
Return Value
The return value for this message is not used.
Remarks
All four margins default to zero when you create the ToolTip control.
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x419">
<name>TTM_GETMAXTIPWIDTH</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TTM_GETMAXTIPWIDTH Message
Retrieves the maximum width for a ToolTip window.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TTM_GETMAXTIPWIDTH, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Remarks
The maximum ToolTip width value does not indicate a ToolTip window's actual width. Rather, if a ToolTip string exceeds the maximum width, the control breaks the text into multiple lines, using spaces to determine line breaks. If the text cannot be segmented into multiple lines, it will be displayed on a single line. The length of this line may exceed the maximum ToolTip width.
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x40b">
<name>TTM_GETTEXTA</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
The number of TCHARs, including the terminating NULL, to copy to the buffer pointed to by lpszText.
</wmisc>
</wparam>
<lparam value="LPTOOLINFO">
<lname>lpti</lname>
<lmisc>lpti
Pointer to a TOOLINFO structure. Set the cbSize member of this structure to sizeof(LPTOOLINFO) before sending this message. Set the hwnd and uId members to identify the tool for which to retrieve information. Allocate a buffer of size specified by wParam. Set the lpszText member to point to the buffer to receive the tool text.
</lmisc>
</lparam>
<misc>TTM_GETTEXT Message
Retrieves the information a ToolTip control maintains about a tool.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TTM_GETTEXT, // message ID
(WPARAM) wParam, // = (WPARAM) (WPARAM) wParam;
(LPARAM) lParam // = (LPARAM) (LPTOOLINFO) lpti;
);
Parameters
wParam
The number of TCHARs, including the terminating NULL, to copy to the buffer pointed to by lpszText.
lpti
Pointer to a TOOLINFO structure. Set the cbSize member of this structure to sizeof(LPTOOLINFO) before sending this message. Set the hwnd and uId members to identify the tool for which to retrieve information. Allocate a buffer of size specified by wParam. Set the lpszText member to point to the buffer to receive the tool text.
Return Value
Remarks
Microsoft Windows XP and earlier: The value of wParam must be zero. There is no way to determine the required buffer size. However, tool text, as returned at the lpszText member of the TOOLINFO structure, has a maximum length of 80 TCHARs, including the terminating NULL. If the text exceeds this length, it is truncated.
security note Security Alert For Windows XP and earlier, using this message might compromise the security of your program. This message does not provide a way for the message receiver to know the size of the buffer or to specify the size of the buffer. You should review the Security Considerations: Microsoft Windows Controls before continuing.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x438">
<name>TTM_GETTEXTW</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
The number of TCHARs, including the terminating NULL, to copy to the buffer pointed to by lpszText.
</wmisc>
</wparam>
<lparam value="LPTOOLINFO">
<lname>lpti</lname>
<lmisc>lpti
Pointer to a TOOLINFO structure. Set the cbSize member of this structure to sizeof(LPTOOLINFO) before sending this message. Set the hwnd and uId members to identify the tool for which to retrieve information. Allocate a buffer of size specified by wParam. Set the lpszText member to point to the buffer to receive the tool text.
</lmisc>
</lparam>
<misc>TTM_GETTEXT Message
Retrieves the information a ToolTip control maintains about a tool.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TTM_GETTEXT, // message ID
(WPARAM) wParam, // = (WPARAM) (WPARAM) wParam;
(LPARAM) lParam // = (LPARAM) (LPTOOLINFO) lpti;
);
Parameters
wParam
The number of TCHARs, including the terminating NULL, to copy to the buffer pointed to by lpszText.
lpti
Pointer to a TOOLINFO structure. Set the cbSize member of this structure to sizeof(LPTOOLINFO) before sending this message. Set the hwnd and uId members to identify the tool for which to retrieve information. Allocate a buffer of size specified by wParam. Set the lpszText member to point to the buffer to receive the tool text.
Return Value
Remarks
Microsoft Windows XP and earlier: The value of wParam must be zero. There is no way to determine the required buffer size. However, tool text, as returned at the lpszText member of the TOOLINFO structure, has a maximum length of 80 TCHARs, including the terminating NULL. If the text exceeds this length, it is truncated.
security note Security Alert For Windows XP and earlier, using this message might compromise the security of your program. This message does not provide a way for the message receiver to know the size of the buffer or to specify the size of the buffer. You should review the Security Considerations: Microsoft Windows Controls before continuing.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x416">
<name>TTM_GETTIPBKCOLOR</name>
<return value="COLORREF">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns a COLORREF value that represents the background color.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TTM_GETTIPBKCOLOR Message
Retrieves the background color in a ToolTip window.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TTM_GETTIPBKCOLOR, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Returns a COLORREF value that represents the background color.
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x417">
<name>TTM_GETTIPTEXTCOLOR</name>
<return value="COLORREF">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns a COLORREF value that represents the text color. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TTM_GETTIPTEXTCOLOR Message
Retrieves the text color in a ToolTip window.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TTM_GETTIPTEXTCOLOR, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Returns a COLORREF value that represents the text color.
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x40d">
<name>TTM_GETTOOLCOUNT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TTM_GETTOOLCOUNT Message
Retrieves a count of the tools maintained by a ToolTip control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TTM_GETTOOLCOUNT, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x408">
<name>TTM_GETTOOLINFOA</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPTOOLINFO">
<lname>lpti</lname>
<lmisc>lpti
Pointer to a TOOLINFO structure. When sending the message, the hwnd and uId members identify a tool, and the cbSize member must specify the size of the structure. If the ToolTip control includes the tool, the structure receives information about the tool.
</lmisc>
</lparam>
<misc>TTM_GETTOOLINFO Message
Retrieves the information that a ToolTip control maintains about a tool.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TTM_GETTOOLINFO, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPTOOLINFO) lpti;
);
Parameters
wParam
Must be zero.
lpti
Pointer to a TOOLINFO structure. When sending the message, the hwnd and uId members identify a tool, and the cbSize member must specify the size of the structure. If the ToolTip control includes the tool, the structure receives information about the tool.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x435">
<name>TTM_GETTOOLINFOW</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPTOOLINFO">
<lname>lpti</lname>
<lmisc>lpti
Pointer to a TOOLINFO structure. When sending the message, the hwnd and uId members identify a tool, and the cbSize member must specify the size of the structure. If the ToolTip control includes the tool, the structure receives information about the tool.
</lmisc>
</lparam>
<misc>TTM_GETTOOLINFO Message
Retrieves the information that a ToolTip control maintains about a tool.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TTM_GETTOOLINFO, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPTOOLINFO) lpti;
);
Parameters
wParam
Must be zero.
lpti
Pointer to a TOOLINFO structure. When sending the message, the hwnd and uId members identify a tool, and the cbSize member must specify the size of the structure. If the ToolTip control includes the tool, the structure receives information about the tool.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x40a">
<name>TTM_HITTESTA</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPHITTESTINFO">
<lname>lphti</lname>
<lmisc>lphti
Pointer to a TTHITTESTINFO structure. When sending the message, the hwnd member must specify the handle to a tool and the pt member must specify the coordinates of a point. If the return value is TRUE, the ti member (a TOOLINFO structure) receives information about the tool that occupies the point. The cbSize member of the ti structure must be filled in before sending this message.
</lmisc>
</lparam>
<misc>TTM_HITTEST Message
Tests a point to determine whether it is within the bounding rectangle of the specified tool and, if it is, retrieves information about the tool.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TTM_HITTEST, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPHITTESTINFO) lphti;
);
Parameters
wParam
Must be zero.
lphti
Pointer to a TTHITTESTINFO structure. When sending the message, the hwnd member must specify the handle to a tool and the pt member must specify the coordinates of a point. If the return value is TRUE, the ti member (a TOOLINFO structure) receives information about the tool that occupies the point. The cbSize member of the ti structure must be filled in before sending this message.
Return Value
Remarks
This message must be sent when the tool has the TTF_TRACK flag set. For more information on this flag, see TOOLINFO. TTM_HITTEST will fail if TTF_TRACK is not set, regardless if the hit point is in the tools rectangle or not.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x437">
<name>TTM_HITTESTW</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPHITTESTINFO">
<lname>lphti</lname>
<lmisc>lphti
Pointer to a TTHITTESTINFO structure. When sending the message, the hwnd member must specify the handle to a tool and the pt member must specify the coordinates of a point. If the return value is TRUE, the ti member (a TOOLINFO structure) receives information about the tool that occupies the point. The cbSize member of the ti structure must be filled in before sending this message.
</lmisc>
</lparam>
<misc>TTM_HITTEST Message
Tests a point to determine whether it is within the bounding rectangle of the specified tool and, if it is, retrieves information about the tool.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TTM_HITTEST, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPHITTESTINFO) lphti;
);
Parameters
wParam
Must be zero.
lphti
Pointer to a TTHITTESTINFO structure. When sending the message, the hwnd member must specify the handle to a tool and the pt member must specify the coordinates of a point. If the return value is TRUE, the ti member (a TOOLINFO structure) receives information about the tool that occupies the point. The cbSize member of the ti structure must be filled in before sending this message.
Return Value
Remarks
This message must be sent when the tool has the TTF_TRACK flag set. For more information on this flag, see TOOLINFO. TTM_HITTEST will fail if TTF_TRACK is not set, regardless if the hit point is in the tools rectangle or not.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x406">
<name>TTM_NEWTOOLRECTA</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPTOOLINFO">
<lname>lpti</lname>
<lmisc>lpti
Pointer to a TOOLINFO structure. The hwnd and uId members identify a tool, and the rect member specifies the new bounding rectangle. The cbSize member of this structure must be filled in before sending this message.
</lmisc>
</lparam>
<misc>TTM_NEWTOOLRECT Message
Sets a new bounding rectangle for a tool.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TTM_NEWTOOLRECT, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPTOOLINFO) lpti;
);
Parameters
wParam
Must be zero.
lpti
Pointer to a TOOLINFO structure. The hwnd and uId members identify a tool, and the rect member specifies the new bounding rectangle. The cbSize member of this structure must be filled in before sending this message.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x434">
<name>TTM_NEWTOOLRECTW</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPTOOLINFO">
<lname>lpti</lname>
<lmisc>lpti
Pointer to a TOOLINFO structure. The hwnd and uId members identify a tool, and the rect member specifies the new bounding rectangle. The cbSize member of this structure must be filled in before sending this message.
</lmisc>
</lparam>
<misc>TTM_NEWTOOLRECT Message
Sets a new bounding rectangle for a tool.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TTM_NEWTOOLRECT, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPTOOLINFO) lpti;
);
Parameters
wParam
Must be zero.
lpti
Pointer to a TOOLINFO structure. The hwnd and uId members identify a tool, and the rect member specifies the new bounding rectangle. The cbSize member of this structure must be filled in before sending this message.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x41c">
<name>TTM_POP</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TTM_POP Message
Removes a displayed ToolTip window from view.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TTM_POP, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0
</misc>
</message>
<message value="0x422">
<name>TTM_POPUP</name>
<return value="">
<returninfo>returns nothing in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TTM_POPUP Message
Causes the ToolTip to display at the coordinates of the last mouse message.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns nothing in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TTM_POPUP, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Remarks
Note To use this API, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.
Message Information
Header commctrl.h
Minimum operating systems Windows XP</misc>
</message>
<message value="0x407">
<name>TTM_RELAYEVENT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero. Windows 7 and later: If the position of the ToolTip is offset from the cursor position (in order not be obstructed by a finger or pointing device), this parameter can contain extra information taken from the WM_MOUSEMOVE message. Retrieve this extra information with GetMessageExtraInfo.
</wmisc>
</wparam>
<lparam value="LPMSG">
<lname>lpmsg</lname>
<lmisc>lpmsg
Pointer to an MSG structure that contains the message to relay. </lmisc>
</lparam>
<misc>TTM_RELAYEVENT Message
Note: This documentation is preliminary and is subject to change.
Passes a mouse message to a ToolTip control for processing.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TTM_RELAYEVENT, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPMSG) lpmsg;
);
Parameters
wParam
Must be zero. Windows 7 and later: If the position of the ToolTip is offset from the cursor position (in order not be obstructed by a finger or pointing device), this parameter can contain extra information taken from the WM_MOUSEMOVE message. Retrieve this extra information with GetMessageExtraInfo.
lpmsg
Pointer to an MSG structure that contains the message to relay.
Return Value
Remarks
A ToolTip control processes only the following messages passed to it by the TTM_RELAYEVENT message:
* WM_LBUTTONDOWN
* WM_LBUTTONUP
* WM_MBUTTONDOWN
* WM_MBUTTONUP
* WM_MOUSEMOVE
* WM_RBUTTONDOWN
* WM_RBUTTONUP
All other messages are ignored.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x403">
<name>TTM_SETDELAYTIME</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="DWORD">
<wname>dwDuration</wname>
<wmisc>dwDuration
Flag that specifies which time value to set. This parameter can be one of the following values
TTDT_AUTOPOP
Set the amount of time a ToolTip window remains visible if the pointer is stationary within a tool's bounding rectangle. To return the autopop delay time to its default value, set iTime to -1.
TTDT_INITIAL
Set the amount of time a pointer must remain stationary within a tool's bounding rectangle before the ToolTip window appears. To return the initial delay time to its default value, set iTime to -1.
TTDT_RESHOW
Set the amount of time it takes for subsequent ToolTip windows to appear as the pointer moves from one tool to another. To return the reshow delay time to its default value, set iTime to -1.
TTDT_AUTOMATIC
Set all three delay times to default proportions. The autopop time will be ten times the initial time and the reshow time will be one fifth the initial time. If this flag is set, use a positive value of iTime to specify the initial time, in milliseconds. Set iTime to a negative value to return all three delay times to their default values.
</wmisc>
</wparam>
<lparam value="">
<lname>iTime, 0</lname>
<lmisc>iTime
Delay time, in milliseconds. </lmisc>
</lparam>
<misc>TTM_SETDELAYTIME Message
Sets the initial, pop-up, and reshow durations for a ToolTip control.
To send this message, call the SendMessage function as follows.
Syntax
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TTM_SETDELAYTIME, // message ID
(WPARAM) wParam, // = (WPARAM) (DWORD) dwDuration
(LPARAM) lParam // = (LPARAM) MAKELONG(iTime, 0)
);
Parameters
dwDuration
Flag that specifies which time value to set. This parameter can be one of the following values
TTDT_AUTOPOP
Set the amount of time a ToolTip window remains visible if the pointer is stationary within a tool's bounding rectangle. To return the autopop delay time to its default value, set iTime to -1.
TTDT_INITIAL
Set the amount of time a pointer must remain stationary within a tool's bounding rectangle before the ToolTip window appears. To return the initial delay time to its default value, set iTime to -1.
TTDT_RESHOW
Set the amount of time it takes for subsequent ToolTip windows to appear as the pointer moves from one tool to another. To return the reshow delay time to its default value, set iTime to -1.
TTDT_AUTOMATIC
Set all three delay times to default proportions. The autopop time will be ten times the initial time and the reshow time will be one fifth the initial time. If this flag is set, use a positive value of iTime to specify the initial time, in milliseconds. Set iTime to a negative value to return all three delay times to their default values.
iTime
Delay time, in milliseconds.
Return Value
Remarks
The default delay times are based on the double-click time. For the default double-click time of 500 ms, the initial, autopop, and reshow delay times are 500ms, 5000ms, and 100ms respectively. The following code fragment uses the GetDoubleClickTime function to determine the three delay times for any system.
Copy Code
initial = GetDoubleClickTime();
autopop = GetDoubleClickTime() * 10;
reshow = GetDoubleClickTime() / 5;
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x41a">
<name>TTM_SETMARGIN</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
The return value for this message is not used.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="RECT">
<lname>lprc</lname>
<lmisc>lprc
Pointer to a RECT structure that contains the margin information to be set. The members of the RECT structure do not define a bounding rectangle. For the purpose of this message, the structure members are interpreted as follows:
top
Distance between top border and top of ToolTip text, in pixels.
left
Distance between left border and left end of ToolTip text, in pixels.
bottom
Distance between bottom border and bottom of ToolTip text, in pixels.
right
Distance between right border and right end of ToolTip text, in pixels.</lmisc>
</lparam>
<misc>TTM_SETMARGIN Message
Sets the top, left, bottom, and right margins for a ToolTip window. A margin is the distance, in pixels, between the ToolTip window border and the text contained within the ToolTip window.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TTM_SETMARGIN, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPRECT) lprc;
);
Parameters
wParam
Must be zero.
lprc
Pointer to a RECT structure that contains the margin information to be set. The members of the RECT structure do not define a bounding rectangle. For the purpose of this message, the structure members are interpreted as follows:
top
Distance between top border and top of ToolTip text, in pixels.
left
Distance between left border and left end of ToolTip text, in pixels.
bottom
Distance between bottom border and bottom of ToolTip text, in pixels.
right
Distance between right border and right end of ToolTip text, in pixels.
Return Value
The return value for this message is not used.
Remarks
This message has no effect when the application runs on Windows Vista and visual styles are enabled for the ToolTip. You can disable visual styles for the ToolTip by using SetWindowTheme.
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x418">
<name>TTM_SETMAXTIPWIDTH</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns the previous maximum ToolTip width. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="INT">
<lname>iWidth</lname>
<lmisc>iWidth
Maximum ToolTip window width, or -1 to allow any width. </lmisc>
</lparam>
<misc>TTM_SETMAXTIPWIDTH Message
Sets the maximum width for a ToolTip window.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TTM_SETMAXTIPWIDTH, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (INT) iWidth;
);
Parameters
wParam
Must be zero.
iWidth
Maximum ToolTip window width, or -1 to allow any width.
Return Value
Returns the previous maximum ToolTip width.
Remarks
The maximum width value does not indicate a ToolTip window's actual width. Rather, if a ToolTip string exceeds the maximum width, the control breaks the text into multiple lines, using spaces to determine line breaks. If the text cannot be segmented into multiple lines, it is displayed on a single line, which may exceed the maximum ToolTip width.
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x413">
<name>TTM_SETTIPBKCOLOR</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="COLORREF">
<wname>clr</wname>
<wmisc>clr
New background color. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TTM_SETTIPBKCOLOR Message
Sets the background color in a ToolTip window.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TTM_SETTIPBKCOLOR, // message ID
(WPARAM) wParam, // = (WPARAM) (COLORREF) clr;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
clr
New background color.
lParam
Must be zero.
Return Value
Remarks
When visual styles are enabled, this message has no effect.
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x414">
<name>TTM_SETTIPTEXTCOLOR</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="COLORREF">
<wname>clr</wname>
<wmisc>clr
New text color.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TTM_SETTIPTEXTCOLOR Message
Sets the text color in a ToolTip window.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TTM_SETTIPTEXTCOLOR, // message ID
(WPARAM) wParam, // = (WPARAM) (COLORREF) clr;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
clr
New text color.
lParam
Must be zero.
Return Value
Remarks
When visual styles are enabled, this message has no effect.
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x420">
<name>TTM_SETTITLEA</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>icon</wname>
<wmisc>icon
Set wParam to one of the following values to specify the icon to be displayed. As of Microsoft Windows XP Service Pack 2 (SP2) and later, this parameter can also contain an HICON value. Any value greater than TTI_ERROR is assumed to be an HICON.
TTI_NONE
No icon.
TTI_INFO
Info icon.
TTI_WARNING
Warning icon
TTI_ERROR
Error Icon
TTI_INFO_LARGE
Large error Icon
TTI_WARNING_LARGE
Large error Icon
TTI_ERROR_LARGE
Large error Icon</wmisc>
</wparam>
<lparam value="LPCTSTR">
<lname>pszTitle</lname>
<lmisc>pszTitle
Pointer to the title string. You must assign a value to pszTitle.</lmisc>
</lparam>
<misc>TTM_SETTITLE Message
Adds a standard icon and title string to a ToolTip.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TTM_SETTITLE, // message ID
(WPARAM) wParam, // = (WPARAM) (int) icon;
(LPARAM) lParam // = (LPARAM) (LPCTSTR) pszTitle;
);
Parameters
icon
Set wParam to one of the following values to specify the icon to be displayed. As of Microsoft Windows XP Service Pack 2 (SP2) and later, this parameter can also contain an HICON value. Any value greater than TTI_ERROR is assumed to be an HICON.
TTI_NONE
No icon.
TTI_INFO
Info icon.
TTI_WARNING
Warning icon
TTI_ERROR
Error Icon
TTI_INFO_LARGE
Large error Icon
TTI_WARNING_LARGE
Large error Icon
TTI_ERROR_LARGE
Large error Icon
pszTitle
Pointer to the title string. You must assign a value to pszTitle.
Return Value
Remarks
The title of a tooltip appears above the text, in a different font. It is not sufficient to have a title; the tooltip must have text as well, or it is not displayed.
When icon contains an HICON, a copy of the icon is created by the ToolTip window.
When calling TTM_SETTITLE, the string pointed to by pszTitle must not exceed 100 TCHARs in length, including the terminating NULL.
Example
The following example shows how to add a title and a system icon to a ToolTip.
Copy Code
// hwndTip is the handle of the ToolTip window.
HICON hIcon = LoadIcon(NULL, IDI_INFORMATION);
SendMessage(hwndTip, TTM_SETTITLE, (WPARAM)hIcon, L"Title text");
DestroyIcon(hIcon);
Message Information
Minimum DLL Version comctl32.dll version 5.80 or later
Header comctl32.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 5, Windows 98, Windows 95 with Internet Explorer 5</misc>
</message>
<message value="0x421">
<name>TTM_SETTITLEW</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>icon</wname>
<wmisc>icon
Set wParam to one of the following values to specify the icon to be displayed. As of Microsoft Windows XP Service Pack 2 (SP2) and later, this parameter can also contain an HICON value. Any value greater than TTI_ERROR is assumed to be an HICON.
TTI_NONE
No icon.
TTI_INFO
Info icon.
TTI_WARNING
Warning icon
TTI_ERROR
Error Icon
TTI_INFO_LARGE
Large error Icon
TTI_WARNING_LARGE
Large error Icon
TTI_ERROR_LARGE
Large error Icon</wmisc>
</wparam>
<lparam value="LPCTSTR">
<lname>pszTitle</lname>
<lmisc>pszTitle
Pointer to the title string. You must assign a value to pszTitle.</lmisc>
</lparam>
<misc>TTM_SETTITLE Message
Adds a standard icon and title string to a ToolTip.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TTM_SETTITLE, // message ID
(WPARAM) wParam, // = (WPARAM) (int) icon;
(LPARAM) lParam // = (LPARAM) (LPCTSTR) pszTitle;
);
Parameters
icon
Set wParam to one of the following values to specify the icon to be displayed. As of Microsoft Windows XP Service Pack 2 (SP2) and later, this parameter can also contain an HICON value. Any value greater than TTI_ERROR is assumed to be an HICON.
TTI_NONE
No icon.
TTI_INFO
Info icon.
TTI_WARNING
Warning icon
TTI_ERROR
Error Icon
TTI_INFO_LARGE
Large error Icon
TTI_WARNING_LARGE
Large error Icon
TTI_ERROR_LARGE
Large error Icon
pszTitle
Pointer to the title string. You must assign a value to pszTitle.
Return Value
Remarks
The title of a tooltip appears above the text, in a different font. It is not sufficient to have a title; the tooltip must have text as well, or it is not displayed.
When icon contains an HICON, a copy of the icon is created by the ToolTip window.
When calling TTM_SETTITLE, the string pointed to by pszTitle must not exceed 100 TCHARs in length, including the terminating NULL.
Example
The following example shows how to add a title and a system icon to a ToolTip.
Copy Code
// hwndTip is the handle of the ToolTip window.
HICON hIcon = LoadIcon(NULL, IDI_INFORMATION);
SendMessage(hwndTip, TTM_SETTITLE, (WPARAM)hIcon, L"Title text");
DestroyIcon(hIcon);
Message Information
Minimum DLL Version comctl32.dll version 5.80 or later
Header comctl32.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 5, Windows 98, Windows 95 with Internet Explorer 5</misc>
</message>
<message value="0x409">
<name>TTM_SETTOOLINFOA</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPTOOLINFO">
<lname>lpti</lname>
<lmisc>lpti
Pointer to a TOOLINFO structure that specifies the information to set. The cbSize member of this structure must be set before sending this message.
</lmisc>
</lparam>
<misc>TTM_SETTOOLINFO Message
Sets the information that a ToolTip control maintains for a tool.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TTM_SETTOOLINFO, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPTOOLINFO) lpti;
);
Parameters
wParam
Must be zero.
lpti
Pointer to a TOOLINFO structure that specifies the information to set. The cbSize member of this structure must be set before sending this message.
Return Value
Remarks
Some internal properties of a tool are established when the tool is created, and are not recomputed when a TTM_SETTOOLINFO message is sent. If you simply assign values to a TOOLINFO structure and pass it to the ToolTip control with a TTM_SETTOOLINFO message, these properties may be lost. Instead, your application should first request the tool's current TOOLINFO structure by sending the ToolTip control a TTM_GETTOOLINFO message. Then, modify the members of this structure as needed and pass it back to the ToolTip control with TTM_SETTOOLINFO.
When calling TTM_SETTOOLINFO, the string pointed to by the lpszText member of the TOOLINFO structure must not exceed 80 TCHARs in length, including the terminating NULL.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x436">
<name>TTM_SETTOOLINFOW</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPTOOLINFO">
<lname>lpti</lname>
<lmisc>lpti
Pointer to a TOOLINFO structure that specifies the information to set. The cbSize member of this structure must be set before sending this message.
</lmisc>
</lparam>
<misc>TTM_SETTOOLINFO Message
Sets the information that a ToolTip control maintains for a tool.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TTM_SETTOOLINFO, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPTOOLINFO) lpti;
);
Parameters
wParam
Must be zero.
lpti
Pointer to a TOOLINFO structure that specifies the information to set. The cbSize member of this structure must be set before sending this message.
Return Value
Remarks
Some internal properties of a tool are established when the tool is created, and are not recomputed when a TTM_SETTOOLINFO message is sent. If you simply assign values to a TOOLINFO structure and pass it to the ToolTip control with a TTM_SETTOOLINFO message, these properties may be lost. Instead, your application should first request the tool's current TOOLINFO structure by sending the ToolTip control a TTM_GETTOOLINFO message. Then, modify the members of this structure as needed and pass it back to the ToolTip control with TTM_SETTOOLINFO.
When calling TTM_SETTOOLINFO, the string pointed to by the lpszText member of the TOOLINFO structure must not exceed 80 TCHARs in length, including the terminating NULL.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="CCM_SETWINDOWTHEME">
<name>TTM_SETWINDOWTHEME</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x411">
<name>TTM_TRACKACTIVATE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="BOOL">
<wname>bActivate</wname>
<wmisc>bActivate
Value specifying whether tracking is being activated or deactivated. This value can be one of the following:
TRUE
Activate tracking.
FALSE
Deactivate tracking.
</wmisc>
</wparam>
<lparam value="LPTOOLINFO">
<lname>lpti</lname>
<lmisc>lpti
Pointer to a TOOLINFO structure that identifies the tool to which this message applies. The hwnd and uId members identify the tool, and the cbSize member specifies the size of the structure. All other members are ignored.
</lmisc>
</lparam>
<misc>TTM_TRACKACTIVATE Message
Activates or deactivates a tracking ToolTip.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TTM_TRACKACTIVATE, // message ID
(WPARAM) wParam, // = (WPARAM) (BOOL) bActivate;
(LPARAM) lParam // = (LPARAM) (LPTOOLINFO) lpti;
);
Parameters
bActivate
Value specifying whether tracking is being activated or deactivated. This value can be one of the following:
TRUE
Activate tracking.
FALSE
Deactivate tracking.
lpti
Pointer to a TOOLINFO structure that identifies the tool to which this message applies. The hwnd and uId members identify the tool, and the cbSize member specifies the size of the structure. All other members are ignored.
Return Value
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x412">
<name>TTM_TRACKPOSITION</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
The return value for this message is not used.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam not used, must be zero</wmisc>
</wparam>
<lparam value="">
<lname>xPos, yPos</lname>
<lmisc>xPos
The x-coordinate of the point at which the tracking ToolTip will be displayed, in screen coordinates.
yPos
The y-coordinate of the point at which the tracking ToolTip will be displayed, in screen coordinates.
</lmisc>
</lparam>
<misc>TTM_TRACKPOSITION Message
Sets the position of a tracking ToolTip.
To send this message, call the SendMessage function as follows.
Syntax
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TTM_TRACKPOSITION, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) MAKELONG (xPos, yPos)
);
Parameters
xPos
The x-coordinate of the point at which the tracking ToolTip will be displayed, in screen coordinates.
yPos
The y-coordinate of the point at which the tracking ToolTip will be displayed, in screen coordinates.
Return Value
The return value for this message is not used.
Remarks
The ToolTip control chooses where to display the ToolTip window based on the coordinates you provide with this message. This causes the ToolTip window to appear beside the tool to which it corresponds. To have ToolTip windows displayed at specific coordinates, include the TTF_ABSOLUTE flag in the uFlags member of the TOOLINFO structure when adding the tool.
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x41d">
<name>TTM_UPDATE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
The return value for this message is not used.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TTM_UPDATE Message
Forces the current tool to be redrawn.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TTM_UPDATE, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
The return value for this message is not used.
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x40c">
<name>TTM_UPDATETIPTEXTA</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPTOOLINFO">
<lname>lpti</lname>
<lmisc>lpti
Pointer to a TOOLINFO structure. The hinst and lpszText members must specify the instance handle and the address of the text. The hwnd and uId members identify the tool to update. The cbSize member of this structure must be filled in before sending this message.
</lmisc>
</lparam>
<misc>TTM_UPDATETIPTEXT Message
Sets the ToolTip text for a tool.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TTM_UPDATETIPTEXT, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPTOOLINFO) lpti;
);
Parameters
wParam
Must be zero.
lpti
Pointer to a TOOLINFO structure. The hinst and lpszText members must specify the instance handle and the address of the text. The hwnd and uId members identify the tool to update. The cbSize member of this structure must be filled in before sending this message.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x439">
<name>TTM_UPDATETIPTEXTW</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPTOOLINFO">
<lname>lpti</lname>
<lmisc>lpti
Pointer to a TOOLINFO structure. The hinst and lpszText members must specify the instance handle and the address of the text. The hwnd and uId members identify the tool to update. The cbSize member of this structure must be filled in before sending this message.
</lmisc>
</lparam>
<misc>TTM_UPDATETIPTEXT Message
Sets the ToolTip text for a tool.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TTM_UPDATETIPTEXT, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPTOOLINFO) lpti;
);
Parameters
wParam
Must be zero.
lpti
Pointer to a TOOLINFO structure. The hinst and lpszText members must specify the instance handle and the address of the text. The hwnd and uId members identify the tool to update. The cbSize member of this structure must be filled in before sending this message.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x410">
<name>TTM_WINDOWFROMPOINT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="POINT">
<lname>lppt</lname>
<lmisc>lppt
Pointer to a POINT structure that defines the point to be checked. </lmisc>
</lparam>
<misc>TTM_WINDOWFROMPOINT Message
Allows a subclass procedure to cause a ToolTip to display text for a window other than the one beneath the mouse cursor.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TTM_WINDOWFROMPOINT, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (POINT*) lppt;
);
Parameters
wParam
Must be zero.
lppt
Pointer to a POINT structure that defines the point to be checked.
Return Value
Remarks
This message is intended to be processed by an application that subclasses a ToolTip. It is not intended to be sent by an application. A ToolTip sends this message to itself before displaying the text for a window. By changing the coordinates of the point specified by lppt, the subclass procedure can cause the ToolTip to display text for a window other than the one beneath the mouse cursor.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1112">
<name>TVM_CREATEDRAGIMAGE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="HTREEITEM">
<lname>hitem</lname>
<lmisc>hitem
Handle to the item that receives the new dragging bitmap. </lmisc>
</lparam>
<misc>TVM_CREATEDRAGIMAGE Message
Creates a dragging bitmap for the specified item in a tree-view control. The message also creates an image list for the bitmap and adds the bitmap to the image list. An application can display the image when dragging the item by using the image list functions. You can send this message explicitly or by using the TreeView_CreateDragImage macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TVM_CREATEDRAGIMAGE, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (HTREEITEM) hitem;
);
Parameters
wParam
Must be zero.
hitem
Handle to the item that receives the new dragging bitmap.
Return Value
Remarks
If you create a tree-view control without an associated image list, you cannot use the TVM_CREATEDRAGIMAGE message to create the image to display during a drag operation. You must implement your own method of creating a drag cursor.
Your application is responsible for destroying the image list when it is no longer needed.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1101">
<name>TVM_DELETEITEM</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="HTREEITEM">
<lname>hitem</lname>
<lmisc> hitem
HTREEITEM handle to the item to delete. If hitem is set to TVI_ROOT or to NULL, all items are deleted. You can also use the TreeView_DeleteAllItems macro to delete all items.
</lmisc>
</lparam>
<misc>TVM_DELETEITEM Message
Removes an item and all its children from a tree-view control. You can send this message explicitly or by using the TreeView_DeleteItem macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TVM_DELETEITEM, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (HTREEITEM) hitem;
);
Parameters
wParam
Must be zero.
hitem
HTREEITEM handle to the item to delete. If hitem is set to TVI_ROOT or to NULL, all items are deleted. You can also use the TreeView_DeleteAllItems macro to delete all items.
Return Value
Remarks
It is not safe to delete items in response to a notification such as TVN_SELCHANGING.
Once an item is deleted, its handle is invalid and cannot be used.
The parent window receives a TVN_DELETEITEM notification message when each item is removed.
If the item label is being edited, the edit operation is canceled and the parent window receives the TVN_ENDLABELEDIT notification message.
If you delete all items in a tree-view control that has the TVS_NOSCROLL style, items subsequently added may not display properly. For more information, see TreeView_DeleteAllItems.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x110e">
<name>TVM_EDITLABELA</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="HTREEITEM">
<lname>hitem</lname>
<lmisc>hitem
Handle to the item to edit. </lmisc>
</lparam>
<misc>TVM_EDITLABEL Message
Begins in-place editing of the specified item's text, replacing the text of the item with a single-line edit control containing the text. This message implicitly selects and focuses the specified item. You can send this message explicitly or by using the TreeView_EditLabel macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TVM_EDITLABEL, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (HTREEITEM) hitem;
);
Parameters
wParam
Must be zero.
hitem
Handle to the item to edit.
Return Value
Remarks
This message sends a TVN_BEGINLABELEDIT notification message to the parent of the tree-view control.
When the user completes or cancels editing, the edit control is destroyed and the handle is no longer valid. You can subclass the edit control, but do not destroy it.
The control must have the focus before you send this message to the control. Focus can be set using the SetFocus function.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1141">
<name>TVM_EDITLABELW</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="HTREEITEM">
<lname>hitem</lname>
<lmisc>hitem
Handle to the item to edit. </lmisc>
</lparam>
<misc>TVM_EDITLABEL Message
Begins in-place editing of the specified item's text, replacing the text of the item with a single-line edit control containing the text. This message implicitly selects and focuses the specified item. You can send this message explicitly or by using the TreeView_EditLabel macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TVM_EDITLABEL, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (HTREEITEM) hitem;
);
Parameters
wParam
Must be zero.
hitem
Handle to the item to edit.
Return Value
Remarks
This message sends a TVN_BEGINLABELEDIT notification message to the parent of the tree-view control.
When the user completes or cancels editing, the edit control is destroyed and the handle is no longer valid. You can subclass the edit control, but do not destroy it.
The control must have the focus before you send this message to the control. Focus can be set using the SetFocus function.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1116">
<name>TVM_ENDEDITLABELNOW</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="BOOL">
<wname>fCancel</wname>
<wmisc>fCancel
Variable that indicates whether the editing is canceled without being saved to the label. If this parameter is TRUE, the system cancels editing without saving the changes. Otherwise, the system saves the changes to the label.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TVM_ENDEDITLABELNOW Message
Ends the editing of a tree-view item's label. You can send this message explicitly or by using the TreeView_EndEditLabelNow macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TVM_ENDEDITLABELNOW, // message ID
(WPARAM) wParam, // = (WPARAM) (BOOL) fCancel;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
fCancel
Variable that indicates whether the editing is canceled without being saved to the label. If this parameter is TRUE, the system cancels editing without saving the changes. Otherwise, the system saves the changes to the label.
lParam
Must be zero.
Return Value
Remarks
This message causes the TVN_ENDLABELEDIT notification message to be sent to the parent window of the tree-view control.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1114">
<name>TVM_ENSUREVISIBLE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="HTREEITEM">
<lname>hitem</lname>
<lmisc>hitem
Handle to the item. </lmisc>
</lparam>
<misc>TVM_ENSUREVISIBLE Message
Ensures that a tree-view item is visible, expanding the parent item or scrolling the tree-view control, if necessary. You can send this message explicitly or by using the TreeView_EnsureVisible macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TVM_ENSUREVISIBLE, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (HTREEITEM) hitem;
);
Parameters
wParam
Must be zero.
hitem
Handle to the item.
Return Value
Remarks
If the TVM_ENSUREVISIBLE message expands the parent item, the parent window receives the TVN_ITEMEXPANDING and TVN_ITEMEXPANDED notification messages.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1102">
<name>TVM_EXPAND</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns nonzero if the operation was successful, or zero otherwise.</returnmisc>
</return>
<wparam value="UINT">
<wname>flag</wname>
<wmisc>flag
Action flag. This parameter can be one or more of the following values:
TVE_COLLAPSE
Collapses the list.
TVE_COLLAPSERESET
Collapses the list and removes the child items. The TVIS_EXPANDEDONCE state flag is reset. This flag must be used with the TVE_COLLAPSE flag.
TVE_EXPAND
Expands the list.
TVE_EXPANDPARTIAL
Version 4.70. Partially expands the list. In this state the child items are visible and the parent item's plus sign (+), indicating that it can be expanded, is displayed. This flag must be used in combination with the TVE_EXPAND flag.
TVE_TOGGLE
Collapses the list if it is expanded or expands it if it is collapsed.
</wmisc>
</wparam>
<lparam value="HTREEITEM">
<lname>hItem</lname>
<lmisc>hItem
Handle to the parent item to expand or collapse. </lmisc>
</lparam>
<misc>TVM_EXPAND Message
The TVM_EXPAND message expands or collapses the list of child items associated with the specified parent item, if any. You can send this message explicitly or by using the TreeView_Expand macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TVM_EXPAND, // message ID
(WPARAM) wParam, // = (WPARAM) (UINT) flag;
(LPARAM) lParam // = (LPARAM) (HTREEITEM) hItem;
);
Parameters
flag
Action flag. This parameter can be one or more of the following values:
TVE_COLLAPSE
Collapses the list.
TVE_COLLAPSERESET
Collapses the list and removes the child items. The TVIS_EXPANDEDONCE state flag is reset. This flag must be used with the TVE_COLLAPSE flag.
TVE_EXPAND
Expands the list.
TVE_EXPANDPARTIAL
Version 4.70. Partially expands the list. In this state the child items are visible and the parent item's plus sign (+), indicating that it can be expanded, is displayed. This flag must be used in combination with the TVE_EXPAND flag.
TVE_TOGGLE
Collapses the list if it is expanded or expands it if it is collapsed.
hItem
Handle to the parent item to expand or collapse.
Return Value
Returns nonzero if the operation was successful, or zero otherwise.
Remarks
Expanding a node that is already expanded is considered a successful operation and SendMessage returns a non-zero value. Collapsing a node returns zero if the node is already collapsed; otherwise it returns non-zero. Attempting to expand or collapse a node that has no children is considered a failure and SendMessage returns zero.
When an item is first expanded by a TVM_EXPAND message, the action generates TVN_ITEMEXPANDING and TVN_ITEMEXPANDED notification messages and the item's TVIS_EXPANDEDONCE state flag is set. As long as this state flag remains set, subsequent TVM_EXPAND messages do not generate TVN_ITEMEXPANDING or TVN_ITEMEXPANDED notifications. To reset the TVIS_EXPANDEDONCE state flag, you must send a TVM_EXPAND message with the TVE_COLLAPSE and TVE_COLLAPSERESET flags set. Attempting to explicitly set TVIS_EXPANDEDONCE will result in unpredictable behavior.
The expand operation may fail if the owner of the treeview control denies the operation in response to a TVN_ITEMEXPANDING notification.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x111f">
<name>TVM_GETBKCOLOR</name>
<return value="COLORREF">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns a COLORREF value that represents the current background color. If this value is -1, the control is using the system color for the background color.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TVM_GETBKCOLOR Message
Retrieves the current background color of the control. You can send this message explicitly or by using the TreeView_GetBkColor macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TVM_GETBKCOLOR, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Returns a COLORREF value that represents the current background color. If this value is -1, the control is using the system color for the background color.
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x1105">
<name>TVM_GETCOUNT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.
</lmisc>
</lparam>
<misc>TVM_GETCOUNT Message
Retrieves a count of the items in a tree-view control. You can send this message explicitly or by using the TreeView_GetCount macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TVM_GETCOUNT, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Remarks
The node count returned by TreeView_GetCount is limited to integer values. If you add a node beyond 32767 the macro returns a negative value. After adding 65536 nodes the count returns to zero. When this occurs, the tree-view control appears empty with no scrollbars.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x110f">
<name>TVM_GETEDITCONTROL</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TVM_GETEDITCONTROL Message
Retrieves the handle to the edit control being used to edit a tree-view item's text. You can send this message explicitly or by using the TreeView_GetEditControl macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TVM_GETEDITCONTROL, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Remarks
When label editing begins, an edit control is created, but not positioned or displayed. Before it is displayed, the tree-view control sends its parent window an TVN_BEGINLABELEDIT notification message.
To customize label editing, implement a handler for TVN_BEGINLABELEDIT and have it send a TVM_GETEDITCONTROL message to the tree-view control. If a label is being edited, the return value will be a handle to the edit control. Use this handle to customize the edit control by sending the usual EM_XXX messages.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1108">
<name>TVM_GETIMAGELIST</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>iImage</wname>
<wmisc>iImage
Type of image list to retrieve. This parameter can be one of the following values:
TVSIL_NORMAL
Indicates the normal image list, which contains selected, nonselected, and overlay images for the items of a tree-view control.
TVSIL_STATE
Indicates the state image list. You can use state images to indicate application-defined item states. A state image is displayed to the left of an item's selected or nonselected image.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TVM_GETIMAGELIST Message
Retrieves the handle to the normal or state image list associated with a tree-view control. You can send this message explicitly or by using the TreeView_GetImageList macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TVM_GETIMAGELIST, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iImage;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
iImage
Type of image list to retrieve. This parameter can be one of the following values:
TVSIL_NORMAL
Indicates the normal image list, which contains selected, nonselected, and overlay images for the items of a tree-view control.
TVSIL_STATE
Indicates the state image list. You can use state images to indicate application-defined item states. A state image is displayed to the left of an item's selected or nonselected image.
lParam
Must be zero.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1106">
<name>TVM_GETINDENT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TVM_GETINDENT Message
Retrieves the amount, in pixels, that child items are indented relative to their parent items. You can send this message explicitly or by using the TreeView_GetIndent macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TVM_GETINDENT, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1126">
<name>TVM_GETINSERTMARKCOLOR</name>
<return value="COLORREF">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns a COLORREF value that contains the current insertion mark color.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TVM_GETINSERTMARKCOLOR Message
Retrieves the color used to draw the insertion mark for the tree view. You can send this message explicitly or by using the TreeView_GetInsertMarkColor macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TVM_GETINSERTMARKCOLOR, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Returns a COLORREF value that contains the current insertion mark color.
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x1117">
<name>TVM_GETISEARCHSTRINGA</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPSTR">
<lname>lpsz</lname>
<lmisc>lpsz
Pointer to the buffer that receives the incremental search string. </lmisc>
</lparam>
<misc>TVM_GETISEARCHSTRING Message
Retrieves the incremental search string for a tree-view control. The tree-view control uses the incremental search string to select an item based on characters typed by the user. You can send this message explicitly or by using the TreeView_GetISearchString macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TVM_GETISEARCHSTRING, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPSTR) lpsz;
);
Parameters
wParam
Must be zero.
lpsz
Pointer to the buffer that receives the incremental search string.
Return Value
Remarks
security note Security Alert Using this message incorrectly might compromise the security of your program. You must allocate a large enough buffer to hold the string. First call the message passing NULL in lpsz. This returns the number of characters, excluding NULL, that are required. Then call the message a second time to retrieve the string. You should review Security Considerations: Microsoft Windows Controls before continuing.
If the tree-view control is not in incremental search mode, the return value is zero.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1140">
<name>TVM_GETISEARCHSTRINGW</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPSTR">
<lname>lpsz</lname>
<lmisc>lpsz
Pointer to the buffer that receives the incremental search string. </lmisc>
</lparam>
<misc>TVM_GETISEARCHSTRING Message
Retrieves the incremental search string for a tree-view control. The tree-view control uses the incremental search string to select an item based on characters typed by the user. You can send this message explicitly or by using the TreeView_GetISearchString macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TVM_GETISEARCHSTRING, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPSTR) lpsz;
);
Parameters
wParam
Must be zero.
lpsz
Pointer to the buffer that receives the incremental search string.
Return Value
Remarks
security note Security Alert Using this message incorrectly might compromise the security of your program. You must allocate a large enough buffer to hold the string. First call the message passing NULL in lpsz. This returns the number of characters, excluding NULL, that are required. Then call the message a second time to retrieve the string. You should review Security Considerations: Microsoft Windows Controls before continuing.
If the tree-view control is not in incremental search mode, the return value is zero.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x110c">
<name>TVM_GETITEMA</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPTVITEMEX">
<lname>pitem</lname>
<lmisc>pitem
Pointer to a TVITEM structure that specifies the information to retrieve and receives information about the item. With version 4.71 and later, you can use a TVITEMEX structure instead.
</lmisc>
</lparam>
<misc>TVM_GETITEM Message
Retrieves some or all of a tree-view item's attributes. You can send this message explicitly or by using the TreeView_GetItem macro.
To send this message, call the SendMessage function as follows.
Syntax
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TVM_GETITEM, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPTVITEM) pitem
- Version 4.71 and later -
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPTVITEMEX) pitem
);
Parameters
wParam
Must be zero.
pitem
Pointer to a TVITEM structure that specifies the information to retrieve and receives information about the item. With version 4.71 and later, you can use a TVITEMEX structure instead.
Return Value
Remarks
When the message is sent, the hItem member of the TVITEM or TVITEMEX structure identifies the item to retrieve information about, and the mask member specifies the attributes to retrieve.
If the TVIF_TEXT flag is set in the mask member of the TVITEM or TVITEMEX structure, the pszText member must point to a valid buffer and the cchTextMax member must be set to the number of characters in that buffer.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x111c">
<name>TVM_GETITEMHEIGHT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TVM_GETITEMHEIGHT Message
Retrieves the current height of the each tree-view item. You can send this message explicitly or by using the TreeView_GetItemHeight macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TVM_GETITEMHEIGHT, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x1104">
<name>TVM_GETITEMRECT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="BOOL">
<wname>fItemRect</wname>
<wmisc>fItemRect
Value specifying the portion of the item for which to retrieve the bounding rectangle. If this parameter is TRUE, the bounding rectangle includes only the text of the item. Otherwise, it includes the entire line that the item occupies in the tree-view control.
</wmisc>
</wparam>
<lparam value="RECT">
<lname>prc</lname>
<lmisc>prc
Pointer to a RECT structure that, when sending the message, contains the handle of the item to retrieve the rectangle for. See the example below for more information on how to place the item handle in this parameter. After returning from the message, this parameter contains the bounding rectangle. The coordinates are relative to the upper-left corner of the tree-view control.
</lmisc>
</lparam>
<misc>TVM_GETITEMRECT Message
Retrieves the bounding rectangle for a tree-view item and indicates whether the item is visible. You can send this message explicitly or by using the TreeView_GetItemRect macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TVM_GETITEMRECT, // message ID
(WPARAM) wParam, // = (WPARAM) (BOOL) fItemRect;
(LPARAM) lParam // = (LPARAM) (LPRECT) prc;
);
Parameters
fItemRect
Value specifying the portion of the item for which to retrieve the bounding rectangle. If this parameter is TRUE, the bounding rectangle includes only the text of the item. Otherwise, it includes the entire line that the item occupies in the tree-view control.
prc
Pointer to a RECT structure that, when sending the message, contains the handle of the item to retrieve the rectangle for. See the example below for more information on how to place the item handle in this parameter. After returning from the message, this parameter contains the bounding rectangle. The coordinates are relative to the upper-left corner of the tree-view control.
Return Value
Remarks
When sending this message, the prc parameter contains the handle of the item that the rectangle is being retrieved for. The handle is placed in prc as shown in the following example:
Copy Code
RECT rc;
*(HTREEITEM*)rc = hTreeItem;
SendMessage(hwndTreeView, TVM_GETITEMRECT, FALSE, (LPARAM)rc);
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1127">
<name>TVM_GETITEMSTATE</name>
<return value="UINT">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns a UINT value with the appropriate state bits set to TRUE. Only those bits that are are specified by stateMask and that are TRUE will be set. This value is equivalent to the state member of TVITEMEX.
</returnmisc>
</return>
<wparam value="">
<wname>hItem</wname>
<wmisc>hItem
Handle to the item.</wmisc>
</wparam>
<lparam value="UINT">
<lname>stateMask</lname>
<lmisc>stateMask
Mask used to specify the states to query for. It is equivalent to the stateMask member of TVITEMEX.</lmisc>
</lparam>
<misc>TVM_GETITEMSTATE Message
Retrieves some or all of a tree-view item's state attributes. You can send this message explicitly or by using the TreeView_GetItemState macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TVM_GETITEMSTATE, // message ID
(WPARAM) wParam, // = (WPARAM) (HTREEITEM) hItem;
(LPARAM) lParam // = (LPARAM) (UINT) stateMask;
);
Parameters
hItem
Handle to the item.
stateMask
Mask used to specify the states to query for. It is equivalent to the stateMask member of TVITEMEX.
Return Value
Returns a UINT value with the appropriate state bits set to TRUE. Only those bits that are are specified by stateMask and that are TRUE will be set. This value is equivalent to the state member of TVITEMEX.
Message Information
Minimum DLL Version comctl32.dll version 5.80 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 5, Windows 98, Windows 95 with Internet Explorer 5</misc>
</message>
<message value="0x113e">
<name>TVM_GETITEMW</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPTVITEMEX">
<lname>pitem</lname>
<lmisc>pitem
Pointer to a TVITEM structure that specifies the information to retrieve and receives information about the item. With version 4.71 and later, you can use a TVITEMEX structure instead.
</lmisc>
</lparam>
<misc>TVM_GETITEM Message
Retrieves some or all of a tree-view item's attributes. You can send this message explicitly or by using the TreeView_GetItem macro.
To send this message, call the SendMessage function as follows.
Syntax
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TVM_GETITEM, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPTVITEM) pitem
- Version 4.71 and later -
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPTVITEMEX) pitem
);
Parameters
wParam
Must be zero.
pitem
Pointer to a TVITEM structure that specifies the information to retrieve and receives information about the item. With version 4.71 and later, you can use a TVITEMEX structure instead.
Return Value
Remarks
When the message is sent, the hItem member of the TVITEM or TVITEMEX structure identifies the item to retrieve information about, and the mask member specifies the attributes to retrieve.
If the TVIF_TEXT flag is set in the mask member of the TVITEM or TVITEMEX structure, the pszText member must point to a valid buffer and the cchTextMax member must be set to the number of characters in that buffer.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1129">
<name>TVM_GETLINECOLOR</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TVM_GETLINECOLOR Message
The TVM_GETLINECOLOR message gets the current line color.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TVM_GETLINECOLOR, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Remarks
This message only retrieves line colors. To retrieve the colors of the '+' and '-' inside the buttons, use the TVM_GETTEXTCOLOR message.
Message Information
Minimum DLL Version comctl32.dll version 5.80 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 5, Windows 98, Windows 95 with Internet Explorer 5</misc>
</message>
<message value="0x110a">
<name>TVM_GETNEXTITEM</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="UINT">
<wname>flag</wname>
<wmisc>flag
Flag specifying the item to retrieve. This parameter can be one of the following values:
TVGN_CARET
Retrieves the currently selected item. You can use the TreeView_GetSelection macro to send this message.
TVGN_CHILD
Retrieves the first child item of the item specified by the hitem parameter. You can use the TreeView_GetChild macro to send this message.
TVGN_DROPHILITE
Retrieves the item that is the target of a drag-and-drop operation. You can use the TreeView_GetDropHilight macro to send this message.
TVGN_FIRSTVISIBLE
Retrieves the first item that is visible in the tree-view window. You can use the TreeView_GetFirstVisible macro to send this message.
TVGN_LASTVISIBLE
Version 4.71. Retrieves the last expanded item in the tree. This does not retrieve the last item visible in the tree-view window. You can use the TreeView_GetLastVisible macro to send this message.
TVGN_NEXT
Retrieves the next sibling item. You can use the TreeView_GetNextSibling macro to send this message.
TVGN_NEXTSELECTED
Microsoft Windows Vista and later. Retrieves the next selected item. You can use the TreeView_GetNextSelected macro to send this message.
TVGN_NEXTVISIBLE
Retrieves the next visible item that follows the specified item. The specified item must be visible. Use the TVM_GETITEMRECT message to determine whether an item is visible. You can use the TreeView_GetNextVisible macro to send this message.
TVGN_PARENT
Retrieves the parent of the specified item. You can use the TreeView_GetParent macro to send this message.
TVGN_PREVIOUS
Retrieves the previous sibling item. You can use the TreeView_GetPrevSibling macro to send this message.
TVGN_PREVIOUSVISIBLE
Retrieves the first visible item that precedes the specified item. The specified item must be visible. Use the TVM_GETITEMRECT message to determine whether an item is visible. You can use the TreeView_GetPrevVisible macro to send this message.
TVGN_ROOT
Retrieves the topmost or very first item of the tree-view control. You can use the TreeView_GetRoot macro to send this message.
</wmisc>
</wparam>
<lparam value="HTREEITEM">
<lname>hitem</lname>
<lmisc>hitem
Handle to an item. </lmisc>
</lparam>
<misc>TVM_GETNEXTITEM Message
Retrieves the tree-view item that bears the specified relationship to a specified item. You can send this message explicitly, by using the TreeView_GetNextItem macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TVM_GETNEXTITEM, // message ID
(WPARAM) wParam, // = (WPARAM) (UINT) flag;
(LPARAM) lParam // = (LPARAM) (HTREEITEM) hitem;
);
Parameters
flag
Flag specifying the item to retrieve. This parameter can be one of the following values:
TVGN_CARET
Retrieves the currently selected item. You can use the TreeView_GetSelection macro to send this message.
TVGN_CHILD
Retrieves the first child item of the item specified by the hitem parameter. You can use the TreeView_GetChild macro to send this message.
TVGN_DROPHILITE
Retrieves the item that is the target of a drag-and-drop operation. You can use the TreeView_GetDropHilight macro to send this message.
TVGN_FIRSTVISIBLE
Retrieves the first item that is visible in the tree-view window. You can use the TreeView_GetFirstVisible macro to send this message.
TVGN_LASTVISIBLE
Version 4.71. Retrieves the last expanded item in the tree. This does not retrieve the last item visible in the tree-view window. You can use the TreeView_GetLastVisible macro to send this message.
TVGN_NEXT
Retrieves the next sibling item. You can use the TreeView_GetNextSibling macro to send this message.
TVGN_NEXTSELECTED
Microsoft Windows Vista and later. Retrieves the next selected item. You can use the TreeView_GetNextSelected macro to send this message.
TVGN_NEXTVISIBLE
Retrieves the next visible item that follows the specified item. The specified item must be visible. Use the TVM_GETITEMRECT message to determine whether an item is visible. You can use the TreeView_GetNextVisible macro to send this message.
TVGN_PARENT
Retrieves the parent of the specified item. You can use the TreeView_GetParent macro to send this message.
TVGN_PREVIOUS
Retrieves the previous sibling item. You can use the TreeView_GetPrevSibling macro to send this message.
TVGN_PREVIOUSVISIBLE
Retrieves the first visible item that precedes the specified item. The specified item must be visible. Use the TVM_GETITEMRECT message to determine whether an item is visible. You can use the TreeView_GetPrevVisible macro to send this message.
TVGN_ROOT
Retrieves the topmost or very first item of the tree-view control. You can use the TreeView_GetRoot macro to send this message.
hitem
Handle to an item.
Return Value
Remarks
This message will return NULL if the item being retrieved is the root node of the tree. For example, if you use this message with with the TVGN_PARENT flag on a first-level child of the tree view's root node, the message will return NULL.
You can also use one of these related macros:
TreeView_GetChild
TreeView_GetDropHilight
TreeView_GetFirstVisible
TreeView_GetLastVisible
TreeView_GetNextSibling
TreeView_GetNextVisible
TreeView_GetParent
TreeView_GetPrevSibling
TreeView_GetPrevVisible
TreeView_GetRoot
TreeView_GetSelection
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1122">
<name>TVM_GETSCROLLTIME</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.
</lmisc>
</lparam>
<misc>TVM_GETSCROLLTIME Message
Retrieves the maximum scroll time for the tree-view control. You can send this message explicitly or by using the TreeView_GetScrollTime macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TVM_GETSCROLLTIME, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Remarks
The maximum scroll time is the longest amount of time that a scroll operation can take. The scrolling will be adjusted so that the scroll will take place within the maximum scroll time. A scroll operation may take less time than the maximum.
Message Information
Minimum DLL Version comctl32.dll version 4.00 or later
Header commctrl.h
Minimum operating systems Windows NT 4.0, Windows 95</misc>
</message>
<message value="0x1120">
<name>TVM_GETTEXTCOLOR</name>
<return value="COLORREF">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns a COLORREF value that represents the current text color. If this value is -1, the control is using the system color for the text color.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TVM_GETTEXTCOLOR Message
Retrieves the current text color of the control. You can send this message explicitly or by using the TreeView_GetTextColor macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TVM_GETTEXTCOLOR, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Returns a COLORREF value that represents the current text color. If this value is -1, the control is using the system color for the text color.
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x1119">
<name>TVM_GETTOOLTIPS</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TVM_GETTOOLTIPS Message
Retrieves the handle to the child ToolTip control used by a tree-view control. You can send this message explicitly or by using the TreeView_GetToolTips macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TVM_GETTOOLTIPS, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Remarks
When created, tree-view controls automatically create a child ToolTip control. To cause a tree-view control not to use ToolTips, create the control with the TVS_NOTOOLTIPS style.
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x1110">
<name>TVM_GETVISIBLECOUNT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TVM_GETVISIBLECOUNT Message
Obtains the number of items that can be fully visible in the client window of a tree-view control. You can send this message explicitly or by using the TreeView_GetVisibleCount macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TVM_GETVISIBLECOUNT, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Must be zero.
lParam
Must be zero.
Return Value
Remarks
The number of items that can be fully visible may be greater than the number of items in the control. The control calculates this value by dividing the height of the client window by the height of an item.
Note that the return value is the number of items that can be fully visible. If you can see all of 20 items and part of one more item, the return value is 20.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1111">
<name>TVM_HITTEST</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPTVHITTESTINFO">
<lname>lpht</lname>
<lmisc>lpht
Pointer to a TVHITTESTINFO structure. When the message is sent, the pt member specifies the coordinates of the point to test. When the message returns, the hItem member is the handle to the item at the specified point or NULL if no item occupies the point. Also, when the message returns, the flags member is a hit test value that indicates the location of the specified point. For a list of hit test values, see the description of the TVHITTESTINFO structure.
</lmisc>
</lparam>
<misc>TVM_HITTEST Message
Determines the location of the specified point relative to the client area of a tree-view control. You can send this message explicitly or by using the TreeView_HitTest macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TVM_HITTEST, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPTVHITTESTINFO) lpht;
);
Parameters
wParam
Must be zero.
lpht
Pointer to a TVHITTESTINFO structure. When the message is sent, the pt member specifies the coordinates of the point to test. When the message returns, the hItem member is the handle to the item at the specified point or NULL if no item occupies the point. Also, when the message returns, the flags member is a hit test value that indicates the location of the specified point. For a list of hit test values, see the description of the TVHITTESTINFO structure.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1100">
<name>TVM_INSERTITEMA</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPTVINSERTSTRUCT">
<lname>lpis</lname>
<lmisc>lpis
Pointer to a TVINSERTSTRUCT structure that specifies the attributes of the tree-view item. </lmisc>
</lparam>
<misc>TVM_INSERTITEM Message
Inserts a new item in a tree-view control. You can send this message explicitly or by using the TreeView_InsertItem macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TVM_INSERTITEM, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPTVINSERTSTRUCT) lpis;
);
Parameters
wParam
Must be zero.
lpis
Pointer to a TVINSERTSTRUCT structure that specifies the attributes of the tree-view item.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1132">
<name>TVM_INSERTITEMW</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPTVINSERTSTRUCT">
<lname>lpis</lname>
<lmisc>lpis
Pointer to a TVINSERTSTRUCT structure that specifies the attributes of the tree-view item. </lmisc>
</lparam>
<misc>TVM_INSERTITEM Message
Inserts a new item in a tree-view control. You can send this message explicitly or by using the TreeView_InsertItem macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TVM_INSERTITEM, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPTVINSERTSTRUCT) lpis;
);
Parameters
wParam
Must be zero.
lpis
Pointer to a TVINSERTSTRUCT structure that specifies the attributes of the tree-view item.
Return Value
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x112a">
<name>TVM_MAPACCIDTOHTREEITEM</name>
<return value="HTREEITEM">
<returninfo>returns HTREEITEM in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="UINT">
<wname>id</wname>
<wmisc>id
UINT that contains the accessibility ID to map to an HTREEITEM. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TVM_MAPACCIDTOHTREEITEM Message
Maps an accessibility ID to an HTREEITEM.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns HTREEITEM in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TVM_MAPACCIDTOHTREEITEM, // message ID
(WPARAM) wParam, // = (WPARAM) (UINT) id;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
id
UINT that contains the accessibility ID to map to an HTREEITEM.
lParam
Must be zero.
Return Value
Remarks
When you add an item to a tree-view control an HTREEITEM returns, which uniquely identifies the item.
Note To use this API, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.
Message Information
Header commctrl.h
Minimum operating systems Windows XP</misc>
</message>
<message value="0x112b">
<name>TVM_MAPHTREEITEMTOACCID</name>
<return value="UINT">
<returninfo>returns UINT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="HTREEITEM">
<wname>htreeitem</wname>
<wmisc>htreeitem
HTREEITEM that is mapped to an accessibility ID.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TVM_MAPHTREEITEMTOACCID Message
Maps an HTREEITEM to an accessibility ID.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns UINT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TVM_MAPHTREEITEMTOACCID, // message ID
(WPARAM) wParam, // = (WPARAM) (HTREEITEM) htreeitem;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
htreeitem
HTREEITEM that is mapped to an accessibility ID.
lParam
Must be zero.
Return Value
Remarks
When you add an item to a tree-view control an HTREEITEM handle is returned that uniquely identifies the item.
Note To use this API, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.
Message Information
Header commctrl.h
Minimum operating systems Windows XP</misc>
</message>
<message value="0x110b">
<name>TVM_SELECTITEM</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="DWORD">
<wname>flag</wname>
<wmisc>flag
Action flag. This parameter can be one of the following values:
TVGN_CARET
Sets the selection to the specified item. The tree-view control's parent window receives the TVN_SELCHANGING and TVN_SELCHANGED notification messages.
TVGN_DROPHILITE
Redraws the specified item in the style used to indicate the target of a drag-and-drop operation.
TVGN_FIRSTVISIBLE
Ensures that the specified item is visible, and, if possible, displays it at the top of the control's window. Tree-view controls display as many items as will fit in the window. If the specified item is near the bottom of the control's hierarchy of items, it might not become the first visible item, depending on how many items fit in the window.
TVSI_NOSINGLEEXPAND
Windows XP and later: When a single item is selected, ensures that the treeview does not expand the children of that item. This is valid only if used with the TVGN_CARET flag.
Note To use this flag, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.
</wmisc>
</wparam>
<lparam value="HTREEITEM">
<lname>hitem</lname>
<lmisc>hitem
Handle to an item. If hitem is NULL, the control is set to have no selected item. </lmisc>
</lparam>
<misc>TVM_SELECTITEM Message
Selects the specified tree-view item, scrolls the item into view, or redraws the item in the style used to indicate the target of a drag-and-drop operation. You can send this message explicitly or by using the TreeView_Select, TreeView_SelectItem, or TreeView_SelectDropTarget macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TVM_SELECTITEM, // message ID
(WPARAM) wParam, // = (WPARAM) (DWORD) flag;
(LPARAM) lParam // = (LPARAM) (HTREEITEM) hitem;
);
Parameters
flag
Action flag. This parameter can be one of the following values:
TVGN_CARET
Sets the selection to the specified item. The tree-view control's parent window receives the TVN_SELCHANGING and TVN_SELCHANGED notification messages.
TVGN_DROPHILITE
Redraws the specified item in the style used to indicate the target of a drag-and-drop operation.
TVGN_FIRSTVISIBLE
Ensures that the specified item is visible, and, if possible, displays it at the top of the control's window. Tree-view controls display as many items as will fit in the window. If the specified item is near the bottom of the control's hierarchy of items, it might not become the first visible item, depending on how many items fit in the window.
TVSI_NOSINGLEEXPAND
Windows XP and later: When a single item is selected, ensures that the treeview does not expand the children of that item. This is valid only if used with the TVGN_CARET flag.
Note To use this flag, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.
hitem
Handle to an item. If hitem is NULL, the control is set to have no selected item.
Return Value
Remarks
If the specified item is the child of a collapsed parent item, the parent's list of child items is expanded to reveal the specified item. In this case, the control's parent window receives the TVN_ITEMEXPANDING and TVN_ITEMEXPANDED notification messages.
Using the TreeView_SelectItem macro is equivalent to sending the TVM_SELECTITEM message with flag set to the TVGN_CARET value. Using the TreeView_SelectDropTarget macro is equivalent to sending the TVM_SELECTITEM message with flag set to the TVGN_DROPHILITE value. Using TreeView_SelectSetFirstVisible is equivalent to sending the TVM_SELECTITEM message with flag set to the TVGN_FIRSTVISIBLE value.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x111d">
<name>TVM_SETBKCOLOR</name>
<return value="COLORREF">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns a COLORREF value that represents the previous background color. If this value is -1, the control was using the system color for the background color.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="COLORREF">
<lname>clrBk</lname>
<lmisc>clrBk
COLORREF value that contains the new background color. If this value is -1, the control will revert to using the system color for the background color.
</lmisc>
</lparam>
<misc>TVM_SETBKCOLOR Message
Sets the background color of the control. You can send this message explicitly or by using the TreeView_SetBkColor macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TVM_SETBKCOLOR, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (COLORREF) clrBk;
);
Parameters
wParam
Must be zero.
clrBk
COLORREF value that contains the new background color. If this value is -1, the control will revert to using the system color for the background color.
Return Value
Returns a COLORREF value that represents the previous background color. If this value is -1, the control was using the system color for the background color.
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x1109">
<name>TVM_SETIMAGELIST</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>iImage</wname>
<wmisc>iImage
Type of image list to set. This parameter can be one of the following values:
TVSIL_NORMAL
Indicates the normal image list, which contains selected, nonselected, and overlay images for the items of a tree-view control.
TVSIL_STATE
Indicates the state image list. You can use state images to indicate application-defined item states. A state image is displayed to the left of an item's selected or nonselected image.
</wmisc>
</wparam>
<lparam value="HIMAGELIST">
<lname>himl</lname>
<lmisc>himl
Handle to the image list. If himl is NULL, the message removes the specified image list from the tree-view control.
</lmisc>
</lparam>
<misc>TVM_SETIMAGELIST Message
Sets the normal or state image list for a tree-view control and redraws the control using the new images. You can send this message explicitly or by using the TreeView_SetImageList macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TVM_SETIMAGELIST, // message ID
(WPARAM) wParam, // = (WPARAM) (int) iImage;
(LPARAM) lParam // = (LPARAM) (HIMAGELIST) himl;
);
Parameters
iImage
Type of image list to set. This parameter can be one of the following values:
TVSIL_NORMAL
Indicates the normal image list, which contains selected, nonselected, and overlay images for the items of a tree-view control.
TVSIL_STATE
Indicates the state image list. You can use state images to indicate application-defined item states. A state image is displayed to the left of an item's selected or nonselected image.
himl
Handle to the image list. If himl is NULL, the message removes the specified image list from the tree-view control.
Return Value
Remarks
The tree-view control will not destroy the image list specified with this message. Your application must destroy the image list when it is no longer needed.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1107">
<name>TVM_SETINDENT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="INT">
<wname>indent</wname>
<wmisc>indent
Width, in pixels, of the indentation. If this parameter is less than the system-defined minimum width, the new width is set to the system-defined minimum.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TVM_SETINDENT Message
Sets the width of indentation for a tree-view control and redraws the control to reflect the new width. You can send this message explicitly or by using the TreeView_SetIndent macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TVM_SETINDENT, // message ID
(WPARAM) wParam, // = (WPARAM) (INT) indent;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
indent
Width, in pixels, of the indentation. If this parameter is less than the system-defined minimum width, the new width is set to the system-defined minimum.
lParam
Must be zero.
Return Value
Remarks
The system-defined minimum indent value is typically five pixels, but it is not fixed. To retrieve the exact value of the minimum indent on a particular system, send a TVM_SETINDENT message with indent set to zero. Then send a TVM_GETINDENT message to retrieve the minimum indent value.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x111a">
<name>TVM_SETINSERTMARK</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="BOOL">
<wname>fAfter</wname>
<wmisc>fAfter
BOOL value that specifies if the insertion mark is placed before or after the specified item. If this argument is nonzero, the insertion mark will be placed after the item. If this argument is zero, the insertion mark will be placed before the item.
</wmisc>
</wparam>
<lparam value="HTREEITEM">
<lname>htiInsert</lname>
<lmisc>htiInsert
HTREEITEM that specifies at which item the insertion mark will be placed. If this argument is NULL, the insertion mark is removed.
</lmisc>
</lparam>
<misc>TVM_SETINSERTMARK Message
Sets the insertion mark in a tree-view control. You can send this message explicitly or by using the TreeView_SetInsertMark macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TVM_SETINSERTMARK, // message ID
(WPARAM) wParam, // = (WPARAM) (BOOL) fAfter;
(LPARAM) lParam // = (LPARAM) (HTREEITEM) htiInsert;
);
Parameters
fAfter
BOOL value that specifies if the insertion mark is placed before or after the specified item. If this argument is nonzero, the insertion mark will be placed after the item. If this argument is zero, the insertion mark will be placed before the item.
htiInsert
HTREEITEM that specifies at which item the insertion mark will be placed. If this argument is NULL, the insertion mark is removed.
Return Value
Remarks
In some circumstances, the insert mark can appear in two places after a node is expanded. If you are using insertion marks, it is recommended that you force a refresh of the control after expanding a node.
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x1125">
<name>TVM_SETINSERTMARKCOLOR</name>
<return value="COLORREF">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns a COLORREF value that contains the previous insertion mark color.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="COLORREF">
<lname>clrInsertMark</lname>
<lmisc>clrInsertMark
COLORREF value that contains the new insertion mark color. </lmisc>
</lparam>
<misc>TVM_SETINSERTMARKCOLOR Message
Sets the color used to draw the insertion mark for the tree view. You can send this message explicitly or by using the TreeView_SetInsertMarkColor macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TVM_SETINSERTMARKCOLOR, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (COLORREF) clrInsertMark;
);
Parameters
wParam
Must be zero.
clrInsertMark
COLORREF value that contains the new insertion mark color.
Return Value
Returns a COLORREF value that contains the previous insertion mark color.
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x110d">
<name>TVM_SETITEMA</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam not used, must be zero</wmisc>
</wparam>
<lparam value="LPTVITEMEX">
<lname>pitem</lname>
<lmisc>pitem
Pointer to a TVITEM structure that contains the new item attributes. With version 4.71 and later, you can use a TVITEMEX structure instead.
</lmisc>
</lparam>
<misc>TVM_SETITEM Message
The TVM_SETITEM message sets some or all of a tree-view item's attributes. You can send this message explicitly or by using the TreeView_SetItem macro.
Syntax
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TVM_SETITEM, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (const LPTVITEM) pitem
- Version 4.71 and later -
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (const LPTVITEMEX) pitem
);
Parameters
pitem
Pointer to a TVITEM structure that contains the new item attributes. With version 4.71 and later, you can use a TVITEMEX structure instead.
Return Value
Remarks
The hItem member of the TVITEM or TVITEMEX structure identifies the item, and the mask member specifies which attributes to set.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x111b">
<name>TVM_SETITEMHEIGHT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="SHORT">
<wname>cyItem</wname>
<wmisc>cyItem
New height of every item in the tree view, in pixels. Heights less than 1 will be set to 1. If this argument is not even and the tree-view control does not have the TVS_NONEVENHEIGHT style, this value will be rounded down to the nearest even value. If this argument is -1, the control will revert to using its default item height.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TVM_SETITEMHEIGHT Message
Sets the height of the tree-view items. You can send this message explicitly or by using the TreeView_SetItemHeight macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TVM_SETITEMHEIGHT, // message ID
(WPARAM) wParam, // = (WPARAM) (SHORT) cyItem;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
cyItem
New height of every item in the tree view, in pixels. Heights less than 1 will be set to 1. If this argument is not even and the tree-view control does not have the TVS_NONEVENHEIGHT style, this value will be rounded down to the nearest even value. If this argument is -1, the control will revert to using its default item height.
lParam
Must be zero.
Return Value
Remarks
The tree-view control uses this value for the height of all items. To modify the height of individual items, see the description of the iIntegral member of the TVITEMEX structure.
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x113f">
<name>TVM_SETITEMW</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam not used, must be zero</wmisc>
</wparam>
<lparam value="LPTVITEMEX">
<lname>pitem</lname>
<lmisc>pitem
Pointer to a TVITEM structure that contains the new item attributes. With version 4.71 and later, you can use a TVITEMEX structure instead.
</lmisc>
</lparam>
<misc>TVM_SETITEM Message
The TVM_SETITEM message sets some or all of a tree-view item's attributes. You can send this message explicitly or by using the TreeView_SetItem macro.
Syntax
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TVM_SETITEM, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (const LPTVITEM) pitem
- Version 4.71 and later -
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (const LPTVITEMEX) pitem
);
Parameters
pitem
Pointer to a TVITEM structure that contains the new item attributes. With version 4.71 and later, you can use a TVITEMEX structure instead.
Return Value
Remarks
The hItem member of the TVITEM or TVITEMEX structure identifies the item, and the mask member specifies which attributes to set.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1128">
<name>TVM_SETLINECOLOR</name>
<return value="">
<returninfo>eturns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="COLORREF">
<lname>clr</lname>
<lmisc>clr
New line color. Use the CLR_DEFAULT value to restore the system default colors. </lmisc>
</lparam>
<misc>TVM_SETLINECOLOR Message
The TVM_SETLINECOLOR message sets the current line color.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TVM_SETLINECOLOR, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (COLORREF) clr;
);
Parameters
wParam
Must be zero.
clr
New line color. Use the CLR_DEFAULT value to restore the system default colors.
Return Value
Remarks
This message only changes line colors. To change the colors of the '+' and '-' inside the buttons, use the TVM_SETTEXTCOLOR message.
Message Information
Minimum DLL Version comctl32.dll version 5.80 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 5, Windows 98, Windows 95 with Internet Explorer 5</misc>
</message>
<message value="0x1121">
<name>TVM_SETSCROLLTIME</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="UINT">
<wname>uScrollTime</wname>
<wmisc>uScrollTime
New maximum scroll time, in milliseconds.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TVM_SETSCROLLTIME Message
Sets the maximum scroll time for the tree-view control. You can send this message explicitly or by using the TreeView_SetScrollTime macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TVM_SETSCROLLTIME, // message ID
(WPARAM) wParam, // = (WPARAM) (UINT) uScrollTime;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
uScrollTime
New maximum scroll time, in milliseconds.
lParam
Must be zero.
Return Value
Remarks
The maximum scroll time is the longest amount of time that a scroll operation can take. Scrolling will be adjusted so that the scroll will take place within the maximum scroll time. A scroll operation may take less time than the maximum.
Message Information
Minimum DLL Version comctl32.dll version 4.00 or later
Header commctrl.h
Minimum operating systems Windows NT 4.0, Windows 95</misc>
</message>
<message value="0x111e">
<name>TVM_SETTEXTCOLOR</name>
<return value="COLORREF">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns a COLORREF value that represents the previous text color. If this value is -1, the control was using the system color for the text color.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="COLORREF">
<lname>clrText</lname>
<lmisc>clrText
COLORREF value that contains the new text color. If this argument is -1, the control will revert to using the system color for the text color.
</lmisc>
</lparam>
<misc>TVM_SETTEXTCOLOR Message
Sets the text color of the control. You can send this message explicitly or by using the TreeView_SetTextColor macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TVM_SETTEXTCOLOR, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (COLORREF) clrText;
);
Parameters
wParam
Must be zero.
clrText
COLORREF value that contains the new text color. If this argument is -1, the control will revert to using the system color for the text color.
Return Value
Returns a COLORREF value that represents the previous text color. If this value is -1, the control was using the system color for the text color.
Message Information
Minimum DLL Version comctl32.dll version 4.71 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0</misc>
</message>
<message value="0x1118">
<name>TVM_SETTOOLTIPS</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="HWND">
<wname>hwndTooltip</wname>
<wmisc>hwndTooltip
Handle to a ToolTip control. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>TVM_SETTOOLTIPS Message
Sets a tree-view control's child ToolTip control. You can send this message explicitly or by using the TreeView_SetToolTips macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TVM_SETTOOLTIPS, // message ID
(WPARAM) wParam, // = (WPARAM) (HWND) hwndTooltip;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
hwndTooltip
Handle to a ToolTip control.
lParam
Must be zero.
Return Value
Remarks
When created, tree-view controls automatically create a child ToolTip control. To prevent a tree-view control from using ToolTips, create the control with the TVS_NOTOOLTIPS style.
Message Information
Minimum DLL Version comctl32.dll version 4.70 or later
Header commctrl.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 3.0, Windows 98, Windows 95 with Internet Explorer 3.0</misc>
</message>
<message value="0x1113">
<name>TVM_SORTCHILDREN</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="BOOL">
<wname>fRecurse</wname>
<wmisc>fRecurse
Value that specifies whether the sorting is recursive. Set fRecurse to TRUE to sort all levels of child items below the parent item. Otherwise, only the parent's immediate children are sorted.
</wmisc>
</wparam>
<lparam value="HTREEITEM">
<lname>hitem</lname>
<lmisc>hitem
Handle to the parent item whose child items are to be sorted. </lmisc>
</lparam>
<misc>TVM_SORTCHILDREN Message
Sorts the child items of the specified parent item in a tree-view control. You can send this message explicitly or by using the TreeView_SortChildren macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TVM_SORTCHILDREN, // message ID
(WPARAM) wParam, // = (WPARAM) (BOOL) fRecurse;
(LPARAM) lParam // = (LPARAM) (HTREEITEM) hitem;
);
Parameters
fRecurse
Value that specifies whether the sorting is recursive. Set fRecurse to TRUE to sort all levels of child items below the parent item. Otherwise, only the parent's immediate children are sorted.
hitem
Handle to the parent item whose child items are to be sorted.
Return Value
Remarks
This message alphabetizes the tree items using lstrcmpi on the item name. You can use the TVM_SORTCHILDRENCB message to customize the ordering behavior.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x1115">
<name>TVM_SORTCHILDRENCB</name>
<return value="BOOL">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns TRUE if successful, or FALSE otherwise. </returnmisc>
</return>
<wparam value="BOOL">
<wname>fRecurse</wname>
<wmisc>fRecurse
Reserved. Must be zero. </wmisc>
</wparam>
<lparam value="TVSORTCB">
<lname>psort</lname>
<lmisc>psort
Pointer to a TVSORTCB structure. The lpfnCompare member is the address of the application-defined callback function, which is called during the sort operation each time the relative order of two list items needs to be compared. For more information about the callback function, see the description of TVSORTCB.
</lmisc>
</lparam>
<misc>TVM_SORTCHILDRENCB Message
Sorts tree-view items using an application-defined callback function that compares the items. You can send this message explicitly or by using the TreeView_SortChildrenCB macro.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) TVM_SORTCHILDRENCB, // message ID
(WPARAM) wParam, // = (WPARAM) (BOOL) fRecurse;
(LPARAM) lParam // = (LPARAM) (LPTVSORTCB) psort;
);
Parameters
fRecurse
Reserved. Must be zero.
psort
Pointer to a TVSORTCB structure. The lpfnCompare member is the address of the application-defined callback function, which is called during the sort operation each time the relative order of two list items needs to be compared. For more information about the callback function, see the description of TVSORTCB.
Return Value
Returns TRUE if successful, or FALSE otherwise.
Message Information
Header commctrl.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x6">
<name>WM_ACTIVATE</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
If an application processes this message, it should return zero. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
The low-order word specifies whether the window is being activated or deactivated. This parameter can be one of the following values. The high-order word specifies the minimized state of the window being activated or deactivated. A nonzero value indicates the window is minimized.
WA_ACTIVE
Activated by some method other than a mouse click (for example, by a call to the SetActiveWindow function or by use of the keyboard interface to select the window).
WA_CLICKACTIVE
Activated by a mouse click.
WA_INACTIVE
Deactivated.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Handle to the window being activated or deactivated, depending on the value of the wParam parameter. If the low-order word of wParam is WA_INACTIVE, lParam is the handle to the window being activated. If the low-order word of wParam is WA_ACTIVE or WA_CLICKACTIVE, lParam is the handle to the window being deactivated. This handle can be NULL.
</lmisc>
</lparam>
<misc>WM_ACTIVATE Notification
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.
Syntax
WM_ACTIVATE
WPARAM wParam
LPARAM lParam;
Parameters
wParam
The low-order word specifies whether the window is being activated or deactivated. This parameter can be one of the following values. The high-order word specifies the minimized state of the window being activated or deactivated. A nonzero value indicates the window is minimized.
WA_ACTIVE
Activated by some method other than a mouse click (for example, by a call to the SetActiveWindow function or by use of the keyboard interface to select the window).
WA_CLICKACTIVE
Activated by a mouse click.
WA_INACTIVE
Deactivated.
lParam
Handle to the window being activated or deactivated, depending on the value of the wParam parameter. If the low-order word of wParam is WA_INACTIVE, lParam is the handle to the window being activated. If the low-order word of wParam is WA_ACTIVE or WA_CLICKACTIVE, lParam is the handle to the window being deactivated. This handle can be NULL.
Return Value
If an application processes this message, it should return zero.
Remarks
If the window is being activated and is not minimized, the DefWindowProc function sets the keyboard focus to the window. If the window is activated by a mouse click, it also receives a WM_MOUSEACTIVATE message.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x1C">
<name>WM_ACTIVATEAPP</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies whether the window is being activated or deactivated. This parameter is TRUE if the window is being activated; it is FALSE if the window is being deactivated.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Specifies a thread identifier (a DWORD). If the wParam parameter is TRUE, lParam is the identifier of the thread that owns the window being deactivated. If wParam is FALSE, lParam is the identifier of the thread that owns the window being activated.
</lmisc>
</lparam>
<misc>WM_ACTIVATEAPP Notification
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.
A window receives this message through its WindowProc function.
Syntax
WM_ACTIVATEAPP
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Specifies whether the window is being activated or deactivated. This parameter is TRUE if the window is being activated; it is FALSE if the window is being deactivated.
lParam
Specifies a thread identifier (a DWORD). If the wParam parameter is TRUE, lParam is the identifier of the thread that owns the window being deactivated. If wParam is FALSE, lParam is the identifier of the thread that owns the window being activated.
Return Value
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x850">
<name>WM_ADSPROP_NOTIFY_APPLY</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
This message has no return value.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used.</lmisc>
</lparam>
<misc>WM_ADSPROP_NOTIFY_APPLY Message
An Active Directory directory service property sheet extension sends the WM_ADSPROP_NOTIFY_APPLY message to the notification object if the property page PSN_APPLY handler succeeds.
VOID SendMessage(
(HWND) hwnd,
WM_ADSPROP_NOTIFY_APPLY,
(WPARAM) wParam,
(LPARAM) lParam
);
Parameters
hwnd
The handle of the notification object. To obtain this handle, call ADsPropCreateNotifyObj.
wParam
Not used.
lParam
Not used.
Return Value
This message has no return value.
Remarks
When adding pages to the Active Directory Manager MMC snap-in, Active Directory MMC property sheets create the notification objects by a call to the ADsPropCreateNotifyObj function, and then passes the notification object handle to each property page.
Requirements
Minimum supported client Windows 2000 Professional
Minimum supported server Windows 2000 Server
Redistributable Active Directory Client Extension onWindows NT 4.0andWindows Me/98/95
Header Adsprop.h</misc>
</message>
<message value="0x84f">
<name>WM_ADSPROP_NOTIFY_CHANGE</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
This message has no return value.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used.</lmisc>
</lparam>
<misc>WM_ADSPROP_NOTIFY_CHANGE Message
The WM_ADSPROP_NOTIFY_CHANGE message is used internally by the notification object.
VOID SendMessage(
(HWND) hwnd,
WM_ADSPROP_NOTIFY_CHANGE,
(WPARAM) wParam,
(LPARAM) lParam
);
Parameters
hwnd
Not used.
wParam
Not used.
lParam
Not used.
Return Value
This message has no return value.
Requirements
Minimum supported client Windows 2000 Professional
Minimum supported server Windows 2000 Server
Redistributable Active Directory Client Extension onWindows NT 4.0andWindows Me/98/95
Header Adsprop.h</misc>
</message>
<message value="0x856">
<name>WM_ADSPROP_NOTIFY_ERROR</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
This message has no return value.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used.</wmisc>
</wparam>
<lparam value="ADSPROPERROR">
<lname>lParam</lname>
<lmisc>lParam
Pointer to an ADSPROPERROR structure that contains error message data.</lmisc>
</lparam>
<misc>WM_ADSPROP_NOTIFY_ERROR Message
The WM_ADSPROP_NOTIFY_ERROR message adds an error message to a list of error messages that are displayed by calling the ADsPropShowErrorDialog function.
VOID SendMessage(
(HWND) hwnd,
WM_ADSPROP_NOTIFY_ERROR,
(WPARAM) wParam,
(LPARAM) lParam
);
Parameters
hwnd
Handle of the notification object. This is the hNotifyObject parameter obtained by ADsPropCreateNotifyObj.
wParam
Not used.
lParam
Pointer to an ADSPROPERROR structure that contains error message data.
Return Value
This message has no return value.
Remarks
The ADsPropSendErrorMessage function is the preferred method of sending this message.
The error messages added by the WM_ADSPROP_NOTIFY_ERROR message are accumulated until ADsPropShowErrorDialog is called. ADsPropShowErrorDialog combines and displays the accumulated error messages. When the error dialog is dismissed, the accumulated error messages are deleted.
Requirements
Minimum supported client Windows 2000 Professional
Minimum supported server Windows 2000 Server
Redistributable Active Directory Client Extension onWindows NT 4.0andWindows Me/98/95
Header Adsprop.h</misc>
</message>
<message value="0x853">
<name>WM_ADSPROP_NOTIFY_EXIT</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
This message has no return value.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used.</lmisc>
</lparam>
<misc>WM_ADSPROP_NOTIFY_EXIT Message
An Active Directory property sheet extension sends the WM_ADSPROP_NOTIFY_EXIT message to the notification object when the notification object is no longer required.
VOID SendMessage(
(HWND) hwnd,
WM_ADSPROP_NOTIFY_EXIT,
(WPARAM) wParam,
(LPARAM) lParam
);
Parameters
hwnd
The handle of the notification object. To obtain this handle, call ADsPropCreateNotifyObj.
wParam
Not used.
lParam
Not used.
Return Value
This message has no return value.
Remarks
The notification object will delete itself in response to this message. When this message has been sent, the notification object handle should be considered invalid.
Requirements
Minimum supported client Windows 2000 Professional
Minimum supported server Windows 2000 Server
Redistributable Active Directory Client Extension onWindows NT 4.0andWindows Me/98/95
Header Adsprop.h</misc>
</message>
<message value="0x852">
<name>WM_ADSPROP_NOTIFY_FOREGROUND</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
This message has no return value.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used.</lmisc>
</lparam>
<misc>WM_ADSPROP_NOTIFY_FOREGROUND Message
The WM_ADSPROP_NOTIFY_FOREGROUND message is used internally by the notification object.
VOID SendMessage(
(HWND) hwnd,
WM_ADSPROP_NOTIFY_FOREGROUND,
(WPARAM) wParam,
(LPARAM) lParam
);
Parameters
hwnd
Not used.
wParam
Not used.
lParam
Not used.
Return Value
This message has no return value.
Requirements
Minimum supported client Windows 2000 Professional
Minimum supported server Windows 2000 Server
Redistributable Active Directory Client Extension onWindows NT 4.0andWindows Me/98/95
Header Adsprop.h</misc>
</message>
<message value="0x84e">
<name>WM_ADSPROP_NOTIFY_PAGEHWND</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
This message has no return value.</returnmisc>
</return>
<wparam value="">
<wname>hPage</wname>
<wmisc>hPage
A window handle of the property page.</wmisc>
</wparam>
<lparam value="">
<lname>ptzTitle</lname>
<lmisc>ptzTitle
Pointer to a NULL-terminated WCHAR buffer that contains the title of the property page.</lmisc>
</lparam>
<misc>WM_ADSPROP_NOTIFY_PAGEHWND Message
An Active Directory directory service property sheet extension calls the ADsPropSetHwnd to inform the notification object of the property page window handle. The ADsPropSetHwnd function sends the WM_ADSPROP_NOTIFY_PAGEHWND message to the notification object, which informs the notification object of the property page window handle.
VOID SendMessage(
(HWND) hNotifyObj,
WM_ADSPROP_NOTIFY_PAGEHWND,
(WPARAM) hPage,
(LPARAM) ptzTitle
);
Parameters
hNotifyObj
The handle of the notification object. To obtain this handle, call ADsPropCreateNotifyObj.
hPage
A window handle of the property page.
ptzTitle
Pointer to a NULL-terminated WCHAR buffer that contains the title of the property page.
Return Value
This message has no return value.
Remarks
An Active Directory property sheet extension normally calls the ADsPropSetHwnd function while processing the WM_INITDIALOG message.
Requirements
Minimum supported client Windows 2000 Professional
Minimum supported server Windows 2000 Server
Redistributable Active Directory Client Extension onWindows NT 4.0andWindows Me/98/95
Header Adsprop.h</misc>
</message>
<message value="0x84d">
<name>WM_ADSPROP_NOTIFY_PAGEINIT</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
This message has no return value.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used.</wmisc>
</wparam>
<lparam value="ADSPROPINITPARAMS">
<lname>pADsPropInitParams</lname>
<lmisc>pADsPropInitParams
Pointer to an ADSPROPINITPARAMS structure that receives the directory object information. This is the pInitParams parameter passed to ADsPropCreateNotifyObj.
</lmisc>
</lparam>
<misc>WM_ADSPROP_NOTIFY_PAGEINIT Message
An Active Directory property sheet extension calls the ADsPropGetInitInfo to obtain data about regarding the directory object that the property sheet extension applies to. The ADsPropGetInitInfo function sends the WM_ADSPROP_NOTIFY_PAGEINIT message to the notification object to achieve this result.
VOID SendMessage(
(HWND) hwnd,
WM_ADSPROP_NOTIFY_PAGEINIT,
(WPARAM) wParam,
(LPARAM) pADsPropInitParams
);
Parameters
hwnd
Handle of the notification object. This is the hNotifyObject parameter obtained by a call to ADsPropCreateNotifyObj.
wParam
Not used.
pADsPropInitParams
Pointer to an ADSPROPINITPARAMS structure that receives the directory object information. This is the pInitParams parameter passed to ADsPropCreateNotifyObj.
Return Value
This message has no return value.
Requirements
Minimum supported client Windows 2000 Professional
Minimum supported server Windows 2000 Server
Redistributable Active Directory Client Extension onWindows NT 4.0andWindows Me/98/95
Header Adsprop.h</misc>
</message>
<message value="0x851">
<name>WM_ADSPROP_NOTIFY_SETFOCUS</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
This message has no return value.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used.</lmisc>
</lparam>
<misc>WM_ADSPROP_NOTIFY_SETFOCUS Message
The WM_ADSPROP_NOTIFY_SETFOCUS message is used internally by the notification object.
VOID SendMessage(
(HWND) hwnd,
WM_ADSPROP_NOTIFY_SETFOCUS,
(WPARAM) wParam,
(LPARAM) lParam
);
Parameters
hwnd
Not used.
wParam
Not used.
lParam
Not used.
Return Value
This message has no return value.
Requirements
Minimum supported client Windows 2000 Professional
Minimum supported server Windows 2000 Server
Redistributable Active Directory Client Extension onWindows NT 4.0andWindows Me/98/95
Header Adsprop.h</misc>
</message>
<message value="0x857">
<name>WM_ADSPROP_NOTIFY_SHOW_ERROR_DIALOG</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x360">
<name>WM_AFXFIRST</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x37F">
<name>WM_AFXLAST</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x8000">
<name>WM_APP</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
No return value.</returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc>WM_APP Notification
The WM_APP constant is used by applications to help define private messages, usually of the form WM_APP+X, where X is an integer value.
Syntax
#define WM_APP 0x8000
Return Value
No return value.
Remarks
The WM_APP constant is used to distinguish between message values that are reserved for use by the system and values that can be used by an application to send messages within a private window class. The following are the ranges of message numbers available.
Range Meaning
0 through WM_USER 1 Messages reserved for use by the system.
WM_USER through 0x7FFF Integer messages for use by private window classes.
WM_APP through 0xBFFF Messages available for use by applications.
0xC000 through 0xFFFF String messages for use by applications.
Greater than 0xFFFF Reserved by the system.
Message numbers in the first range (0 through WM_USER 1) are defined by the system. Values in this range that are not explicitly defined are reserved by the system.
Message numbers in the second range (WM_USER through 0x7FFF) can be defined and used by an application to send messages within a private window class. These values cannot be used to define messages that are meaningful throughout an application, because some predefined window classes already define values in this range. For example, predefined control classes such as BUTTON, EDIT, LISTBOX, and COMBOBOX may use these values. Messages in this range should not be sent to other applications unless the applications have been designed to exchange messages and to attach the same meaning to the message numbers.
Message numbers in the third range (0x8000 through 0xBFFF) are available for application to use as private messages. Message in this range do not conflict with system messages.
Message numbers in the fourth range (0xC000 through 0xFFFF) are defined at run time when an application calls the RegisterWindowMessage function to retrieve a message number for a string. All applications that register the same string can use the associated message number for exchanging messages. The actual message number, however, is not a constant and cannot be assumed to be the same between different sessions.
Message numbers in the fifth range (greater than 0xFFFF) are reserved by the system.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.51</misc>
</message>
<message value="0x319">
<name>WM_APPCOMMAND</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
If an application processes this message, it should return TRUE. For more information about processing the return value, see the Remarks section.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Handle to the window where the user clicked the button or pressed the key. This can be a child window of the window receiving the message. For more information about processing this message, see the Remarks section.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Use the following code to get the information contained in the lParam parameter.
Copy Code
cmd = GET_APPCOMMAND_LPARAM(lParam);
uDevice = GET_DEVICE_LPARAM(lParam);
dwKeys = GET_KEYSTATE_LPARAM(lParam);
Where cmd indicates the application command. This parameter can be one of the following values.
APPCOMMAND_BASS_BOOST
Toggle the bass boost on and off.
APPCOMMAND_BASS_DOWN
Decrease the bass.
APPCOMMAND_BASS_UP
Increase the bass.
APPCOMMAND_BROWSER_BACKWARD
Navigate backward.
APPCOMMAND_BROWSER_FAVORITES
Open favorites.
APPCOMMAND_BROWSER_FORWARD
Navigate forward.
APPCOMMAND_BROWSER_HOME
Navigate home.
APPCOMMAND_BROWSER_REFRESH
Refresh page.
APPCOMMAND_BROWSER_SEARCH
Open search.
APPCOMMAND_BROWSER_STOP
Stop download.
APPCOMMAND_CLOSE
Windows XP: Close the window (not the application).
APPCOMMAND_COPY
Windows XP: Copy the selection.
APPCOMMAND_CORRECTION_LIST
Windows XP: Brings up the correction list when a word is incorrectly identified during speech input.
APPCOMMAND_CUT
Windows XP: Cut the selection.
APPCOMMAND_DICTATE_OR_COMMAND_CONTROL_TOGGLE
Windows XP: Toggles between two modes of speech input: dictation and command/control (giving commands to an application or accessing menus).
APPCOMMAND_FIND
Windows XP: Open the Find dialog.
APPCOMMAND_FORWARD_MAIL
Windows XP: Forward a mail message.
APPCOMMAND_HELP
Windows XP: Open the Help dialog.
APPCOMMAND_LAUNCH_APP1
Start App1.
APPCOMMAND_LAUNCH_APP2
Start App2.
APPCOMMAND_LAUNCH_MAIL
Open mail.
APPCOMMAND_MEDIA_CHANNEL_DOWN
Windows XP SP1: Decrement the channel value, for example, for a TV or radio tuner.
APPCOMMAND_MEDIA_CHANNEL_UP
Windows XP SP1: Increment the channel value, for example, for a TV or radio tuner.
APPCOMMAND_MEDIA_FASTFORWARD
Windows XP SP1: Increase the speed of stream playback. This can be implemented in many ways, for example, using a fixed speed or toggling through a series of increasing speeds.
APPCOMMAND_MEDIA_NEXTTRACK
Go to next track.
APPCOMMAND_MEDIA_PAUSE
Windows XP SP1: Pause. If already paused, take no further action. This is a direct PAUSE command that has no state. If there are discrete Play and Pause buttons, applications should take action on this command as well as APPCOMMAND_MEDIA_PLAY_PAUSE.
APPCOMMAND_MEDIA_PLAY
Windows XP SP1: Begin playing at the current position. If already paused, it will resume. This is a direct PLAY command that has no state. If there are discrete Play and Pause buttons, applications should take action on this command as well as APPCOMMAND_MEDIA_PLAY_PAUSE.
APPCOMMAND_MEDIA_PLAY_PAUSE
Play or pause playback. If there are discrete Play and Pause buttons, applications should take action on this command as well as APPCOMMAND_MEDIA_PLAY and APPCOMMAND_MEDIA_PAUSE.
APPCOMMAND_MEDIA_PREVIOUSTRACK
Go to previous track.
APPCOMMAND_MEDIA_RECORD
Windows XP SP1: Begin recording the current stream.
APPCOMMAND_MEDIA_REWIND
Windows XP SP1: Go backward in a stream at a higher rate of speed. This can be implemented in many ways, for example, using a fixed speed or toggling through a series of increasing speeds.
APPCOMMAND_MEDIA_SELECT
Go to Media Select mode.
APPCOMMAND_MEDIA_STOP
Stop playback.
APPCOMMAND_MIC_ON_OFF_TOGGLE
Windows XP: Toggle the microphone.
APPCOMMAND_MICROPHONE_VOLUME_DOWN
Windows XP: Increase microphone volume.
APPCOMMAND_MICROPHONE_VOLUME_MUTE
Windows XP: Mute the microphone.
APPCOMMAND_MICROPHONE_VOLUME_UP
Windows XP: Decrease microphone volume.
APPCOMMAND_NEW
Windows XP: Create a new window.
APPCOMMAND_OPEN
Windows XP: Open a window.
APPCOMMAND_PASTE
Windows XP: Paste
APPCOMMAND_PRINT
Windows XP: Print current document.
APPCOMMAND_REDO
Windows XP: Redo last action.
APPCOMMAND_REPLY_TO_MAIL
Windows XP: Reply to a mail message.
APPCOMMAND_SAVE
Windows XP: Save current document.
APPCOMMAND_SEND_MAIL
Windows XP: Send a mail message.
APPCOMMAND_SPELL_CHECK
Windows XP: Initiate a spell check.
APPCOMMAND_TREBLE_DOWN
Decrease the treble.
APPCOMMAND_TREBLE_UP
Increase the treble.
APPCOMMAND_UNDO
Windows XP: Undo last action.
APPCOMMAND_VOLUME_DOWN
Lower the volume.
APPCOMMAND_VOLUME_MUTE
Mute the volume.
APPCOMMAND_VOLUME_UP
Raise the volume.
Where uDevice indicates the input device that generated the input event. It can be one of the following values.
FAPPCOMMAND_KEY
User pressed a key.
FAPPCOMMAND_MOUSE
User clicked a mouse button.
FAPPCOMMAND_OEM
An unidentified hardware source generated the event. It could be a mouse or a keyboard event.
Where dwKeys indicates whether various virtual keys are down. It can be one or more of the following values.
MK_CONTROL
The CTRL key is down.
MK_LBUTTON
The left mouse button is down.
MK_MBUTTON
The middle mouse button is down.
MK_RBUTTON
The right mouse button is down.
MK_SHIFT
The SHIFT key is down.
MK_XBUTTON1
The first X button is down.
MK_XBUTTON2
The second X button is down.
</lmisc>
</lparam>
<misc>WM_APPCOMMAND Notification
The WM_APPCOMMAND message notifies a window that the user generated an application command event, for example, by clicking an application command button using the mouse or typing an application command key on the keyboard.
Syntax
WM_APPCOMMAND
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Handle to the window where the user clicked the button or pressed the key. This can be a child window of the window receiving the message. For more information about processing this message, see the Remarks section.
lParam
Use the following code to get the information contained in the lParam parameter.
Copy Code
cmd = GET_APPCOMMAND_LPARAM(lParam);
uDevice = GET_DEVICE_LPARAM(lParam);
dwKeys = GET_KEYSTATE_LPARAM(lParam);
Where cmd indicates the application command. This parameter can be one of the following values.
APPCOMMAND_BASS_BOOST
Toggle the bass boost on and off.
APPCOMMAND_BASS_DOWN
Decrease the bass.
APPCOMMAND_BASS_UP
Increase the bass.
APPCOMMAND_BROWSER_BACKWARD
Navigate backward.
APPCOMMAND_BROWSER_FAVORITES
Open favorites.
APPCOMMAND_BROWSER_FORWARD
Navigate forward.
APPCOMMAND_BROWSER_HOME
Navigate home.
APPCOMMAND_BROWSER_REFRESH
Refresh page.
APPCOMMAND_BROWSER_SEARCH
Open search.
APPCOMMAND_BROWSER_STOP
Stop download.
APPCOMMAND_CLOSE
Windows XP: Close the window (not the application).
APPCOMMAND_COPY
Windows XP: Copy the selection.
APPCOMMAND_CORRECTION_LIST
Windows XP: Brings up the correction list when a word is incorrectly identified during speech input.
APPCOMMAND_CUT
Windows XP: Cut the selection.
APPCOMMAND_DICTATE_OR_COMMAND_CONTROL_TOGGLE
Windows XP: Toggles between two modes of speech input: dictation and command/control (giving commands to an application or accessing menus).
APPCOMMAND_FIND
Windows XP: Open the Find dialog.
APPCOMMAND_FORWARD_MAIL
Windows XP: Forward a mail message.
APPCOMMAND_HELP
Windows XP: Open the Help dialog.
APPCOMMAND_LAUNCH_APP1
Start App1.
APPCOMMAND_LAUNCH_APP2
Start App2.
APPCOMMAND_LAUNCH_MAIL
Open mail.
APPCOMMAND_MEDIA_CHANNEL_DOWN
Windows XP SP1: Decrement the channel value, for example, for a TV or radio tuner.
APPCOMMAND_MEDIA_CHANNEL_UP
Windows XP SP1: Increment the channel value, for example, for a TV or radio tuner.
APPCOMMAND_MEDIA_FASTFORWARD
Windows XP SP1: Increase the speed of stream playback. This can be implemented in many ways, for example, using a fixed speed or toggling through a series of increasing speeds.
APPCOMMAND_MEDIA_NEXTTRACK
Go to next track.
APPCOMMAND_MEDIA_PAUSE
Windows XP SP1: Pause. If already paused, take no further action. This is a direct PAUSE command that has no state. If there are discrete Play and Pause buttons, applications should take action on this command as well as APPCOMMAND_MEDIA_PLAY_PAUSE.
APPCOMMAND_MEDIA_PLAY
Windows XP SP1: Begin playing at the current position. If already paused, it will resume. This is a direct PLAY command that has no state. If there are discrete Play and Pause buttons, applications should take action on this command as well as APPCOMMAND_MEDIA_PLAY_PAUSE.
APPCOMMAND_MEDIA_PLAY_PAUSE
Play or pause playback. If there are discrete Play and Pause buttons, applications should take action on this command as well as APPCOMMAND_MEDIA_PLAY and APPCOMMAND_MEDIA_PAUSE.
APPCOMMAND_MEDIA_PREVIOUSTRACK
Go to previous track.
APPCOMMAND_MEDIA_RECORD
Windows XP SP1: Begin recording the current stream.
APPCOMMAND_MEDIA_REWIND
Windows XP SP1: Go backward in a stream at a higher rate of speed. This can be implemented in many ways, for example, using a fixed speed or toggling through a series of increasing speeds.
APPCOMMAND_MEDIA_SELECT
Go to Media Select mode.
APPCOMMAND_MEDIA_STOP
Stop playback.
APPCOMMAND_MIC_ON_OFF_TOGGLE
Windows XP: Toggle the microphone.
APPCOMMAND_MICROPHONE_VOLUME_DOWN
Windows XP: Increase microphone volume.
APPCOMMAND_MICROPHONE_VOLUME_MUTE
Windows XP: Mute the microphone.
APPCOMMAND_MICROPHONE_VOLUME_UP
Windows XP: Decrease microphone volume.
APPCOMMAND_NEW
Windows XP: Create a new window.
APPCOMMAND_OPEN
Windows XP: Open a window.
APPCOMMAND_PASTE
Windows XP: Paste
APPCOMMAND_PRINT
Windows XP: Print current document.
APPCOMMAND_REDO
Windows XP: Redo last action.
APPCOMMAND_REPLY_TO_MAIL
Windows XP: Reply to a mail message.
APPCOMMAND_SAVE
Windows XP: Save current document.
APPCOMMAND_SEND_MAIL
Windows XP: Send a mail message.
APPCOMMAND_SPELL_CHECK
Windows XP: Initiate a spell check.
APPCOMMAND_TREBLE_DOWN
Decrease the treble.
APPCOMMAND_TREBLE_UP
Increase the treble.
APPCOMMAND_UNDO
Windows XP: Undo last action.
APPCOMMAND_VOLUME_DOWN
Lower the volume.
APPCOMMAND_VOLUME_MUTE
Mute the volume.
APPCOMMAND_VOLUME_UP
Raise the volume.
Where uDevice indicates the input device that generated the input event. It can be one of the following values.
FAPPCOMMAND_KEY
User pressed a key.
FAPPCOMMAND_MOUSE
User clicked a mouse button.
FAPPCOMMAND_OEM
An unidentified hardware source generated the event. It could be a mouse or a keyboard event.
Where dwKeys indicates whether various virtual keys are down. It can be one or more of the following values.
MK_CONTROL
The CTRL key is down.
MK_LBUTTON
The left mouse button is down.
MK_MBUTTON
The middle mouse button is down.
MK_RBUTTON
The right mouse button is down.
MK_SHIFT
The SHIFT key is down.
MK_XBUTTON1
The first X button is down.
MK_XBUTTON2
The second X button is down.
Return Value
If an application processes this message, it should return TRUE. For more information about processing the return value, see the Remarks section.
Remarks
DefWindowProc generates the WM_APPCOMMAND message when it processes the WM_XBUTTONUP or WM_NCXBUTTONUP message, or when the user types an application command key.
If a child window does not process this message and instead calls DefWindowProc, DefWindowProc will send the message to its parent window. If a top level window does not process this message and instead calls DefWindowProc, DefWindowProc will call a shell hook with the hook code equal to HSHELL_APPCOMMAND.
To get the coordinates of the cursor if the message was generated by a button click on the mouse, the application can call GetMessagePos. An application can test whether the message was generated by the mouse by checking whether lParam contains FAPPCOMMAND_MOUSE.
Unlike other windows messages, an application should return TRUE from this message if it processes it. Doing so will allow software that simulates this message on Microsoft Windows systems earlier than Windows 2000 to determine whether the window procedure processed the message or called DefWindowProc to process it.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Millennium, Windows 2000</misc>
</message>
<message value="0x30C">
<name>WM_ASKCBFORMATNAME</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
If an application processes this message, it should return zero. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the size, in characters, of the buffer pointed to by the lParam parameter.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Pointer to the buffer that is to receive the clipboard format name. </lmisc>
</lparam>
<misc>WM_ASKCBFORMATNAME Notification
The WM_ASKCBFORMATNAME message is sent to the clipboard owner by a clipboard viewer window to request the name of a CF_OWNERDISPLAY clipboard format.
A window receives this message through its WindowProc function.
Syntax
WM_ASKCBFORMATNAME
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Specifies the size, in characters, of the buffer pointed to by the lParam parameter.
lParam
Pointer to the buffer that is to receive the clipboard format name.
Return Value
If an application processes this message, it should return zero.
Remarks
In response to this message, the clipboard owner should copy the name of the owner-display format to the specified buffer, not exceeding the buffer size specified by the wParam parameter.
A clipboard viewer window sends this message to the clipboard owner to determine the name of the CF_OWNERDISPLAY format for example, to initialize a menu listing available formats.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x4B">
<name>WM_CANCELJOURNAL</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
This message does not return a value. It is meant to be processed from within an application's main loop or a GetMessage hook procedure, not from a window procedure.
</returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc>WM_CANCELJOURNAL Notification
The WM_CANCELJOURNAL message is posted to an application when a user cancels the application's journaling activities. The message is posted with a NULL window handle.
Syntax
WM_CANCELJOURNAL
Return Value
This message does not return a value. It is meant to be processed from within an application's main loop or a GetMessage hook procedure, not from a window procedure.
Remarks
Journal record and playback modes are modes imposed on the system that let an application sequentially record or play back user input. The system enters these modes when an application installs a JournalRecordProc or JournalPlaybackProc hook procedure. When the system is in either of these journaling modes, applications must take turns reading input from the input queue. If any one application stops reading input while the system is in a journaling mode, other applications are forced to wait.
To ensure a robust system, one that cannot be made unresponsive by any one application, the system automatically cancels any journaling activities when a user presses CTRL+ESC or CTRL+ALT+DEL. The system then unhooks any journaling hook procedures, and posts a WM_CANCELJOURNAL message, with a NULL window handle, to the application that set the journaling hook.
The WM_CANCELJOURNAL message has a NULL window handle, therefore it cannot be dispatched to a window procedure. There are two ways for an application to see a WM_CANCELJOURNAL message: If the application is running in its own main loop, it must catch the message between its call to GetMessage or PeekMessage and its call to DispatchMessage. If the application is not running in its own main loop, it must set a GetMsgProc hook procedure (through a call to SetWindowsHookEx specifying the WH_GETMESSAGE hook type) that watches for the message.
When an application sees a WM_CANCELJOURNAL message, it can assume two things: the user has intentionally cancelled the journal record or playback mode, and the system has already unhooked any journal record or playback hook procedures.
Note that the key combinations mentioned above (CTRL+ESC or CTRL+ALT+DEL) cause the system to cancel journaling. If any one application is made unresponsive, they give the user a means of recovery. The VK_CANCEL virtual key code (usually implemented as the CTRL+BREAK key combination) is what an application that is in journal record mode should watch for as a signal that the user wishes to cancel the journaling activity. The difference is that watching for VK_CANCEL is a suggested behavior for journaling applications, whereas CTRL+ESC or CTRL+ALT+DEL cause the system to cancel journaling regardless of a journaling application's behavior.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.5</misc>
</message>
<message value="0x1F">
<name>WM_CANCELMODE</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used.</lmisc>
</lparam>
<misc>WM_CANCELMODE Notification
The WM_CANCELMODE message is sent to cancel certain modes, such as mouse capture. For example, the system sends this message to the active window when a dialog box or message box is displayed. Certain functions also send this message explicitly to the specified window regardless of whether it is the active window. For example, the EnableWindow function sends this message when disabling the specified window.
A window receives this message through its WindowProc function.
Syntax
WM_CANCELMODE
WPARAM wParam
LPARAM lParam;
Parameters
wParam
This parameter is not used.
lParam
This parameter is not used.
Return Value
Remarks
When the WM_CANCELMODE message is sent, the DefWindowProc function cancels internal processing of standard scroll bar input, cancels internal menu processing, and releases the mouse capture.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x445">
<name>WM_CAP_ABORT</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE otherwise.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam = (WPARAM) 0; </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam = 0L; </lmisc>
</lparam>
<misc>WM_CAP_ABORT
The WM_CAP_ABORT message stops the capture operation. In the case of step capture, the image data collected up to the point of the WM_CAP_ABORT message will be retained in the capture file, but audio will not be captured. You can send this message explicitly or by using the capCaptureAbort macro.
WM_CAP_ABORT
wParam = (WPARAM) 0;
lParam = 0L;
Return Values
Returns TRUE if successful or FALSE otherwise.
Remarks
The capture operation must yield to use this message.
Use the WM_CAP_STOP message to halt step capture at the current position, and then capture audio.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.</misc>
</message>
<message value="0x42e">
<name>WM_CAP_DLG_VIDEOCOMPRESSION</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE otherwise.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam = (WPARAM) 0; </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam = 0L; </lmisc>
</lparam>
<misc>WM_CAP_DLG_VIDEOCOMPRESSION
The WM_CAP_DLG_VIDEOCOMPRESSION message displays a dialog box in which the user can select a compressor to use during the capture process. The list of available compressors can vary with the video format selected in the capture driver's Video Format dialog box. You can send this message explicitly or by using the capDlgVideoCompression macro.
WM_CAP_DLG_VIDEOCOMPRESSION
wParam = (WPARAM) 0;
lParam = 0L;
Return Values
Returns TRUE if successful or FALSE otherwise.
Remarks
Use this message with capture drivers that provide frames only in the BI_RGB format. This message is most useful in the step capture operation to combine capture and compression in a single operation. Compressing frames with a software compressor as part of a real-time capture operation is most likely too time-consuming to perform.
Compression does not affect the frames copied to the clipboard.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.</misc>
</message>
<message value="0x42b">
<name>WM_CAP_DLG_VIDEODISPLAY</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE otherwise.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam = (WPARAM) 0; </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam = 0L; </lmisc>
</lparam>
<misc>WM_CAP_DLG_VIDEODISPLAY
The WM_CAP_DLG_VIDEODISPLAY message displays a dialog box in which the user can set or adjust the video output. This dialog box might contain controls that affect the hue, contrast, and brightness of the displayed image, as well as key color alignment. You can send this message explicitly or by using the capDlgVideoDisplay macro.
WM_CAP_DLG_VIDEODISPLAY
wParam = (WPARAM) 0;
lParam = 0L;
Return Values
Returns TRUE if successful or FALSE otherwise.
Remarks
The controls in this dialog box do not affect digitized video data; they affect only the output or redisplay of the video signal.
The Video Display dialog box is unique for each capture driver. Some capture drivers might not support a Video Display dialog box. Applications can determine if the capture driver supports this message by checking the fHasDlgVideoDisplay member of the CAPDRIVERCAPS structure.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.</misc>
</message>
<message value="0x429">
<name>WM_CAP_DLG_VIDEOFORMAT</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE otherwise.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam = (WPARAM) 0; </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam = 0L; </lmisc>
</lparam>
<misc>WM_CAP_DLG_VIDEOFORMAT
The WM_CAP_DLG_VIDEOFORMAT message displays a dialog box in which the user can select the video format. The Video Format dialog box might be used to select image dimensions, bit depth, and hardware compression options. You can send this message explicitly or by using the capDlgVideoFormat macro.
WM_CAP_DLG_VIDEOFORMAT
wParam = (WPARAM) 0;
lParam = 0L;
Return Values
Returns TRUE if successful or FALSE otherwise.
Remarks
After this message returns, applications might need to update the CAPSTATUS structure because the user might have changed the image dimensions.
The Video Format dialog box is unique for each capture driver. Some capture drivers might not support a Video Format dialog box. Applications can determine if the capture driver supports this message by checking the fHasDlgVideoFormat member of CAPDRIVERCAPS.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.</misc>
</message>
<message value="0x42a">
<name>WM_CAP_DLG_VIDEOSOURCE</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE otherwise.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam = (WPARAM) 0; </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam = 0L; </lmisc>
</lparam>
<misc>WM_CAP_DLG_VIDEOSOURCE
The WM_CAP_DLG_VIDEOSOURCE message displays a dialog box in which the user can control the video source. The Video Source dialog box might contain controls that select input sources; alter the hue, contrast, brightness of the image; and modify the video quality before digitizing the images into the frame buffer. You can send this message explicitly or by using the capDlgVideoSource macro.
WM_CAP_DLG_VIDEOSOURCE
wParam = (WPARAM) 0;
lParam = 0L;
Return Values
Returns TRUE if successful or FALSE otherwise.
Remarks
The Video Source dialog box is unique for each capture driver. Some capture drivers might not support a Video Source dialog box. Applications can determine if the capture driver supports this message by checking the fHasDlgVideoSource member of the CAPDRIVERCAPS structure.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.</misc>
</message>
<message value="0x40a">
<name>WM_CAP_DRIVER_CONNECT</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE if the specified capture driver cannot be connected to the capture window.</returnmisc>
</return>
<wparam value="">
<wname>iIndex</wname>
<wmisc>iIndex
Index of the capture driver. The index can range from 0 through 9.
wParam = (WPARAM) (iIndex); </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam = 0L; </lmisc>
</lparam>k
<misc>WM_CAP_DRIVER_CONNECT
The WM_CAP_DRIVER_CONNECT message connects a capture window to a capture driver. You can send this message explicitly or by using the capDriverConnect macro.
WM_CAP_DRIVER_CONNECT
wParam = (WPARAM) (iIndex);
lParam = 0L;
Parameters
iIndex
Index of the capture driver. The index can range from 0 through 9.
Return Values
Returns TRUE if successful or FALSE if the specified capture driver cannot be connected to the capture window.
Remarks
Connecting a capture driver to a capture window automatically disconnects any previously connected capture driver.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.</misc></message>
<message value="0x40b">
<name>WM_CAP_DRIVER_DISCONNECT</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE if the capture window is not connected to a capture driver.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam = (WPARAM) 0; </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam = 0L; </lmisc>
</lparam>
<misc>WM_CAP_DRIVER_DISCONNECT
The WM_CAP_DRIVER_DISCONNECT message disconnects a capture driver from a capture window. You can send this message explicitly or by using the capDriverDisconnect macro.
WM_CAP_DRIVER_DISCONNECT
wParam = (WPARAM) 0;
lParam = 0L;
Return Values
Returns TRUE if successful or FALSE if the capture window is not connected to a capture driver.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.</misc>
</message>
<message value="0x40e">
<name>WM_CAP_DRIVER_GET_CAPS</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE if the capture window is not connected to a capture driver.</returnmisc>
</return>
<wparam value="">
<wname>wSize</wname>
<wmisc>wSize
Size, in bytes, of the structure referenced by s.</wmisc>
</wparam>
<lparam value="LPCAPDRIVERCAPS">
<lname>psCaps</lname>
<lmisc>psCaps
Pointer to the CAPDRIVERCAPS structure to contain the hardware capabilities.</lmisc>
</lparam>
<misc>WM_CAP_DRIVER_GET_CAPS
The WM_CAP_DRIVER_GET_CAPS message returns the hardware capabilities of the capture driver currently connected to a capture window. You can send this message explicitly or by using the capDriverGetCaps macro.
WM_CAP_DRIVER_GET_CAPS
wParam = (WPARAM) (wSize);
lParam = (LPARAM) (LPVOID) (LPCAPDRIVERCAPS) (psCaps);
Parameters
wSize
Size, in bytes, of the structure referenced by s.
psCaps
Pointer to the CAPDRIVERCAPS structure to contain the hardware capabilities.
Return Values
Returns TRUE if successful or FALSE if the capture window is not connected to a capture driver.
Remarks
The capabilities returned in CAPDRIVERCAPS are constant for a given capture driver. Applications need to retrieve this information once when the capture driver is first connected to a capture window.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.</misc>
</message>
<message value="0x40c">
<name>WM_CAP_DRIVER_GET_NAMEA</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE if the capture window is not connected to a capture driver.</returnmisc>
</return>
<wparam value="">
<wname>wSize</wname>
<wmisc>wSize
Size, in bytes, of the buffer referenced by szName.</wmisc>
</wparam>
<lparam value="LPSTR">
<lname>szName</lname>
<lmisc>szName
Pointer to an application-defined buffer used to return the device name as a null-terminated string.</lmisc>
</lparam>
<misc>WM_CAP_DRIVER_GET_NAME
The WM_CAP_DRIVER_GET_NAME message returns the name of the capture driver connected to the capture window. You can send this message explicitly or by using the capDriverGetName macro.
WM_CAP_DRIVER_GET_NAME
wParam = (WPARAM) (wSize);
lParam = (LPARAM) (LPVOID) (LPSTR) (szName);
Parameters
wSize
Size, in bytes, of the buffer referenced by szName.
szName
Pointer to an application-defined buffer used to return the device name as a null-terminated string.
Return Values
Returns TRUE if successful or FALSE if the capture window is not connected to a capture driver.
Remarks
The name is a text string retrieved from the driver's resource area. Applications should allocate approximately 80 bytes for this string. If the driver does not contain a name resource, the full path name of the driver listed in the registry or in the SYSTEM.INI file is returned.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.
Unicode: Declared as Unicode and ANSI messages.</misc>
</message>
<message value="0x470">
<name>WM_CAP_DRIVER_GET_NAMEW</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE if the capture window is not connected to a capture driver.</returnmisc>
</return>
<wparam value="">
<wname>wSize</wname>
<wmisc>wSize
Size, in bytes, of the buffer referenced by szName.</wmisc>
</wparam>
<lparam value="LPSTR">
<lname>szName</lname>
<lmisc>szName
Pointer to an application-defined buffer used to return the device name as a null-terminated string.</lmisc>
</lparam>
<misc>WM_CAP_DRIVER_GET_NAME
The WM_CAP_DRIVER_GET_NAME message returns the name of the capture driver connected to the capture window. You can send this message explicitly or by using the capDriverGetName macro.
WM_CAP_DRIVER_GET_NAME
wParam = (WPARAM) (wSize);
lParam = (LPARAM) (LPVOID) (LPSTR) (szName);
Parameters
wSize
Size, in bytes, of the buffer referenced by szName.
szName
Pointer to an application-defined buffer used to return the device name as a null-terminated string.
Return Values
Returns TRUE if successful or FALSE if the capture window is not connected to a capture driver.
Remarks
The name is a text string retrieved from the driver's resource area. Applications should allocate approximately 80 bytes for this string. If the driver does not contain a name resource, the full path name of the driver listed in the registry or in the SYSTEM.INI file is returned.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.
Unicode: Declared as Unicode and ANSI messages.</misc>
</message>
<message value="0x40d">
<name>WM_CAP_DRIVER_GET_VERSIONA</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE if the capture window is not connected to a capture driver.</returnmisc>
</return>
<wparam value="">
<wname>wSize</wname>
<wmisc>wSize
Size, in bytes, of the application-defined buffer referenced by szVer.
</wmisc>
</wparam>
<lparam value="LPSTR">
<lname>szVer</lname>
<lmisc>szVer
Pointer to an application-defined buffer used to return the version information as a null-terminated string.</lmisc>
</lparam>
<misc>WM_CAP_DRIVER_GET_VERSION
The WM_CAP_DRIVER_GET_VERSION message returns the version information of the capture driver connected to a capture window. You can send this message explicitly or by using the capDriverGetVersion macro.
WM_CAP_DRIVER_GET_VERSION
wParam = (WPARAM) (wSize);
lParam = (LPARAM) (LPVOID) (LPSTR) (szVer);
Parameters
wSize
Size, in bytes, of the application-defined buffer referenced by szVer.
szVer
Pointer to an application-defined buffer used to return the version information as a null-terminated string.
Return Values
Returns TRUE if successful or FALSE if the capture window is not connected to a capture driver.
Remarks
The version information is a text string retrieved from the driver's resource area. Applications should allocate approximately 40 bytes for this string. If version information is not available, a NULL string is returned.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.
Unicode: Declared as Unicode and ANSI messages.</misc>
</message>
<message value="0x471">
<name>WM_CAP_DRIVER_GET_VERSIONW</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE if the capture window is not connected to a capture driver.</returnmisc>
</return>
<wparam value="">
<wname>wSize</wname>
<wmisc>wSize
Size, in bytes, of the application-defined buffer referenced by szVer.
</wmisc>
</wparam>
<lparam value="LPSTR">
<lname>szVer</lname>
<lmisc>szVer
Pointer to an application-defined buffer used to return the version information as a null-terminated string.</lmisc>
</lparam>
<misc>WM_CAP_DRIVER_GET_VERSION
The WM_CAP_DRIVER_GET_VERSION message returns the version information of the capture driver connected to a capture window. You can send this message explicitly or by using the capDriverGetVersion macro.
WM_CAP_DRIVER_GET_VERSION
wParam = (WPARAM) (wSize);
lParam = (LPARAM) (LPVOID) (LPSTR) (szVer);
Parameters
wSize
Size, in bytes, of the application-defined buffer referenced by szVer.
szVer
Pointer to an application-defined buffer used to return the version information as a null-terminated string.
Return Values
Returns TRUE if successful or FALSE if the capture window is not connected to a capture driver.
Remarks
The version information is a text string retrieved from the driver's resource area. Applications should allocate approximately 40 bytes for this string. If version information is not available, a NULL string is returned.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.
Unicode: Declared as Unicode and ANSI messages.</misc>
</message>
<message value="0x41e">
<name>WM_CAP_EDIT_COPY</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE otherwise.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam = (WPARAM) 0; </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam = 0L; </lmisc>
</lparam>
<misc>WM_CAP_EDIT_COPY
The WM_CAP_EDIT_COPY message copies the contents of the video frame buffer and associated palette to the clipboard. You can send this message explicitly or by using the capEditCopy macro.
WM_CAP_EDIT_COPY
wParam = (WPARAM) 0;
lParam = 0L;
Return Values
Returns TRUE if successful or FALSE otherwise.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.</misc>
</message>
<message value="0x451">
<name>WM_CAP_END</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x416">
<name>WM_CAP_FILE_ALLOCATE</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE otherwise.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam = (WPARAM) 0; </wmisc>
</wparam>
<lparam value="DWORD">
<lname>dwSize</lname>
<lmisc>dwSize
Size, in bytes, to create the capture file.</lmisc>
</lparam>
<misc>WM_CAP_FILE_ALLOCATE
The WM_CAP_FILE_ALLOCATE message creates (preallocates) a capture file of a specified size. You can send this message explicitly or by using the capFileAlloc macro.
WM_CAP_FILE_ALLOCATE
wParam = (WPARAM) 0;
lParam = (LPARAM) (DWORD) (dwSize);
Parameters
dwSize
Size, in bytes, to create the capture file.
Return Values
Returns TRUE if successful or FALSE otherwise.
If an error occurs and an error callback function is set using the WM_CAP_SET_CALLBACK_ERROR message, the error callback function is called.
Remarks
You can improve streaming capture performance significantly by preallocating a capture file large enough to store an entire video clip and by defragmenting the capture file before capturing the clip.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.</misc>
</message>
<message value="0x415">
<name>WM_CAP_FILE_GET_CAPTURE_FILEA</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE otherwise.</returnmisc>
</return>
<wparam value="">
<wname>wSize</wname>
<wmisc>wSize
Size, in bytes, of the application-defined buffer referenced by szName.</wmisc>
</wparam>
<lparam value="LPSTR">
<lname>szName</lname>
<lmisc>szName
Pointer to an application-defined buffer used to return the name of the capture file as a null-terminated string.
</lmisc>
</lparam>
<misc>WM_CAP_FILE_GET_CAPTURE_FILE
The WM_CAP_FILE_GET_CAPTURE_FILE message returns the name of the current capture file. You can send this message explicitly or by using the capFileGetCaptureFile macro.
WM_CAP_FILE_GET_CAPTURE_FILE
wParam = (WPARAM) (wSize);
lParam = (LPARAM) (LPVOID) (LPSTR) (szName);
Parameters
wSize
Size, in bytes, of the application-defined buffer referenced by szName.
szName
Pointer to an application-defined buffer used to return the name of the capture file as a null-terminated string.
Return Values
Returns TRUE if successful or FALSE otherwise.
Remarks
The default capture filename is C:\CAPTURE.AVI.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.
Unicode: Declared as Unicode and ANSI messages.</misc>
</message>
<message value="0x479">
<name>WM_CAP_FILE_GET_CAPTURE_FILEW</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE otherwise.</returnmisc>
</return>
<wparam value="">
<wname>wSize</wname>
<wmisc>wSize
Size, in bytes, of the application-defined buffer referenced by szName.</wmisc>
</wparam>
<lparam value="LPSTR">
<lname>szName</lname>
<lmisc>szName
Pointer to an application-defined buffer used to return the name of the capture file as a null-terminated string.
</lmisc>
</lparam>
<misc>WM_CAP_FILE_GET_CAPTURE_FILE
The WM_CAP_FILE_GET_CAPTURE_FILE message returns the name of the current capture file. You can send this message explicitly or by using the capFileGetCaptureFile macro.
WM_CAP_FILE_GET_CAPTURE_FILE
wParam = (WPARAM) (wSize);
lParam = (LPARAM) (LPVOID) (LPSTR) (szName);
Parameters
wSize
Size, in bytes, of the application-defined buffer referenced by szName.
szName
Pointer to an application-defined buffer used to return the name of the capture file as a null-terminated string.
Return Values
Returns TRUE if successful or FALSE otherwise.
Remarks
The default capture filename is C:\CAPTURE.AVI.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.
Unicode: Declared as Unicode and ANSI messages.</misc>
</message>
<message value="0x417">
<name>WM_CAP_FILE_SAVEASA</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE otherwise.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam = (WPARAM) 0; </wmisc>
</wparam>
<lparam value="LPSTR">
<lname>szName</lname>
<lmisc>szName
Pointer to the null-terminated string that contains the name of the destination file used to copy the file.</lmisc>
</lparam>
<misc>WM_CAP_FILE_SAVEAS
The WM_CAP_FILE_SAVEAS message copies the contents of the capture file to another file. You can send this message explicitly or by using the capFileSaveAs macro.
WM_CAP_FILE_SAVEAS
wParam = (WPARAM) 0;
lParam = (LPARAM) (LPVOID) (LPSTR) (szName);
Parameters
szName
Pointer to the null-terminated string that contains the name of the destination file used to copy the file.
Return Values
Returns TRUE if successful or FALSE otherwise.
If an error occurs and an error callback function is set using the WM_CAP_SET_CALLBACK_ERROR message, the error callback function is called.
Remarks
This message does not change the name or contents of the current capture file.
If the copy operation is unsuccessful due to a disk full error, the destination file is automatically deleted.
Typically, a capture file is preallocated for the largest capture segment anticipated and only a portion of it might be used to capture data. This message copies only the portion of the file containing the capture data.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.
Unicode: Declared as Unicode and ANSI messages.</misc>
</message>
<message value="0x47b">
<name>WM_CAP_FILE_SAVEASW</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE otherwise.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam = (WPARAM) 0; </wmisc>
</wparam>
<lparam value="LPSTR">
<lname>szName</lname>
<lmisc>szName
Pointer to the null-terminated string that contains the name of the destination file used to copy the file.</lmisc>
</lparam>
<misc>WM_CAP_FILE_SAVEAS
The WM_CAP_FILE_SAVEAS message copies the contents of the capture file to another file. You can send this message explicitly or by using the capFileSaveAs macro.
WM_CAP_FILE_SAVEAS
wParam = (WPARAM) 0;
lParam = (LPARAM) (LPVOID) (LPSTR) (szName);
Parameters
szName
Pointer to the null-terminated string that contains the name of the destination file used to copy the file.
Return Values
Returns TRUE if successful or FALSE otherwise.
If an error occurs and an error callback function is set using the WM_CAP_SET_CALLBACK_ERROR message, the error callback function is called.
Remarks
This message does not change the name or contents of the current capture file.
If the copy operation is unsuccessful due to a disk full error, the destination file is automatically deleted.
Typically, a capture file is preallocated for the largest capture segment anticipated and only a portion of it might be used to capture data. This message copies only the portion of the file containing the capture data.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.
Unicode: Declared as Unicode and ANSI messages.</misc>
</message>
<message value="0x419">
<name>WM_CAP_FILE_SAVEDIBA</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE otherwise.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam = (WPARAM) 0;</wmisc>
</wparam>
<lparam value="LPSTR">
<lname>szName</lname>
<lmisc>szName
Pointer to the null-terminated string that contains the name of the destination DIB file.
</lmisc>
</lparam>
<misc>WM_CAP_FILE_SAVEDIB
The WM_CAP_FILE_SAVEDIB message copies the current frame to a DIB file. You can send this message explicitly or by using the capFileSaveDIB macro.
WM_CAP_FILE_SAVEDIB
wParam = (WPARAM) 0;
lParam = (LPARAM) (LPVOID) (LPSTR) (szName);
Parameters
szName
Pointer to the null-terminated string that contains the name of the destination DIB file.
Return Values
Returns TRUE if successful or FALSE otherwise.
If an error occurs and an error callback function is set using the WM_CAP_SET_CALLBACK_ERROR message, the error callback function is called.
Remarks
If the capture driver supplies frames in a compressed format, this call attempts to decompress the frame before writing the file.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.
Unicode: Declared as Unicode and ANSI messages.</misc>
</message>
<message value="0x47d">
<name>WM_CAP_FILE_SAVEDIBW</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE otherwise.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam = (WPARAM) 0;</wmisc>
</wparam>
<lparam value="LPSTR">
<lname>szName</lname>
<lmisc>szName
Pointer to the null-terminated string that contains the name of the destination DIB file.
</lmisc>
</lparam>
<misc>WM_CAP_FILE_SAVEDIB
The WM_CAP_FILE_SAVEDIB message copies the current frame to a DIB file. You can send this message explicitly or by using the capFileSaveDIB macro.
WM_CAP_FILE_SAVEDIB
wParam = (WPARAM) 0;
lParam = (LPARAM) (LPVOID) (LPSTR) (szName);
Parameters
szName
Pointer to the null-terminated string that contains the name of the destination DIB file.
Return Values
Returns TRUE if successful or FALSE otherwise.
If an error occurs and an error callback function is set using the WM_CAP_SET_CALLBACK_ERROR message, the error callback function is called.
Remarks
If the capture driver supplies frames in a compressed format, this call attempts to decompress the frame before writing the file.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.
Unicode: Declared as Unicode and ANSI messages.</misc>
</message>
<message value="0x414">
<name>WM_CAP_FILE_SET_CAPTURE_FILEA</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE if the filename is invalid, or if streaming or single-frame capture is in progress.
</returnmisc>
</return>
<wparam value="LPSTR">
<wname>wParam</wname>
<wmisc>wParam = (WPARAM) 0; </wmisc>
</wparam>
<lparam value="">
<lname>szName</lname>
<lmisc>szName
Pointer to the null-terminated string that contains the name of the capture file to use.</lmisc>
</lparam>
<misc>WM_CAP_FILE_SET_CAPTURE_FILE
The WM_CAP_FILE_SET_CAPTURE_FILE message names the file used for video capture. You can send this message explicitly or by using the capFileSetCaptureFile macro.
WM_CAP_FILE_SET_CAPTURE_FILE
wParam = (WPARAM) 0;
lParam = (LPARAM) (LPVOID) (LPSTR) (szName);
Parameters
szName
Pointer to the null-terminated string that contains the name of the capture file to use.
Return Values
Returns TRUE if successful or FALSE if the filename is invalid, or if streaming or single-frame capture is in progress.
Remarks
This message stores the filename in an internal structure. It does not create, allocate, or open the specified file. The default capture filename is C:\CAPTURE.AVI.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.
Unicode: Declared as Unicode and ANSI messages.</misc>
</message>
<message value="0x478">
<name>WM_CAP_FILE_SET_CAPTURE_FILEW</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE if the filename is invalid, or if streaming or single-frame capture is in progress.
</returnmisc>
</return>
<wparam value="LPSTR">
<wname>wParam</wname>
<wmisc>wParam = (WPARAM) 0; </wmisc>
</wparam>
<lparam value="">
<lname>szName</lname>
<lmisc>szName
Pointer to the null-terminated string that contains the name of the capture file to use.</lmisc>
</lparam>
<misc>WM_CAP_FILE_SET_CAPTURE_FILE
The WM_CAP_FILE_SET_CAPTURE_FILE message names the file used for video capture. You can send this message explicitly or by using the capFileSetCaptureFile macro.
WM_CAP_FILE_SET_CAPTURE_FILE
wParam = (WPARAM) 0;
lParam = (LPARAM) (LPVOID) (LPSTR) (szName);
Parameters
szName
Pointer to the null-terminated string that contains the name of the capture file to use.
Return Values
Returns TRUE if successful or FALSE if the filename is invalid, or if streaming or single-frame capture is in progress.
Remarks
This message stores the filename in an internal structure. It does not create, allocate, or open the specified file. The default capture filename is C:\CAPTURE.AVI.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.
Unicode: Declared as Unicode and ANSI messages.</misc>
</message>
<message value="0x418">
<name>WM_CAP_FILE_SET_INFOCHUNK</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE otherwise.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam = (WPARAM)0; </wmisc>
</wparam>
<lparam value="LPCAPINFOCHUNK">
<lname>lpInfoChunk</lname>
<lmisc>lpInfoChunk
Pointer to a CAPINFOCHUNK structure defining the information chunk to be created or deleted.</lmisc>
</lparam>
<misc>WM_CAP_FILE_SET_INFOCHUNK
The WM_CAP_FILE_SET_INFOCHUNK message sets and clears information chunks. Information chunks can be inserted in an AVI file during capture to embed text strings or custom data. You can send this message explicitly or by using the capFileSetInfoChunk macro.
WM_CAP_FILE_SET_INFOCHUNK
wParam = (WPARAM)0;
lParam = (LPARAM) (LPCAPINFOCHUNK) (lpInfoChunk);
Parameters
lpInfoChunk
Pointer to a CAPINFOCHUNK structure defining the information chunk to be created or deleted.
Return Values
Returns TRUE if successful or FALSE otherwise.
If an error occurs and an error callback function is set using the WM_CAP_SET_CALLBACK_ERROR message, the error callback function is called.
Remarks
Multiple registered information chunks can be added to an AVI file. After an information chunk is set, it continues to be added to subsequent capture files until either the entry is cleared or all information chunk entries are cleared. To clear a single entry, specify the information chunk in the fccInfoID member and NULL in the lpData member of the CAPINFOCHUNK structure. To clear all entries, specify NULL in fccInfoID.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.</misc>
</message>
<message value="0x424">
<name>WM_CAP_GET_AUDIOFORMAT</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Values
Returns the size, in bytes, of the audio format</returnmisc>
</return>
<wparam value="">
<wname>wSize</wname>
<wmisc>wSize
Size, in bytes, of the structure referenced by s.</wmisc>
</wparam>
<lparam value="WAVEFORMATEX">
<lname>psAudioFormat</lname>
<lmisc>psAudioFormat
Pointer to a WAVEFORMATEX structure, or NULL. If the value is NULL, the size, in bytes, required to hold the WAVEFORMATEX structure is returned.
</lmisc>
</lparam>
<misc>WM_CAP_GET_AUDIOFORMAT
The WM_CAP_GET_AUDIOFORMAT message obtains the audio format or the size of the audio format. You can send this message explicitly or by using the capGetAudioFormat and capGetAudioFormatSize macros.
WM_CAP_GET_AUDIOFORMAT
wParam = (WPARAM) (wSize);
lParam = (LPARAM) (LPVOID) (LPWAVEFORMATEX) (psAudioFormat);
Parameters
wSize
Size, in bytes, of the structure referenced by s.
psAudioFormat
Pointer to a WAVEFORMATEX structure, or NULL. If the value is NULL, the size, in bytes, required to hold the WAVEFORMATEX structure is returned.
Return Values
Returns the size, in bytes, of the audio format.
Remarks
Because compressed audio formats vary in size requirements applications must first retrieve the size, then allocate memory, and finally request the audio format data.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.</misc>
</message>
<message value="0x401">
<name>WM_CAP_GET_CAPSTREAMPTR</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x443">
<name>WM_CAP_GET_MCI_DEVICEA</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE otherwise.
</returnmisc>
</return>
<wparam value="">
<wname>wSize</wname>
<wmisc>wSize
Length, in bytes, of the buffer referenced by szName .</wmisc>
</wparam>
<lparam value="LPSTR">
<lname>szName</lname>
<lmisc>szName
Pointer to a null-terminated string that contains the MCI device name.</lmisc>
</lparam>
<misc>WM_CAP_GET_MCI_DEVICE
The WM_CAP_GET_MCI_DEVICE message retrieves the name of an MCI device previously set with the WM_CAP_SET_MCI_DEVICE message. You can send this message explicitly or by using the capGetMCIDeviceName macro.
WM_CAP_GET_MCI_DEVICE
wParam = (WPARAM) (wSize);
lParam = (LPARAM) (LPVOID) (LPSTR) (szName);
Parameters
wSize
Length, in bytes, of the buffer referenced by szName .
szName
Pointer to a null-terminated string that contains the MCI device name.
Return Values
Returns TRUE if successful or FALSE otherwise.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.
Unicode: Declared as Unicode and ANSI messages.</misc>
</message>
<message value="0x4a7">
<name>WM_CAP_GET_MCI_DEVICEW</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE otherwise.
</returnmisc>
</return>
<wparam value="">
<wname>wSize</wname>
<wmisc>wSize
Length, in bytes, of the buffer referenced by szName .</wmisc>
</wparam>
<lparam value="LPSTR">
<lname>szName</lname>
<lmisc>szName
Pointer to a null-terminated string that contains the MCI device name.</lmisc>
</lparam>
<misc>WM_CAP_GET_MCI_DEVICE
The WM_CAP_GET_MCI_DEVICE message retrieves the name of an MCI device previously set with the WM_CAP_SET_MCI_DEVICE message. You can send this message explicitly or by using the capGetMCIDeviceName macro.
WM_CAP_GET_MCI_DEVICE
wParam = (WPARAM) (wSize);
lParam = (LPARAM) (LPVOID) (LPSTR) (szName);
Parameters
wSize
Length, in bytes, of the buffer referenced by szName .
szName
Pointer to a null-terminated string that contains the MCI device name.
Return Values
Returns TRUE if successful or FALSE otherwise.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.
Unicode: Declared as Unicode and ANSI messages.</misc>
</message>
<message value="0x441">
<name>WM_CAP_GET_SEQUENCE_SETUP</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE otherwise.</returnmisc>
</return>
<wparam value="">
<wname>wSize</wname>
<wmisc>wSize
Size, in bytes, of the structure referenced by s.</wmisc>
</wparam>
<lparam value="LPCAPTUREPARMS">
<lname>s</lname>
<lmisc>s
Pointer to a CAPTUREPARMS structure.</lmisc>
</lparam>
<misc>WM_CAP_GET_SEQUENCE_SETUP
The WM_CAP_GET_SEQUENCE_SETUP message retrieves the current settings of the streaming capture parameters. You can send this message explicitly or by using the capCaptureGetSetup macro.
WM_CAP_GET_SEQUENCE_SETUP
wParam = (WPARAM) (wSize);
lParam = (LPARAM) (LPVOID) (LPCAPTUREPARMS) (s);
Parameters
wSize
Size, in bytes, of the structure referenced by s.
s
Pointer to a CAPTUREPARMS structure.
Return Values
Returns TRUE if successful or FALSE otherwise.
Remarks
For information about the parameters used to control streaming capture, see the CAPTUREPARMS structure.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.</misc>
</message>
<message value="0x436">
<name>WM_CAP_GET_STATUS</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE if the capture window is not connected to a capture driver.</returnmisc>
</return>
<wparam value="">
<wname>wSize</wname>
<wmisc>wSize
Size, in bytes, of the structure referenced by s.</wmisc>
</wparam>
<lparam value="LPCAPSTATUS">
<lname>s</lname>
<lmisc>s
Pointer to a CAPSTATUS structure.</lmisc>
</lparam>
<misc>WM_CAP_GET_STATUS
The WM_CAP_GET_STATUS message retrieves the status of the capture window. You can send this message explicitly or by using the capGetStatus macro.
WM_CAP_GET_STATUS
wParam = (WPARAM) (wSize);
lParam = (LPARAM) (LPVOID) (LPCAPSTATUS) (s);
Parameters
wSize
Size, in bytes, of the structure referenced by s.
s
Pointer to a CAPSTATUS structure.
Return Values
Returns TRUE if successful or FALSE if the capture window is not connected to a capture driver.
Remarks
The CAPSTATUS structure contains the current state of the capture window. Since this state is dynamic and changes in response to various messages, the application should initialize this structure after sending the WM_CAP_DLG_VIDEOFORMAT message (or using the capDlgVideoFormat macro) and whenever it needs to enable menu items or determine the actual state of the window.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.</misc>
</message>
<message value="0x408">
<name>WM_CAP_GET_USER_DATA</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Values
Returns a value previously saved by using the WM_CAP_SET_USER_DATA message.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam = (WPARAM) 0; </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam = 0L; </lmisc>
</lparam>
<misc>WM_CAP_GET_USER_DATA
The WM_CAP_GET_USER_DATA message retrieves a LONG data value associated with a capture window. You can send this message explicitly or by using the capGetUserData macro.
WM_CAP_GET_USER_DATA
wParam = (WPARAM) 0;
lParam = 0L;
Return Values
Returns a value previously saved by using the WM_CAP_SET_USER_DATA message.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.</misc>
</message>
<message value="0x42c">
<name>WM_CAP_GET_VIDEOFORMAT</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Values
Returns the size, in bytes, of the video format or zero if the capture window is not connected to a capture driver. For video formats that require a palette, the current palette is also returned.
</returnmisc>
</return>
<wparam value="">
<wname>wSize</wname>
<wmisc>wSize
Size, in bytes, of the structure referenced by s.</wmisc>
</wparam>
<lparam value="BITMAPINFO">
<lname>psVideoFormat</lname>
<lmisc>psVideoFormat
Pointer to a BITMAPINFO structure. You can also specify NULL to retrieve the number of bytes needed by BITMAPINFO.
</lmisc>
</lparam>
<misc>WM_CAP_GET_VIDEOFORMAT
The WM_CAP_GET_VIDEOFORMAT message retrieves a copy of the video format in use or the size required for the video format. You can send this message explicitly or by using the capGetVideoFormat and capGetVideoFormatSize macros.
WM_CAP_GET_VIDEOFORMAT
wParam = (WPARAM) (wSize);
lParam = (LPARAM) (LPVOID) (psVideoFormat);
Parameters
wSize
Size, in bytes, of the structure referenced by s.
psVideoFormat
Pointer to a BITMAPINFO structure. You can also specify NULL to retrieve the number of bytes needed by BITMAPINFO.
Return Values
Returns the size, in bytes, of the video format or zero if the capture window is not connected to a capture driver. For video formats that require a palette, the current palette is also returned.
Remarks
Because compressed video formats vary in size requirements applications must first retrieve the size, then allocate memory, and finally request the video format data.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.</misc>
</message>
<message value="0x43c">
<name>WM_CAP_GRAB_FRAME</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE otherwise.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam = (WPARAM)0;</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam = (LPARAM)0L; </lmisc>
</lparam>
<misc>WM_CAP_GRAB_FRAME
The WM_CAP_GRAB_FRAME message retrieves and displays a single frame from the capture driver. After capture, overlay and preview are disabled. You can send this message explicitly or by using the capGrabFrame macro.
WM_CAP_GRAB_FRAME
wParam = (WPARAM)0;
lParam = (LPARAM)0L;
Return Values
Returns TRUE if successful or FALSE otherwise.
Remarks
For information about installing callback functions, see the WM_CAP_SET_CALLBACK_ERROR and WM_CAP_SET_CALLBACK_FRAME messages.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.</misc>
</message>
<message value="0x43d">
<name>WM_CAP_GRAB_FRAME_NOSTOP</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE otherwise.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam = (WPARAM) 0; </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam = 0L; </lmisc>
</lparam>
<misc>WM_CAP_GRAB_FRAME_NOSTOP
The WM_CAP_GRAB_FRAME_NOSTOP message fills the frame buffer with a single uncompressed frame from the capture device and displays it. Unlike with the WM_CAP_GRAB_FRAME message, the state of overlay or preview is not altered by this message. You can send this message explicitly or by using the capGrabFrameNoStop macro.
WM_CAP_GRAB_FRAME_NOSTOP
wParam = (WPARAM) 0;
lParam = 0L;
Return Values
Returns TRUE if successful or FALSE otherwise.
Remarks
For information about installing callback functions, see the WM_CAP_SET_CALLBACK_ERROR and WM_CAP_SET_CALLBACK_FRAME messages.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.</misc>
</message>
<message value="0x453">
<name>WM_CAP_PAL_AUTOCREATE</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE otherwise.</returnmisc>
</return>
<wparam value="">
<wname>iFrames</wname>
<wmisc>iFrames
Number of frames to sample.</wmisc>
</wparam>
<lparam value="DWORD">
<lname>iColors</lname>
<lmisc>iColors
Number of colors in the palette. The maximum value for this parameter is 256.</lmisc>
</lparam>
<misc>WM_CAP_PAL_AUTOCREATE
The WM_CAP_PAL_AUTOCREATE message requests that the capture driver sample video frames and automatically create a new palette. You can send this message explicitly or by using the capPaletteAuto macro.
WM_CAP_PAL_AUTOCREATE
wParam = (WPARAM) (iFrames);
lParam = (LPARAM) (DWORD) (iColors);
Parameters
iFrames
Number of frames to sample.
iColors
Number of colors in the palette. The maximum value for this parameter is 256.
Return Values
Returns TRUE if successful or FALSE otherwise.
If an error occurs and an error callback function is set using the WM_CAP_SET_CALLBACK_ERROR message, the error callback function is called.
Remarks
The sampled video sequence should include all the colors you want in the palette. To obtain the best palette, you might have to sample the whole sequence rather than a portion of it.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.</misc>
</message>
<message value="0x454">
<name>WM_CAP_PAL_MANUALCREATE</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE otherwise.</returnmisc>
</return>
<wparam value="">
<wname>fGrab</wname>
<wmisc>fGrab
Palette histogram flag. Set this parameter to TRUE for each frame included in creating the optimal palette. After the last frame has been collected, set this parameter to FALSE to calculate the optimal palette and send it to the capture driver.
</wmisc>
</wparam>
<lparam value="">
<lname>iColors</lname>
<lmisc>iColors
Number of colors in the palette. The maximum value for this parameter is 256. This value is used only during collection of the first frame in a sequence.
</lmisc>
</lparam>
<misc>WM_CAP_PAL_MANUALCREATE
The WM_CAP_PAL_MANUALCREATE message requests that the capture driver manually sample video frames and create a new palette. You can send this message explicitly or by using the capPaletteManual macro.
WM_CAP_PAL_MANUALCREATE
wParam = (WPARAM) (fGrab);
lParam = (LPARAM) (DWORD) (iColors);
Parameters
fGrab
Palette histogram flag. Set this parameter to TRUE for each frame included in creating the optimal palette. After the last frame has been collected, set this parameter to FALSE to calculate the optimal palette and send it to the capture driver.
iColors
Number of colors in the palette. The maximum value for this parameter is 256. This value is used only during collection of the first frame in a sequence.
Return Values
Returns TRUE if successful or FALSE otherwise.
If an error occurs and an error callback function is set using the WM_CAP_SET_CALLBACK_ERROR message, the error callback function is called.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.</misc>
</message>
<message value="0x450">
<name>WM_CAP_PAL_OPENA</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE otherwise.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam = (WPARAM) 0;</wmisc>
</wparam>
<lparam value="">
<lname>szName</lname>
<lmisc>szName
Pointer to a null-terminated string containing the palette filename.</lmisc>
</lparam>
<misc>WM_CAP_PAL_OPEN
The WM_CAP_PAL_OPEN message loads a new palette from a palette file and passes it to a capture driver. Palette files typically use the filename extension .PAL. A capture driver uses a palette when required by the specified digitized image format. You can send this message explicitly or by using the capPaletteOpen macro.
WM_CAP_PAL_OPEN
wParam = (WPARAM) 0;
lParam = (LPARAM) (LPVOID) (LPSTR) (szName);
Parameters
szName
Pointer to a null-terminated string containing the palette filename.
Return Values
Returns TRUE if successful or FALSE otherwise.
If an error occurs and an error callback function is set using the WM_CAP_SET_CALLBACK_ERROR message, the error callback function is called.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.
Unicode: Declared as Unicode and ANSI messages.</misc>
</message>
<message value="0x4b4">
<name>WM_CAP_PAL_OPENW</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE otherwise.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam = (WPARAM) 0;</wmisc>
</wparam>
<lparam value="">
<lname>szName</lname>
<lmisc>szName
Pointer to a null-terminated string containing the palette filename.</lmisc>
</lparam>
<misc>WM_CAP_PAL_OPEN
The WM_CAP_PAL_OPEN message loads a new palette from a palette file and passes it to a capture driver. Palette files typically use the filename extension .PAL. A capture driver uses a palette when required by the specified digitized image format. You can send this message explicitly or by using the capPaletteOpen macro.
WM_CAP_PAL_OPEN
wParam = (WPARAM) 0;
lParam = (LPARAM) (LPVOID) (LPSTR) (szName);
Parameters
szName
Pointer to a null-terminated string containing the palette filename.
Return Values
Returns TRUE if successful or FALSE otherwise.
If an error occurs and an error callback function is set using the WM_CAP_SET_CALLBACK_ERROR message, the error callback function is called.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.
Unicode: Declared as Unicode and ANSI messages.</misc>
</message>
<message value="0x452">
<name>WM_CAP_PAL_PASTE</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE otherwise.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam = (WPARAM) 0; </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam = 0L; </lmisc>
</lparam>
<misc>WM_CAP_PAL_PASTE
The WM_CAP_PAL_PASTE message copies the palette from the clipboard and passes it to a capture driver. You can send this message explicitly or by using the capPalettePaste macro.
WM_CAP_PAL_PASTE
wParam = (WPARAM) 0;
lParam = 0L;
Return Values
Returns TRUE if successful or FALSE otherwise.
If an error occurs and an error callback function is set using the WM_CAP_SET_CALLBACK_ERROR message, the error callback function is called.
Remarks
A capture driver uses a palette when required by the specified digitized video format.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.</misc>
</message>
<message value="0x451">
<name>WM_CAP_PAL_SAVEA</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE otherwise.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam = (WPARAM) 0; </wmisc>
</wparam>
<lparam value="LPSTR">
<lname>szName</lname>
<lmisc>szName
Pointer to a null-terminated string containing the palette filename.</lmisc>
</lparam>
<misc>WM_CAP_PAL_SAVE
The WM_CAP_PAL_SAVE message saves the current palette to a palette file. Palette files typically use the filename extension .PAL. You can send this message explicitly or by using the capPaletteSave macro.
WM_CAP_PAL_SAVE
wParam = (WPARAM) 0;
lParam = (LPARAM) (LPVOID) (LPSTR) (szName);
Parameters
szName
Pointer to a null-terminated string containing the palette filename.
Return Values
Returns TRUE if successful or FALSE otherwise.
If an error occurs and an error callback function is set using the WM_CAP_SET_CALLBACK_ERROR message, the error callback function is called.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.
Unicode: Declared as Unicode and ANSI messages.</misc>
</message>
<message value="0x4b5">
<name>WM_CAP_PAL_SAVEW</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE otherwise.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam = (WPARAM) 0; </wmisc>
</wparam>
<lparam value="LPSTR">
<lname>szName</lname>
<lmisc>szName
Pointer to a null-terminated string containing the palette filename.</lmisc>
</lparam>
<misc>WM_CAP_PAL_SAVE
The WM_CAP_PAL_SAVE message saves the current palette to a palette file. Palette files typically use the filename extension .PAL. You can send this message explicitly or by using the capPaletteSave macro.
WM_CAP_PAL_SAVE
wParam = (WPARAM) 0;
lParam = (LPARAM) (LPVOID) (LPSTR) (szName);
Parameters
szName
Pointer to a null-terminated string containing the palette filename.
Return Values
Returns TRUE if successful or FALSE otherwise.
If an error occurs and an error callback function is set using the WM_CAP_SET_CALLBACK_ERROR message, the error callback function is called.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.
Unicode: Declared as Unicode and ANSI messages.</misc>
</message>
<message value="0x43e">
<name>WM_CAP_SEQUENCE</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE otherwise.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam = (WPARAM) 0; </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam = 0L; </lmisc>
</lparam>
<misc>WM_CAP_SEQUENCE
The WM_CAP_SEQUENCE message initiates streaming video and audio capture to a file. You can send this message explicitly or by using the capCaptureSequence macro.
WM_CAP_SEQUENCE
wParam = (WPARAM) 0;
lParam = 0L;
Return Values
Returns TRUE if successful or FALSE otherwise.
If an error occurs and an error callback function is set using the WM_CAP_SET_CALLBACK_ERROR message, the error callback function is called.
Remarks
If you want to alter the parameters controlling streaming capture, use the WM_CAP_SET_SEQUENCE_SETUP message prior to starting the capture.
By default, the capture window does not allow other applications to continue running during capture. To override this, either set the fYield member of the CAPTUREPARMS structure to TRUE, or install a yield callback function.
During streaming capture, the capture window can optionally issue notifications to your application of specific types of conditions. To install callback procedures for these notifications, use the following messages:
WM_CAP_SET_CALLBACK_ERROR
WM_CAP_SET_CALLBACK_STATUS
WM_CAP_SET_CALLBACK_YIELD
WM_CAP_SET_CALLBACK_VIDEOSTREAM
WM_CAP_SET_CALLBACK_WAVESTREAM
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.</misc>
</message>
<message value="0x43f">
<name>WM_CAP_SEQUENCE_NOFILE</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE otherwise.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam = (WPARAM) 0; </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam = 0L; </lmisc>
</lparam>
<misc>WM_CAP_SEQUENCE_NOFILE
The WM_CAP_SEQUENCE_NOFILE message initiates streaming video capture without writing data to a file. You can send this message explicitly or by using the capCaptureSequenceNoFile macro.
WM_CAP_SEQUENCE_NOFILE
wParam = (WPARAM) 0;
lParam = 0L;
Return Values
Returns TRUE if successful or FALSE otherwise.
Remarks
This message is useful in conjunction with video stream or waveform-audio stream callback functions that let your application use the video and audio data directly.
If you want to alter the parameters controlling streaming capture, use the WM_CAP_SET_SEQUENCE_SETUP message prior to starting the capture.
By default, the capture window does not allow other applications to continue running during capture. To override this, either set the fYield member of the CAPTUREPARMS structure to TRUE, or install a yield callback function.
During streaming capture, the capture window can optionally issue notifications to your application of specific types of conditions. To install callback procedures for these notifications, use the following messages:
WM_CAP_SET_CALLBACK_ERROR
WM_CAP_SET_CALLBACK_STATUS
WM_CAP_SET_CALLBACK_YIELD
WM_CAP_SET_CALLBACK_VIDEOSTREAM
WM_CAP_SET_CALLBACK_WAVESTREAM
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.</misc>
</message>
<message value="0x423">
<name>WM_CAP_SET_AUDIOFORMAT</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE otherwise.</returnmisc>
</return>
<wparam value="">
<wname>wSize</wname>
<wmisc>wSize
Size, in bytes, of the structure referenced by s.</wmisc>
</wparam>
<lparam value="LPWAVEFORMATEX">
<lname>psAudioFormat</lname>
<lmisc>psAudioFormat
Pointer to a WAVEFORMATEX or PCMWAVEFORMAT structure that defines the audio format.</lmisc>
</lparam>
<misc>WM_CAP_SET_AUDIOFORMAT
The WM_CAP_SET_AUDIOFORMAT message sets the audio format to use when performing streaming or step capture. You can send this message explicitly or by using the capSetAudioFormat macro.
WM_CAP_SET_AUDIOFORMAT
wParam = (WPARAM) (wSize);
lParam = (LPARAM) (LPVOID) (LPWAVEFORMATEX) (psAudioFormat);
Parameters
wSize
Size, in bytes, of the structure referenced by s.
psAudioFormat
Pointer to a WAVEFORMATEX or PCMWAVEFORMAT structure that defines the audio format.
Return Values
Returns TRUE if successful or FALSE otherwise.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.</misc>
</message>
<message value="0x455">
<name>WM_CAP_SET_CALLBACK_CAPCONTROL</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE if a streaming capture or a single-frame capture session is in progress.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam = (WPARAM) 0; </wmisc>
</wparam>
<lparam value="">
<lname>fpProc</lname>
<lmisc>fpProc
Pointer to the callback function, of type capControlCallback. Specify NULL for this parameter to disable a previously installed callback function.
</lmisc>
</lparam>
<misc>WM_CAP_SET_CALLBACK_CAPCONTROL
The WM_CAP_SET_CALLBACK_CAPCONTROL message sets a callback function in the application giving it precise recording control. You can send this message explicitly or by using the capSetCallbackOnCapControl macro.
WM_CAP_SET_CALLBACK_CAPCONTROL
wParam = (WPARAM) 0;
lParam = (LPARAM) (LPVOID) (fpProc);
Parameters
fpProc
Pointer to the callback function, of type capControlCallback. Specify NULL for this parameter to disable a previously installed callback function.
Return Values
Returns TRUE if successful or FALSE if a streaming capture or a single-frame capture session is in progress.
Remarks
A single callback function is used to give the application precise control over the moments that streaming capture begins and completes. The capture window first calls the procedure with nState set to CONTROLCALLBACK_PREROLL after all buffers have been allocated and all other capture preparations have finished. This gives the application the ability to preroll video sources, returning from the callback function at the exact moment recording is to begin. A return value of TRUE from the callback function continues capture, and a return value of FALSE aborts capture. After capture begins, this callback function will be called frequently with nState set to CONTROLCALLBACK_CAPTURING to allow the application to end capture by returning FALSE.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.</misc>
</message>
<message value="0x402">
<name>WM_CAP_SET_CALLBACK_ERRORA</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE if streaming capture or a single-frame capture session is in progress.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam = (WPARAM) 0; </wmisc>
</wparam>
<lparam value="">
<lname>fpProc</lname>
<lmisc>fpProc
Pointer to the error callback function, of type capErrorCallback. Specify NULL for this parameter to disable a previously installed error callback function.
</lmisc>
</lparam>
<misc>WM_CAP_SET_CALLBACK_ERROR
The WM_CAP_SET_CALLBACK_ERROR message sets an error callback function in the client application. AVICap calls this procedure when errors occur. You can send this message explicitly or by using the capSetCallbackOnError macro.
WM_CAP_SET_CALLBACK_ERROR
wParam = (WPARAM) 0;
lParam = (LPARAM) (LPVOID) (fpProc);
Parameters
fpProc
Pointer to the error callback function, of type capErrorCallback. Specify NULL for this parameter to disable a previously installed error callback function.
Return Values
Returns TRUE if successful or FALSE if streaming capture or a single-frame capture session is in progress.
Remarks
Applications can optionally set an error callback function. If set, AVICap calls the error procedure in the following situations:
* The disk is full.
* A capture window cannot be connected with a capture driver.
* A waveform-audio device cannot be opened.
* The number of frames dropped during capture exceeds the specified percentage.
* The frames cannot be captured due to vertical synchronization interrupt problems.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.
Unicode: Declared as Unicode and ANSI messages.</misc>
</message>
<message value="0x466">
<name>WM_CAP_SET_CALLBACK_ERRORW</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE if streaming capture or a single-frame capture session is in progress.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam = (WPARAM) 0; </wmisc>
</wparam>
<lparam value="">
<lname>fpProc</lname>
<lmisc>fpProc
Pointer to the error callback function, of type capErrorCallback. Specify NULL for this parameter to disable a previously installed error callback function.
</lmisc>
</lparam>
<misc>WM_CAP_SET_CALLBACK_ERROR
The WM_CAP_SET_CALLBACK_ERROR message sets an error callback function in the client application. AVICap calls this procedure when errors occur. You can send this message explicitly or by using the capSetCallbackOnError macro.
WM_CAP_SET_CALLBACK_ERROR
wParam = (WPARAM) 0;
lParam = (LPARAM) (LPVOID) (fpProc);
Parameters
fpProc
Pointer to the error callback function, of type capErrorCallback. Specify NULL for this parameter to disable a previously installed error callback function.
Return Values
Returns TRUE if successful or FALSE if streaming capture or a single-frame capture session is in progress.
Remarks
Applications can optionally set an error callback function. If set, AVICap calls the error procedure in the following situations:
* The disk is full.
* A capture window cannot be connected with a capture driver.
* A waveform-audio device cannot be opened.
* The number of frames dropped during capture exceeds the specified percentage.
* The frames cannot be captured due to vertical synchronization interrupt problems.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.
Unicode: Declared as Unicode and ANSI messages.</misc>
</message>
<message value="0x405">
<name>WM_CAP_SET_CALLBACK_FRAME</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE if streaming capture or a single-frame capture session is in progress.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam = (WPARAM) 0; </wmisc>
</wparam>
<lparam value="LPVOID">
<lname>fpProc</lname>
<lmisc>fpProc
Pointer to the preview callback function, of type capVideoStreamCallback. Specify NULL for this parameter to disable a previously installed callback function.
</lmisc>
</lparam>
<misc>WM_CAP_SET_CALLBACK_FRAME
The WM_CAP_SET_CALLBACK_FRAME message sets a preview callback function in the application. AVICap calls this procedure when the capture window captures preview frames. You can send this message explicitly or by using the capSetCallbackOnFrame macro.
WM_CAP_SET_CALLBACK_FRAME
wParam = (WPARAM) 0;
lParam = (LPARAM) (LPVOID) (fpProc);
Parameters
fpProc
Pointer to the preview callback function, of type capVideoStreamCallback. Specify NULL for this parameter to disable a previously installed callback function.
Return Values
Returns TRUE if successful or FALSE if streaming capture or a single-frame capture session is in progress.
Remarks
The capture window calls the callback function before displaying preview frames. This allows an application to modify the frame if desired. This callback function is not used during streaming video capture.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.</misc>
</message>
<message value="0x403">
<name>WM_CAP_SET_CALLBACK_STATUSA</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE if streaming capture or a single-frame capture session is in progress.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam = (WPARAM) 0;</wmisc>
</wparam>
<lparam value="LPVOID">
<lname>fpProc</lname>
<lmisc>fpProc
Pointer to the status callback function, of type capStatusCallback. Specify NULL for this parameter to disable a previously installed status callback function.
</lmisc>
</lparam>
<misc>WM_CAP_SET_CALLBACK_STATUS
The WM_CAP_SET_CALLBACK_STATUS message sets a status callback function in the application. AVICap calls this procedure whenever the capture window status changes. You can send this message explicitly or by using the capSetCallbackOnStatus macro.
WM_CAP_SET_CALLBACK_STATUS
wParam = (WPARAM) 0;
lParam = (LPARAM) (LPVOID) (fpProc);
Parameters
fpProc
Pointer to the status callback function, of type capStatusCallback. Specify NULL for this parameter to disable a previously installed status callback function.
Return Values
Returns TRUE if successful or FALSE if streaming capture or a single-frame capture session is in progress.
Remarks
Applications can optionally set a status callback function. If set, AVICap calls this procedure in the following situations:
* A capture session is completed.
* A capture driver successfully connected to a capture window.
* An optimal palette is created.
* The number of captured frames is reported.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.
Unicode: Declared as Unicode and ANSI messages.</misc>
</message>
<message value="0x467">
<name>WM_CAP_SET_CALLBACK_STATUSW</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE if streaming capture or a single-frame capture session is in progress.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam = (WPARAM) 0;</wmisc>
</wparam>
<lparam value="LPVOID">
<lname>fpProc</lname>
<lmisc>fpProc
Pointer to the status callback function, of type capStatusCallback. Specify NULL for this parameter to disable a previously installed status callback function.
</lmisc>
</lparam>
<misc>WM_CAP_SET_CALLBACK_STATUS
The WM_CAP_SET_CALLBACK_STATUS message sets a status callback function in the application. AVICap calls this procedure whenever the capture window status changes. You can send this message explicitly or by using the capSetCallbackOnStatus macro.
WM_CAP_SET_CALLBACK_STATUS
wParam = (WPARAM) 0;
lParam = (LPARAM) (LPVOID) (fpProc);
Parameters
fpProc
Pointer to the status callback function, of type capStatusCallback. Specify NULL for this parameter to disable a previously installed status callback function.
Return Values
Returns TRUE if successful or FALSE if streaming capture or a single-frame capture session is in progress.
Remarks
Applications can optionally set a status callback function. If set, AVICap calls this procedure in the following situations:
* A capture session is completed.
* A capture driver successfully connected to a capture window.
* An optimal palette is created.
* The number of captured frames is reported.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.
Unicode: Declared as Unicode and ANSI messages.</misc>
</message>
<message value="0x406">
<name>WM_CAP_SET_CALLBACK_VIDEOSTREAM</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE if streaming capture or a single-frame capture session is in progress.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam = (WPARAM) 0; </wmisc>
</wparam>
<lparam value="LPVOID">
<lname>fpProc</lname>
<lmisc>fpProc
Pointer to the video-stream callback function, of type capVideoStreamCallback. Specify NULL for this parameter to disable a previously installed video-stream callback function.
</lmisc>
</lparam>
<misc>WM_CAP_SET_CALLBACK_VIDEOSTREAM
The WM_CAP_SET_CALLBACK_VIDEOSTREAM message sets a callback function in the application. AVICap calls this procedure during streaming capture when a video buffer is filled. You can send this message explicitly or by using the capSetCallbackOnVideoStream macro.
WM_CAP_SET_CALLBACK_VIDEOSTREAM
wParam = (WPARAM) 0;
lParam = (LPARAM) (LPVOID) (fpProc);
Parameters
fpProc
Pointer to the video-stream callback function, of type capVideoStreamCallback. Specify NULL for this parameter to disable a previously installed video-stream callback function.
Return Values
Returns TRUE if successful or FALSE if streaming capture or a single-frame capture session is in progress.
Remarks
The capture window calls the callback function before writing the captured frame to disk. This allows applications to modify the frame if desired.
If a video stream callback function is used for streaming capture, the procedure must be installed before starting the capture session and it must remain enabled for the duration of the session. It can be disabled after streaming capture ends.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.</misc>
</message>
<message value="0x407">
<name>WM_CAP_SET_CALLBACK_WAVESTREAM</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE if streaming capture or a single-frame capture session is in progress.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam = (WPARAM) 0; </wmisc>
</wparam>
<lparam value="">
<lname>fpProc</lname>
<lmisc>fpProc
Pointer to the wave stream callback function, of type capWaveStreamCallback. Specify NULL for this parameter to disable a previously installed wave stream callback function.
</lmisc>
</lparam>
<misc>WM_CAP_SET_CALLBACK_WAVESTREAM
The WM_CAP_SET_CALLBACK_WAVESTREAM message sets a callback function in the application. AVICap calls this procedure during streaming capture when a new audio buffer becomes available. You can send this message explicitly or by using the capSetCallbackOnWaveStream macro.
WM_CAP_SET_CALLBACK_WAVESTREAM
wParam = (WPARAM) 0;
lParam = (LPARAM) (LPVOID) (fpProc);
Parameters
fpProc
Pointer to the wave stream callback function, of type capWaveStreamCallback. Specify NULL for this parameter to disable a previously installed wave stream callback function.
Return Values
Returns TRUE if successful or FALSE if streaming capture or a single-frame capture session is in progress.
Remarks
The capture window calls the procedure before writing the audio buffer to disk. This allows applications to modify the audio buffer if desired.
If a wave stream callback function is used, it must be installed before starting the capture session and it must remain enabled for the duration of the session. It can be disabled after streaming capture ends.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.</misc>
</message>
<message value="0x404">
<name>WM_CAP_SET_CALLBACK_YIELD</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE if streaming capture or a single-frame capture session is in progress.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam = (WPARAM) 0; </wmisc>
</wparam>
<lparam value="LPVOID">
<lname>fpProc</lname>
<lmisc>fpProc
Pointer to the yield callback function, of type capYieldCallback. Specify NULL for this parameter to disable a previously installed yield callback function.
</lmisc>
</lparam>
<misc>WM_CAP_SET_CALLBACK_YIELD
The WM_CAP_SET_CALLBACK_YIELD message sets a callback function in the application. AVICap calls this procedure when the capture window yields during streaming capture. You can send this message explicitly or by using the capSetCallbackOnYield macro.
WM_CAP_SET_CALLBACK_YIELD
wParam = (WPARAM) 0;
lParam = (LPARAM) (LPVOID) (fpProc);
Parameters
fpProc
Pointer to the yield callback function, of type capYieldCallback. Specify NULL for this parameter to disable a previously installed yield callback function.
Return Values
Returns TRUE if successful or FALSE if streaming capture or a single-frame capture session is in progress.
Remarks
Applications can optionally set a yield callback function. The yield callback function is called at least once for each video frame captured during streaming capture. If a yield callback function is installed, it will be called regardless of the state of the fYield member of the CAPTUREPARMS structure.
If the yield callback function is used, it must be installed before starting the capture session and it must remain enabled for the duration of the session. It can be disabled after streaming capture ends.
Applications typically perform some type of message processing in the callback function consisting of a PeekMessage, TranslateMessage, DispatchMessage loop, as in the message loop of a WinMain function. The yield callback function must also filter and remove messages that can cause reentrancy problems.
An application typically returns TRUE in the yield procedure to continue streaming capture. If a yield callback function returns FALSE, the capture window stops the capture process.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.</misc>
</message>
<message value="0x442">
<name>WM_CAP_SET_MCI_DEVICEA</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE otherwise.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam = (WPARAM) 0; </wmisc>
</wparam>
<lparam value="LPSTR">
<lname>szName</lname>
<lmisc>szName
Pointer to a null-terminated string containing the name of the device.</lmisc>
</lparam>
<misc>WM_CAP_SET_MCI_DEVICE
The WM_CAP_SET_MCI_DEVICE message specifies the name of the MCI video device to be used to capture data. You can send this message explicitly or by using the capSetMCIDeviceName macro.
WM_CAP_SET_MCI_DEVICE
wParam = (WPARAM) 0;
lParam = (LPARAM) (LPVOID) (LPSTR) (szName);
Parameters
szName
Pointer to a null-terminated string containing the name of the device.
Return Values
Returns TRUE if successful or FALSE otherwise.
Remarks
This message stores the MCI device name in an internal structure. It does not open or access the device. The default device name is NULL.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.
Unicode: Declared as Unicode and ANSI messages.</misc>
</message>
<message value="0x4a6">
<name>WM_CAP_SET_MCI_DEVICEW</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE otherwise.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam = (WPARAM) 0; </wmisc>
</wparam>
<lparam value="LPSTR">
<lname>szName</lname>
<lmisc>szName
Pointer to a null-terminated string containing the name of the device.</lmisc>
</lparam>
<misc>WM_CAP_SET_MCI_DEVICE
The WM_CAP_SET_MCI_DEVICE message specifies the name of the MCI video device to be used to capture data. You can send this message explicitly or by using the capSetMCIDeviceName macro.
WM_CAP_SET_MCI_DEVICE
wParam = (WPARAM) 0;
lParam = (LPARAM) (LPVOID) (LPSTR) (szName);
Parameters
szName
Pointer to a null-terminated string containing the name of the device.
Return Values
Returns TRUE if successful or FALSE otherwise.
Remarks
This message stores the MCI device name in an internal structure. It does not open or access the device. The default device name is NULL.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.
Unicode: Declared as Unicode and ANSI messages.</misc>
</message>
<message value="0x433">
<name>WM_CAP_SET_OVERLAY</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE otherwise.</returnmisc>
</return>
<wparam value="BOOL">
<wname>f</wname>
<wmisc>f
Overlay flag. Specify TRUE for this parameter to enable overlay mode or FALSE to disable it.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam = 0L; </lmisc>
</lparam>
<misc>WM_CAP_SET_OVERLAY
The WM_CAP_SET_OVERLAY message enables or disables overlay mode. In overlay mode, video is displayed using hardware overlay. You can send this message explicitly or by using the capOverlay macro.
WM_CAP_SET_OVERLAY
wParam = (WPARAM) (BOOL) (f);
lParam = 0L;
Parameters
f
Overlay flag. Specify TRUE for this parameter to enable overlay mode or FALSE to disable it.
Return Values
Returns TRUE if successful or FALSE otherwise.
Remarks
Using an overlay does not require CPU resources.
The fHasOverlay member of the CAPDRIVERCAPS structure indicates whether the device is capable of overlay. The fOverlayWindow member of the CAPSTATUS structure indicates whether overlay mode is currently enabled.
Enabling overlay mode automatically disables preview mode.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.</misc>
</message>
<message value="0x432">
<name>WM_CAP_SET_PREVIEW</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE otherwise.</returnmisc>
</return>
<wparam value="BOOL">
<wname>f</wname>
<wmisc>f
Preview flag. Specify TRUE for this parameter to enable preview mode or FALSE to disable it.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam = 0L; </lmisc>
</lparam>
<misc>WM_CAP_SET_PREVIEW
The WM_CAP_SET_PREVIEW message enables or disables preview mode. In preview mode, frames are transferred from the capture hardware to system memory and then displayed in the capture window using GDI functions. You can send this message explicitly or by using the capPreview macro.
WM_CAP_SET_PREVIEW
wParam = (WPARAM) (BOOL) (f);
lParam = 0L;
Parameters
f
Preview flag. Specify TRUE for this parameter to enable preview mode or FALSE to disable it.
Return Values
Returns TRUE if successful or FALSE otherwise.
Remarks
The preview mode uses substantial CPU resources. Applications can disable preview or lower the preview rate when another application has the focus. The fLiveWindow member of the CAPSTATUS structure indicates if preview mode is currently enabled.
Enabling preview mode automatically disables overlay mode.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.</misc>
</message>
<message value="0x434">
<name>WM_CAP_SET_PREVIEWRATE</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE if the capture window is not connected to a capture driver.
</returnmisc>
</return>
<wparam value="">
<wname>wMS</wname>
<wmisc>wMS
Rate, in milliseconds, at which new frames are captured and displayed.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam = 0L; </lmisc>
</lparam>
<misc>WM_CAP_SET_PREVIEWRATE
The WM_CAP_SET_PREVIEWRATE message sets the frame display rate in preview mode. You can send this message explicitly or by using the capPreviewRate macro.
WM_CAP_SET_PREVIEWRATE
wParam = (WPARAM) (wMS);
lParam = 0L;
Parameters
wMS
Rate, in milliseconds, at which new frames are captured and displayed.
Return Values
Returns TRUE if successful or FALSE if the capture window is not connected to a capture driver.
Remarks
The preview mode uses substantial CPU resources. Applications can disable preview or lower the preview rate when another application has the focus. During streaming video capture, the previewing task is lower priority than writing frames to disk, and preview frames are displayed only if no other buffers are available for writing.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.</misc>
</message>
<message value="0x435">
<name>WM_CAP_SET_SCALE</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE otherwise.
</returnmisc>
</return>
<wparam value="BOOL">
<wname>f</wname>
<wmisc>f
Preview scaling flag. Specify TRUE for this parameter to stretch preview frames to the size of the capture window or FALSE to display them at their natural size.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam = 0L; </lmisc>
</lparam>
<misc>WM_CAP_SET_SCALE
The WM_CAP_SET_SCALE message enables or disables scaling of the preview video images. If scaling is enabled, the captured video frame is stretched to the dimensions of the capture window. You can send this message explicitly or by using the capPreviewScale macro.
WM_CAP_SET_SCALE
wParam = (WPARAM) (BOOL)f;
lParam = 0L;
Parameters
f
Preview scaling flag. Specify TRUE for this parameter to stretch preview frames to the size of the capture window or FALSE to display them at their natural size.
Return Values
Returns TRUE if successful or FALSE otherwise.
Remarks
Scaling preview images controls the immediate presentation of captured frames within the capture window. It has no effect on the size of the frames saved to file.
Scaling has no effect when using overlay to display video in the frame buffer.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.</misc>
</message>
<message value="0x437">
<name>WM_CAP_SET_SCROLL</name>
<return value="LPPOINT">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE otherwise.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam = (WPARAM) 0; </wmisc>
</wparam>
<lparam value="">
<lname>lpP</lname>
<lmisc>lpP
Address to contain the desired scroll position.</lmisc>
</lparam>
<misc>WM_CAP_SET_SCROLL
The WM_CAP_SET_SCROLL message defines the portion of the video frame to display in the capture window. This message sets the upper left corner of the client area of the capture window to the coordinates of a specified pixel within the video frame. You can send this message explicitly or by using the capSetScrollPos macro.
WM_CAP_SET_SCROLL
wParam = (WPARAM) 0;
lParam = (LPARAM) (LPPOINT) (lpP);
Parameters
lpP
Address to contain the desired scroll position.
Return Values
Returns TRUE if successful or FALSE otherwise.
Remarks
The scroll position affects the image in both preview and overlay modes.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.</misc>
</message>
<message value="0x440">
<name>WM_CAP_SET_SEQUENCE_SETUP</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE otherwise.</returnmisc>
</return>
<wparam value="">
<wname>wSize</wname>
<wmisc>wSize
Size, in bytes, of the structure referenced by s.
</wmisc>
</wparam>
<lparam value="LPCAPTUREPARMS">
<lname>psCapParms</lname>
<lmisc>psCapParms
Pointer to a CAPTUREPARMS structure.</lmisc>
</lparam>
<misc>WM_CAP_SET_SEQUENCE_SETUP
The WM_CAP_SET_SEQUENCE_SETUP message sets the configuration parameters used with streaming capture. You can send this message explicitly or by using the capCaptureSetSetup macro.
WM_CAP_SET_SEQUENCE_SETUP
wParam = (WPARAM) (wSize);
lParam = (LPARAM) (LPVOID) (LPCAPTUREPARMS) (psCapParms);
Parameters
wSize
Size, in bytes, of the structure referenced by s.
psCapParms
Pointer to a CAPTUREPARMS structure.
Return Values
Returns TRUE if successful or FALSE otherwise.
Remarks
For information about the parameters used to control streaming capture, see the CAPTUREPARMS structure.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.</misc>
</message>
<message value="0x409">
<name>WM_CAP_SET_USER_DATA</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE if streaming capture is in progress.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam = (WPARAM) 0; </wmisc>
</wparam>
<lparam value="">
<lname>lUser</lname>
<lmisc>lUser
Data value to associate with a capture window.</lmisc>
</lparam>
<misc>WM_CAP_SET_USER_DATA
The WM_CAP_SET_USER_DATA message associates a LONG data value with a capture window. You can send this message explicitly or by using the capSetUserData macro.
WM_CAP_SET_USER_DATA
wParam = (WPARAM) 0;
lParam = (LPARAM)lUser;
Parameters
lUser
Data value to associate with a capture window.
Return Values
Returns TRUE if successful or FALSE if streaming capture is in progress.
Remarks
Typically this message is used to point to a block of data associated with a capture window.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.</misc>
</message>
<message value="0x42d">
<name>WM_CAP_SET_VIDEOFORMAT</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE otherwise.</returnmisc>
</return>
<wparam value="">
<wname>wSize</wname>
<wmisc>wSize
Size, in bytes, of the structure referenced by s.</wmisc>
</wparam>
<lparam value="BITMAPINFO">
<lname>psVideoFormat</lname>
<lmisc>psVideoFormat
Pointer to a BITMAPINFO structure.</lmisc>
</lparam>
<misc>WM_CAP_SET_VIDEOFORMAT
The WM_CAP_SET_VIDEOFORMAT message sets the format of captured video data. You can send this message explicitly or by using the capSetVideoFormat macro.
WM_CAP_SET_VIDEOFORMAT
wParam = (WPARAM) (wSize);
lParam = (LPARAM) (LPVOID) (psVideoFormat);
Parameters
wSize
Size, in bytes, of the structure referenced by s.
psVideoFormat
Pointer to a BITMAPINFO structure.
Return Values
Returns TRUE if successful or FALSE otherwise.
Remarks
Because video formats are device-specific, applications should check the return value from this function to determine if the format is accepted by the driver.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.</misc>
</message>
<message value="0x448">
<name>WM_CAP_SINGLE_FRAME</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE otherwise.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam = (WPARAM) 0; </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam = 0L; </lmisc>
</lparam>
<misc>WM_CAP_SINGLE_FRAME
The WM_CAP_SINGLE_FRAME message appends a single frame to a capture file that was opened using the WM_CAP_SINGLE_FRAME_OPEN message. You can send this message explicitly or by using the capCaptureSingleFrame macro.
WM_CAP_SINGLE_FRAME
wParam = (WPARAM) 0;
lParam = 0L;
Return Values
Returns TRUE if successful or FALSE otherwise.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.</misc>
</message>
<message value="0x447">
<name>WM_CAP_SINGLE_FRAME_CLOSE</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE otherwise.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam = (WPARAM) 0; </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam = 0L; </lmisc>
</lparam>
<misc>WM_CAP_SINGLE_FRAME_CLOSE
The WM_CAP_SINGLE_FRAME_CLOSE message closes the capture file opened by the WM_CAP_SINGLE_FRAME_OPEN message. You can send this message explicitly or by using the capCaptureSingleFrameClose macro.
WM_CAP_SINGLE_FRAME_CLOSE
wParam = (WPARAM) 0;
lParam = 0L;
Return Values
Returns TRUE if successful or FALSE otherwise.
Remarks
For information about installing callback functions, see the WM_CAP_SET_CALLBACK_ERROR and WM_CAP_SET_CALLBACK_FRAME messages.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.</misc>
</message>
<message value="0x446">
<name>WM_CAP_SINGLE_FRAME_OPEN</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Values
Returns TRUE if successful or FALSE otherwise.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam = (WPARAM) 0; </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam = 0L; </lmisc>
</lparam>
<misc>WM_CAP_SINGLE_FRAME_OPEN
The WM_CAP_SINGLE_FRAME_OPEN message opens the capture file for single-frame capturing. Any previous information in the capture file is overwritten. You can send this message explicitly or by using the capCaptureSingleFrameOpen macro.
WM_CAP_SINGLE_FRAME_OPEN
wParam = (WPARAM) 0;
lParam = 0L;
Return Values
Returns TRUE if successful or FALSE otherwise.
Remarks
For information about installing callback functions, see the WM_CAP_SET_CALLBACK_ERROR and WM_CAP_SET_CALLBACK_FRAME messages.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Vfw.h.</misc>
</message>
<message value="400">
<name>WM_CAP_START</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x444">
<name>WM_CAP_STOP</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x451">
<name>WM_CAP_UNICODE_END</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x464">
<name>WM_CAP_UNICODE_START</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x215">
<name>WM_CAPTURECHANGED</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Handle to the window gaining the mouse capture.</lmisc>
</lparam>
<misc>WM_CAPTURECHANGED Notification
The WM_CAPTURECHANGED message is sent to the window that is losing the mouse capture.
A window receives this message through its WindowProc function.
Syntax
WM_CAPTURECHANGED
WPARAM wParam
LPARAM lParam;
Parameters
wParam
This parameter is not used.
lParam
Handle to the window gaining the mouse capture.
Return Value
Remarks
A window receives this message even if it calls ReleaseCapture itself. An application should not attempt to set the mouse capture in response to this message.
When it receives this message, a window should redraw itself, if necessary, to reflect the new mouse-capture state.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0x30D">
<name>WM_CHANGECBCHAIN</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
If an application processes this message, it should return zero. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Handle to the window being removed from the clipboard viewer chain. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Handle to the next window in the chain following the window being removed. This parameter is NULL if the window being removed is the last window in the chain.
</lmisc>
</lparam>
<misc>WM_CHANGECBCHAIN Notification
The WM_CHANGECBCHAIN message is sent to the first window in the clipboard viewer chain when a window is being removed from the chain.
A window receives this message through its WindowProc function.
Syntax
WM_CHANGECBCHAIN
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Handle to the window being removed from the clipboard viewer chain.
lParam
Handle to the next window in the chain following the window being removed. This parameter is NULL if the window being removed is the last window in the chain.
Return Value
If an application processes this message, it should return zero.
Remarks
Each clipboard viewer window saves the handle to the next window in the clipboard viewer chain. Initially, this handle is the return value of the SetClipboardViewer function.
When a clipboard viewer window receives the WM_CHANGECBCHAIN message, it should call the SendMessage function to pass the message to the next window in the chain, unless the next window is the window being removed. In this case, the clipboard viewer should save the handle specified by the lParam parameter as the next window in the chain.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x127">
<name>WM_CHANGEUISTATE</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
No return value.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
The low-order word specifies the action to be taken. This member can be one of the following values.
UIS_CLEAR
The UI state flags specified by the high-order word should be cleared.
UIS_INITIALIZE
The UI state flags specified by the high-order word should be changed based on the last input event. For more information, see Remarks.
UIS_SET
The UI state flags specified by the high-order word should be set.
The high-order word specifies which UI state elements are affected or the style of the control. This member can be one or more of the following values.
UISF_HIDEACCEL
Keyboard accelerators are hidden.
UISF_HIDEFOCUS
Focus indicators are hidden.
UISF_ACTIVE
Windows XP: A control should be drawn in the style used for active controls.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used. Must be set to 0.</lmisc>
</lparam>
<misc>WM_CHANGEUISTATE Message
An application sends the WM_CHANGEUISTATE message to indicate that the user interface (UI) state should be changed.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage(
(HWND) hWndControl, // handle to destination control
(UINT) WM_CHANGEUISTATE, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
The low-order word specifies the action to be taken. This member can be one of the following values.
UIS_CLEAR
The UI state flags specified by the high-order word should be cleared.
UIS_INITIALIZE
The UI state flags specified by the high-order word should be changed based on the last input event. For more information, see Remarks.
UIS_SET
The UI state flags specified by the high-order word should be set.
The high-order word specifies which UI state elements are affected or the style of the control. This member can be one or more of the following values.
UISF_HIDEACCEL
Keyboard accelerators are hidden.
UISF_HIDEFOCUS
Focus indicators are hidden.
UISF_ACTIVE
Windows XP: A control should be drawn in the style used for active controls.
lParam
Not used. Must be set to 0.
Return Value
No return value.
Remarks
A window should send this message to itself or its parent when it must change the UI state elements of all windows in the same hierarchy. The window procedure must let DefWindowProc process this message so that the entire window tree has a consistent UI state. When the top-level window receives the WM_CHANGEUISTATE message, it sends a WM_UPDATEUISTATE message with the same parameters to all child windows. When the system processes the WM_UPDATEUISTATE message, it makes the change in the UI state.
If the low-order word of wParam is UIS_INITIALIZE, the system will send the WM_UPDATEUISTATE message with a UI state based on the last input event. For example, if the last input came from the mouse, the system will hide the keyboard cues. And, if the last input came from the keyboard, the system will show the keyboard cues. If the state that results from processing WM_CHANGEUISTATE is the same as the old state, DefWindowProc does not send this message.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 2000</misc>
</message>
<message value="0x102">
<name>WM_CHAR</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
An application should return zero if it processes this message.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the character code of the key. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Specifies the repeat count, scan code, extended-key flag, context code, previous key-state flag, and transition-state flag, as shown in the following table.
0-15
Specifies the repeat count for the current message. The value is the number of times the keystroke is autorepeated as a result of the user holding down the key. If the keystroke is held long enough, multiple messages are sent. However, the repeat count is not cumulative.
16-23
Specifies the scan code. The value depends on the OEM.
24
Specifies whether the key is an extended key, such as the right-hand ALT and CTRL keys that appear on an enhanced 101- or 102-key keyboard. The value is 1 if it is an extended key; otherwise, it is 0.
25-28
Reserved; do not use.
29
Specifies the context code. The value is 1 if the ALT key is held down while the key is pressed; otherwise, the value is 0.
30
Specifies the previous key state. The value is 1 if the key is down before the message is sent, or it is 0 if the key is up.
31
Specifies the transition state. The value is 1 if the key is being released, or it is 0 if the key is being pressed.
</lmisc>
</lparam>
<misc>WM_CHAR Notification
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.
Syntax
WM_CHAR
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Specifies the character code of the key.
lParam
Specifies the repeat count, scan code, extended-key flag, context code, previous key-state flag, and transition-state flag, as shown in the following table.
0-15
Specifies the repeat count for the current message. The value is the number of times the keystroke is autorepeated as a result of the user holding down the key. If the keystroke is held long enough, multiple messages are sent. However, the repeat count is not cumulative.
16-23
Specifies the scan code. The value depends on the OEM.
24
Specifies whether the key is an extended key, such as the right-hand ALT and CTRL keys that appear on an enhanced 101- or 102-key keyboard. The value is 1 if it is an extended key; otherwise, it is 0.
25-28
Reserved; do not use.
29
Specifies the context code. The value is 1 if the ALT key is held down while the key is pressed; otherwise, the value is 0.
30
Specifies the previous key state. The value is 1 if the key is down before the message is sent, or it is 0 if the key is up.
31
Specifies the transition state. The value is 1 if the key is being released, or it is 0 if the key is being pressed.
Return Value
An application should return zero if it processes this message.
Remarks
The WM_CHAR message uses Unicode Transformation Format (UTF)-16.
Because there is not necessarily a one-to-one correspondence between keys pressed and character messages generated, the information in the high-order word of the lParam parameter is generally not useful to applications. The information in the high-order word applies only to the most recent WM_KEYDOWN message that precedes the posting of the WM_CHAR message.
For enhanced 101- and 102-key keyboards, extended keys are the right ALT and the right CTRL keys on the main section of the keyboard; the INS, DEL, HOME, END, PAGE UP, PAGE DOWN and arrow keys in the clusters to the left of the numeric keypad; and the divide (/) and ENTER keys in the numeric keypad. Some other keyboards may support the extended-key bit in the lParam parameter.
Windows XP: The WM_UNICHAR message is the same as WM_CHAR, except it uses UTF-32. It is designed to send or post Unicode characters to ANSI windows, and it can handle Unicode Supplementary Plane characters.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x2F">
<name>WM_CHARTOITEM</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
The low-order word specifies the value of the key the user pressed. The high-order word specifies the current position of the caret.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Handle to the list box. </lmisc>
</lparam>
<misc>WM_CHARTOITEM Notification
Sent by a list box with the LBS_WANTKEYBOARDINPUT style to its owner in response to a WM_CHAR message.
Syntax
WM_CHARTOITEM
WPARAM wParam
LPARAM lParam;
Parameters
wParam
The low-order word specifies the value of the key the user pressed. The high-order word specifies the current position of the caret.
lParam
Handle to the list box.
Return Value
Remarks
The DefWindowProc function returns 1.
Only owner-drawn list boxes that do not have the LBS_HASSTRINGS style can receive this message.
If a dialog box procedure handles this message, it should cast the desired return value to a BOOL and return the value directly. The DWL_MSGRESULT value set by the SetWindowLong function is ignored.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x22">
<name>WM_CHILDACTIVATE</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used.</lmisc>
</lparam>
<misc>WM_CHILDACTIVATE Notification
The WM_CHILDACTIVATE message is sent to a child window when the user clicks the window's title bar or when the window is activated, moved, or sized.
A window receives this message through its WindowProc function.
Syntax
WM_CHILDACTIVATE
WPARAM wParam
LPARAM lParam;
Parameters
wParam
This parameter is not used.
lParam
This parameter is not used.
Return Value
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x401">
<name>WM_CHOOSEFONT_GETLOGFONT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
This message does not return a value. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used. </wmisc>
</wparam>
<lparam value="LOGFONT">
<lname>lParam</lname>
<lmisc>lParam
Pointer to a LOGFONT structure that receives information about the user's current font selections. </lmisc>
</lparam>
<misc>WM_CHOOSEFONT_GETLOGFONT Message
An application sends the WM_CHOOSEFONT_GETLOGFONT message to a Font dialog box to retrieve information about the user's current font selections.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) WM_CHOOSEFONT_GETLOGFONT, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
This parameter is not used.
lParam
Pointer to a LOGFONT structure that receives information about the user's current font selections.
Return Value
This message does not return a value.
Remarks
The ChooseFont function creates a Font dialog box. When the user closes the Font dialog box, the ChooseFont function returns information about the user's font selections in the CHOOSEFONT structure. The lpLogFont member of the CHOOSEFONT structure is a pointer to a LOGFONT structure.
Use the WM_CHOOSEFONT_GETLOGFONT message to get information about the user's current font selections while the Font dialog box is open. For example, if you enable the Apply button in the Font dialog box, send the message to get the font information to apply to the current text selection.
Typically, you enable a CFHookProc hook procedure to process WM_COMMAND messages for the Apply button. When the user clicks the Apply button, the hook procedure sends the WM_CHOOSEFONT_GETLOGFONT message to the dialog box.
Message Information
Header Declared in Commdlg.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x466">
<name>WM_CHOOSEFONT_SETFLAGS</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
No return value.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used. </wmisc>
</wparam>
<lparam value="CHOOSEFONT">
<lname>lParam</lname>
<lmisc>lParam
Pointer to a CHOOSEFONT structure that contains new settings in the Flags member. </lmisc>
</lparam>
<misc>WM_CHOOSEFONT_SETFLAGS Message
An application sends the WM_CHOOSEFONT_SETFLAGS message to a Font dialog box to set the display options for the dialog box.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) WM_CHOOSEFONT_SETFLAGS, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
This parameter is not used.
lParam
Pointer to a CHOOSEFONT structure that contains new settings in the Flags member.
Return Value
No return value.
Remarks
The ChooseFont function creates a Font dialog box and uses a CHOOSEFONT structure to specify the initial values for the Flags member. Use the WM_CHOOSEFONT_SETFLAGS message to specify different values for the Flags member while the Font dialog box is open.
Typically, you should send the WM_CHOOSEFONT_SETFLAGS message from a CFHookProc hook procedure.
Message Information
Header Declared in Commdlg.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.51</misc>
</message>
<message value="0x465">
<name>WM_CHOOSEFONT_SETLOGFONT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
This message has no return value. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used. </wmisc>
</wparam>
<lparam value="LOGFONT">
<lname>lParam</lname>
<lmisc>lParam
Pointer to a LOGFONT structure that contains information about the current logical font. </lmisc>
</lparam>
<misc>WM_CHOOSEFONT_SETLOGFONT Message
An application sends the WM_CHOOSEFONT_SETLOGFONT message to a Font dialog box to set the current logical font information.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) WM_CHOOSEFONT_SETLOGFONT, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
This parameter is not used.
lParam
Pointer to a LOGFONT structure that contains information about the current logical font.
Return Value
This message has no return value.
Remarks
When you call the ChooseFont function to create a Font dialog box, you can use the lpLogFont member of the CHOOSEFONT structure to specify a LOGFONT structure containing initial values for the dialog box. Use the WM_CHOOSEFONT_SETLOGFONT message to specify a LOGFONT structure with different values while the Font dialog box is open.
Typically, you would send the WM_CHOOSEFONT_SETLOGFONT message from a CFHookProc hook procedure. The hook procedure can also send the WM_CHOOSEFONT_GETLOGFONT and WM_CHOOSEFONT_SETFLAGS messages.
Message Information
Header Declared in Commdlg.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.51</misc>
</message>
<message value="0x303">
<name>WM_CLEAR</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
This message does not return a value. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used; must be zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used; must be zero. </lmisc>
</lparam>
<misc>WM_CLEAR Message
An application sends a WM_CLEAR message to an edit control or combo box to delete (clear) the current selection, if any, from the edit control.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) WM_CLEAR, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
This message does not return a value.
Remarks
The deletion performed by the WM_CLEAR message can be undone by sending the edit control an EM_UNDO message.
To delete the current selection and place the deleted content on the clipboard, use the WM_CUT message.
When sent to a combo box, the WM_CLEAR message is handled by its edit control. This message has no effect when sent to a combo box with the CBS_DROPDOWNLIST style.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x10">
<name>WM_CLOSE</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used.</lmisc>
</lparam>
<misc>WM_CLOSE Notification
The WM_CLOSE message is sent as a signal that a window or an application should terminate.
A window receives this message through its WindowProc function.
Syntax
WM_CLOSE
WPARAM wParam
LPARAM lParam;
Parameters
wParam
This parameter is not used.
lParam
This parameter is not used.
Return Value
Remarks
An application can prompt the user for confirmation, prior to destroying a window, by processing the WM_CLOSE message and calling the DestroyWindow function only if the user confirms the choice.
By default, the DefWindowProc function calls the DestroyWindow function to destroy the window.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x111">
<name>WM_COMMAND</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>WPARAM wParam</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>LPARAM lParam;</lmisc>
</lparam>
<misc>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;
Return Value
Remarks
Use of the wParam and lParam parameters are summarized here.
Message Source wParam (high word) wParam (low word) lParam
Menu 0 Menu identifier (IDM_*) 0
Accelerator 1 Accelerator identifier (IDM_*) 0
Control Control-defined notification code Control identifier Handle to the control window
Menus
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.
Accelerators
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.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x44">
<name>WM_COMMNOTIFY</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x41">
<name>WM_COMPACTING</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the ratio of central processing unit (CPU) time currently spent by the system compacting memory to CPU time currently spent by the system performing other operations. For example, 0x8000 represents 50 percent of CPU time spent compacting memory.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used.</lmisc>
</lparam>
<misc>WM_COMPACTING Notification
The WM_COMPACTING message is sent to all top-level windows when the system detects more than 12.5 percent of system time over a 30- to 60-second interval is being spent compacting memory. This indicates that system memory is low.
A window receives this message through its WindowProc function.
Note This message is provided only for compatibility with 16-bit Microsoft Windows-based applications.
Syntax
WM_COMPACTING
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Specifies the ratio of central processing unit (CPU) time currently spent by the system compacting memory to CPU time currently spent by the system performing other operations. For example, 0x8000 represents 50 percent of CPU time spent compacting memory.
lParam
This parameter is not used.
Return Value
Remarks
When an application receives this message, it should free as much memory as possible, taking into account the current level of activity of the application and the total number of applications running on the system.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x39">
<name>WM_COMPAREITEM</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
The return value indicates the relative position of the two items. It may be any of the values shown in the following table.
Value Meaning
-1 Item 1 precedes item 2 in the sorted order.
0 Items 1 and 2 are equivalent in the sorted order.
1 Item 1 follows item 2 in the sorted order.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the identifier of the control that sent the WM_COMPAREITEM message. </wmisc>
</wparam>
<lparam value="COMPAREITEMSTRUCT">
<lname>lpCompareItem</lname>
<lmisc>lpCompareItem
Pointer to a COMPAREITEMSTRUCT structure that contains the identifiers and application-supplied data for two items in the combo or list box.
</lmisc>
</lparam>
<misc>WM_COMPAREITEM Notification
The system sends the WM_COMPAREITEM message to determine the relative position of a new item in the sorted list of an owner-drawn combo box or list box. Whenever the application adds a new item, the system sends this message to the owner of a combo box or list box created with the CBS_SORT or LBS_SORT style.
Syntax
WM_COMPAREITEM
WPARAM wParam
lpCompareItem = (LPCOMPAREITEMSTRUCT) lParam;
Parameters
wParam
Specifies the identifier of the control that sent the WM_COMPAREITEM message.
lpCompareItem
Pointer to a COMPAREITEMSTRUCT structure that contains the identifiers and application-supplied data for two items in the combo or list box.
Return Value
The return value indicates the relative position of the two items. It may be any of the values shown in the following table.
Value Meaning
-1 Item 1 precedes item 2 in the sorted order.
0 Items 1 and 2 are equivalent in the sorted order.
1 Item 1 follows item 2 in the sorted order.
Remarks
When the owner of an owner-drawn combo box or list box receives this message, the owner returns a value indicating which of the items specified by the COMPAREITEMSTRUCT structure will appear before the other. Typically, the system sends this message several times until it determines the exact position for the new item.
If a dialog box procedure handles this message, it should cast the desired return value to a BOOL and return the value directly. The DWL_MSGRESULT value set by the SetWindowLong function is ignored.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x7B">
<name>WM_CONTEXTMENU</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Handle to the window in which the user right-clicked the mouse. This can be a child window of the window receiving the message. For more information about processing this message, see the Remarks section.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
The low-order word specifies the horizontal position of the cursor, in screen coordinates, at the time of the mouse click.
The high-order word specifies the vertical position of the cursor, in screen coordinates, at the time of the mouse click.
</lmisc>
</lparam>
<misc>WM_CONTEXTMENU Notification
The WM_CONTEXTMENU message notifies a window that the user clicked the right mouse button (right-clicked) in the window.
Syntax
WM_CONTEXTMENU
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Handle to the window in which the user right-clicked the mouse. This can be a child window of the window receiving the message. For more information about processing this message, see the Remarks section.
lParam
The low-order word specifies the horizontal position of the cursor, in screen coordinates, at the time of the mouse click.
The high-order word specifies the vertical position of the cursor, in screen coordinates, at the time of the mouse click.
Return Value
Remarks
A window can process this message by displaying a shortcut menu using the TrackPopupMenu or TrackPopupMenuEx functions. To obtain the horizontal and vertical positions, use the following code.
Copy Code
xPos = GET_X_LPARAM(lParam);
yPos = GET_Y_LPARAM(lParam);
If a window does not display a shortcut menu it should pass this message to the DefWindowProc function. If a window is a child window, DefWindowProc sends the message to the parent. Otherwise, DefWindowProc displays a default shortcut menu if the specified position is in the window's caption.
DefWindowProc generates the WM_CONTEXTMENU message when it processes the WM_RBUTTONUP or WM_NCRBUTTONUP message or when the user types SHIFT+F10. The WM_CONTEXTMENU message is also generated when the user presses and releases the VK_APPS key.
If the context menu is generated from the keyboard for example, if the user types SHIFT+F10 then the x- and y-coordinates are -1 and the application should display the context menu at the location of the current selection rather than at (xPos, yPos).
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.51</misc>
</message>
<message value="0x10A">
<name>WM_CONVERTREQUEST</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x108">
<name>WM_CONVERTREQUESTEX</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x10B">
<name>WM_CONVERTRESULT</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x301">
<name>WM_COPY</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
This message does not return a value.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used; must be zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used; must be zero. </lmisc>
</lparam>
<misc>WM_COPY Message
An application sends the WM_COPY message to an edit control or combo box to copy the current selection to the clipboard in CF_TEXT format.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) WM_COPY, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
This message does not return a value.
Remarks
When sent to a combo box, the WM_COPY message is handled by its edit control. This message has no effect when sent to a combo box with the CBS_DROPDOWNLIST style.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x4A">
<name>WM_COPYDATA</name>
<return value="BOOL">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
If the receiving application processes this message, it should return TRUE; otherwise, it should return FALSE. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Handle to the window passing the data. </wmisc>
</wparam>
<lparam value="COPYDATASTRUCT">
<lname>lParam</lname>
<lmisc>lParam
Pointer to a COPYDATASTRUCT structure that contains the data to be passed. </lmisc>
</lparam>
<misc>WM_COPYDATA Message
An application sends the WM_COPYDATA message to pass data to another application.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) WM_COPYDATA, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Handle to the window passing the data.
lParam
Pointer to a COPYDATASTRUCT structure that contains the data to be passed.
Return Value
If the receiving application processes this message, it should return TRUE; otherwise, it should return FALSE.
Remarks
The data being passed must not contain pointers or other references to objects not accessible to the application receiving the data.
While this message is being sent, the referenced data must not be changed by another thread of the sending process.
The receiving application should consider the data read-only. The lParam parameter is valid only during the processing of the message. The receiving application should not free the memory referenced by lParam. If the receiving application must access the data after SendMessage returns, it must copy the data into a local buffer.
For an example, see Using Data Copy.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x7e8">
<name>WM_CPL_LAUNCH</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc>WM_CPL_LAUNCH Message
Not currently supported. </misc>
</message>
<message value="0x7e9">
<name>WM_CPL_LAUNCHED</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc>WM_CPL_LAUNCHED Message
Not currently supported. </misc>
</message>
<message value="0x1">
<name>WM_CREATE</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
If an application processes this message, it should return zero to continue creation of the window. If the application returns 1, the window is destroyed and the CreateWindowEx or CreateWindow function returns a NULL handle.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used.</wmisc>
</wparam>
<lparam value="CREATESTRUCT">
<lname>lParam</lname>
<lmisc>lParam
Pointer to a CREATESTRUCT structure that contains information about the window being created.</lmisc>
</lparam>
<misc>WM_CREATE Notification
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.
A window receives this message through its WindowProc function.
Syntax
WM_CREATE
WPARAM wParam
LPARAM lParam;
Parameters
wParam
This parameter is not used.
lParam
Pointer to a CREATESTRUCT structure that contains information about the window being created.
Return Value
If an application processes this message, it should return zero to continue creation of the window. If the application returns 1, the window is destroyed and the CreateWindowEx or CreateWindow function returns a NULL handle.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x19">
<name>WM_CTLCOLOR</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
If an application processes this message, it returns a handle to a brush. The system uses the brush to paint the background of the control.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
A handle to a display context (DC).</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
A handle to a child window (control).</lmisc>
</lparam>
<misc>WM_CTLCOLOR Message
The WM_CTLCOLOR message is used in 16-bit versions of Windows to change the color scheme of list boxes, the list boxes of combo boxes, message boxes, button controls, edit controls, static controls, and dialog boxes.
Note For information related to this message and 32-bit versions of Windows, see Remarks.
SendMessage(
(HWND) hwnd,
WM_CTLCOLOR ,
(WPARAM) wParam,
(LPARAM) lParam
);
Parameters
hwnd
A handle to destination window.
wParam
A handle to a display context (DC).
lParam
A handle to a child window (control).
Return Value
If an application processes this message, it returns a handle to a brush. The system uses the brush to paint the background of the control.
Remarks
In 32-bit versions of Windows, the WM_CTLCOLOR message has been replaced by more specific notifications. These replacements include the following:
* WM_CTLCOLORBTN
* WM_CTLCOLOREDIT
* WM_CTLCOLORDLG
* WM_CTLCOLORLISTBOX
* WM_CTLCOLORSCROLLBAR
* WM_CTLCOLORSTATIC
Requirements
Header WindowsX.h</misc>
</message>
<message value="0x135">
<name>WM_CTLCOLORBTN</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
A handle to the display context for the button. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
A handle to the button.</lmisc>
</lparam>
<misc>WM_CTLCOLORBTN Notification
The WM_CTLCOLORBTN message is sent to the parent window of a button before drawing the button. The parent window can change the button's text and background colors. However, only owner-drawn buttons respond to the parent window processing this message.
Syntax
WM_CTLCOLORBTN
WPARAM wParam
LPARAM lParam;
Parameters
wParam
A handle to the display context for the button.
lParam
A handle to the button.
Return Value
Remarks
By default, the DefWindowProc function selects the default system colors for the button. Buttons with the BS_PUSHBUTTON, BS_DEFPUSHBUTTON, or BS_PUSHLIKE styles do not use the returned brush. Buttons with these styles are always drawn with the default system colors. Drawing push buttons requires several different brushes-face, highlight, and shadow-but the WM_CTLCOLORBTN message allows only one brush to be returned. To provide a custom appearance for push buttons, use an owner-drawn button.
The WM_CTLCOLORBTN message is never sent between threads. It is sent only within one thread.
The text color of a check box or radio button applies to the box or button, its check mark, and the text. The focus rectangle for these buttons remains the system default color (typically black). The text color of a group box applies to the text but not to the line that defines the box. The text color of a push button applies only to its focus rectangle; it does not affect the color of the text.
If a dialog box procedure handles this message, it should cast the desired return value to a BOOL and return the value directly. If the dialog box procedure returns FALSE, then default message handling is performed. The DWL_MSGRESULT value set by the SetWindowLong function is ignored.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x136">
<name>WM_CTLCOLORDLG</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Handle to the device context for the dialog box. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Handle to the dialog box. </lmisc>
</lparam>
<misc>WM_CTLCOLORDLG Notification
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.
Syntax
WM_CTLCOLORDLG
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Handle to the device context for the dialog box.
lParam
Handle to the dialog box.
Return Value
Remarks
By default, the DefWindowProc function selects the default system colors for the dialog box.
The system does not automatically destroy the returned brush. It is the application's responsibility to destroy the brush when it is no longer needed.
The WM_CTLCOLORDLG message is never sent between threads. It is sent only within one thread.
Note that the WM_CTLCOLORDLG message is sent to the dialog box itself; all of the other WM_CTLCOLOR* messages are sent to the owner of the control.
If a dialog box procedure handles this message, it should cast the desired return value to an INT_PTR and return the value directly. If the dialog box procedure returns FALSE, then default message handling is performed. The DWL_MSGRESULT value set by the SetWindowLong function is ignored.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x133">
<name>WM_CTLCOLOREDIT</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
A handle to the device context for the edit control window. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
A handle to the edit control. </lmisc>
</lparam>
<misc>WM_CTLCOLOREDIT Notification
An edit control that is not read-only or disabled sends the WM_CTLCOLOREDIT message to its parent window when the control is about to be drawn. By responding to this message, the parent window can use the specified device context handle to set the text and background colors of the edit control.
Syntax
WM_CTLCOLOREDIT
WPARAM wParam
LPARAM lParam;
Parameters
wParam
A handle to the device context for the edit control window.
lParam
A handle to the edit control.
Return Value
Remarks
By default, the DefWindowProc function selects the default system colors for the edit control.
Read-only or disabled edit controls do not send the WM_CTLCOLOREDIT message; instead, they send the WM_CTLCOLORSTATIC message.
The WM_CTLCOLOREDIT message is never sent between threads, it is only sent within the same thread.
If a dialog box procedure handles this message, it should cast the desired return value to a BOOL and return the value directly. If the dialog box procedure returns FALSE, then default message handling is performed. The DWL_MSGRESULT value set by the SetWindowLong function is ignored.
Rich Edit: This message is not supported. To set the background color for a rich edit control, use the EM_SETBKGNDCOLOR message.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x134">
<name>WM_CTLCOLORLISTBOX</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Handle to the device context for the list box. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Handle to the list box. </lmisc>
</lparam>
<misc>WM_CTLCOLORLISTBOX Notification
Sent to the parent window of a list box before the system draws the list box. By responding to this message, the parent window can set the text and background colors of the list box by using the specified display device context handle.
Syntax
WM_CTLCOLORLISTBOX
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Handle to the device context for the list box.
lParam
Handle to the list box.
Return Value
Remarks
By default, the DefWindowProc function selects the default system colors for the list box.
The WM_CTLCOLORLISTBOX message is never sent between threads. It is sent only within one thread.
If a dialog box procedure handles this message, it should cast the desired return value to a BOOL and return the value directly. If the dialog box procedure returns FALSE, then default message handling is performed. The DWL_MSGRESULT value set by the SetWindowLong function is ignored.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x132">
<name>WM_CTLCOLORMSGBOX</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x137">
<name>WM_CTLCOLORSCROLLBAR</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
If an application processes this message, it must return the handle to a brush. The system uses the brush to paint the background of the scroll bar control.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Handle to the device context for the scroll bar control. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Handle to the scroll bar.</lmisc>
</lparam>
<misc>WM_CTLCOLORSCROLLBAR Notification
The WM_CTLCOLORSCROLLBAR message is sent to the parent window of a scroll bar control when the control is about to be drawn. By responding to this message, the parent window can use the display context handle to set the background color of the scroll bar control.
A window receives this message through its WindowProc function.
Syntax
WM_CTLCOLORSCROLLBAR
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Handle to the device context for the scroll bar control.
lParam
Handle to the scroll bar.
Return Value
If an application processes this message, it must return the handle to a brush. The system uses the brush to paint the background of the scroll bar control.
Remarks
By default, the DefWindowProc function selects the default system colors for the scroll bar control.
The WM_CTLCOLORSCROLLBAR message is never sent between threads; it is only sent within the same thread.
If a dialog box procedure handles this message, it should cast the desired return value to a BOOL and return the value directly. If the dialog box procedure returns FALSE, then default message handling is performed. The DWL_MSGRESULT value set by the SetWindowLong function is ignored.
The WM_CTLCOLORSCROLLBAR message is used only by child scrollbar controls. Scrollbars attached to a window (WS_SCROLL and WS_VSCROLL) do not generate this message. To customize the appearance of scrollbars attached to a window, use the flat scroll bar functions.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x138">
<name>WM_CTLCOLORSTATIC</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Handle to the device context for the static control window. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Handle to the static control. </lmisc>
</lparam>
<misc>WM_CTLCOLORSTATIC Notification
A static control, or an edit control that is read-only or disabled, sends the WM_CTLCOLORSTATIC message to its parent window when the control is about to be drawn. By responding to this message, the parent window can use the specified device context handle to set the text and background colors of the static control.
A window receives this message through its WindowProc function.
Syntax
WM_CTLCOLORSTATIC
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Handle to the device context for the static control window.
lParam
Handle to the static control.
Return Value
Remarks
By default, the DefWindowProc function selects the default system colors for the static control.
Edit controls that are not read-only or disabled do not send the WM_CTLCOLORSTATIC message; instead, they send the WM_CTLCOLOREDIT message.
The WM_CTLCOLORSTATIC message is never sent between threads; it is sent only within the same thread.
If a dialog box procedure handles this message, it should cast the desired return value to a BOOL and return the value directly. If the dialog box procedure returns FALSE, then default message handling is performed. The DWL_MSGRESULT value set by the SetWindowLong function is ignored.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x300">
<name>WM_CUT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
This message does not return a value. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used; must be zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used; must be zero.</lmisc>
</lparam>
<misc>WM_CUT Message
An application sends a WM_CUT message to an edit control or combo box to delete (cut) the current selection, if any, in the edit control and copy the deleted text to the clipboard in CF_TEXT format.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) WM_CUT, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
This message does not return a value.
Remarks
The deletion performed by the WM_CUT message can be undone by sending the edit control an EM_UNDO message.
To delete the current selection without placing the deleted text on the clipboard, use the WM_CLEAR message.
When sent to a combo box, the WM_CUT message is handled by its edit control. This message has no effect when sent to a combo box with the CBS_DROPDOWNLIST style.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x3E4">
<name>WM_DDE_ACK</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
No return value.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
When responding to WM_DDE_INITIATE, this parameter is a handle to the server window sending the message.
When responding to WM_DDE_EXECUTE, this parameter is a handle to the server window posting the message.
When replying to all other messages, this parameter is a handle to the client or server window posting the message.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
When responding to WM_DDE_INITIATE, the low-order word contains an atom that identifies the replying application. The high-order word contains an atom that identifies the topic for which a conversation is being established.
When responding to WM_DDE_EXECUTE, the low-order word specifies a DDEACK structure containing a series of flags that indicate the status of the response. The high-order word is a handle to a global memory object that contains the command string that was received in the WM_DDE_EXECUTE message.
When replying to all other messages, the low-order word specifies a DDEACK structure containing a series of flags that indicate the status of the response. The high-order word contains a global atom that identifies the name of the data item for which the response is sent.
</lmisc>
</lparam>
<misc>WM_DDE_ACK Notification
The WM_DDE_ACK message notifies a Dynamic Data Exchange (DDE) application of the receipt and processing of the following messages: WM_DDE_POKE, WM_DDE_EXECUTE, WM_DDE_DATA, WM_DDE_ADVISE, WM_DDE_UNADVISE, WM_DDE_INITIATE, or WM_DDE_REQUEST (in some cases).
To post this message, call the PostMessage function with the following parameters.
Syntax
PostMessage(
(HWND) hWnd,
WM_DDE_ACK,
(WPARAM) wParam,
(LPARAM) lParam
);
Parameters
wParam
When responding to WM_DDE_INITIATE, this parameter is a handle to the server window sending the message.
When responding to WM_DDE_EXECUTE, this parameter is a handle to the server window posting the message.
When replying to all other messages, this parameter is a handle to the client or server window posting the message.
lParam
When responding to WM_DDE_INITIATE, the low-order word contains an atom that identifies the replying application. The high-order word contains an atom that identifies the topic for which a conversation is being established.
When responding to WM_DDE_EXECUTE, the low-order word specifies a DDEACK structure containing a series of flags that indicate the status of the response. The high-order word is a handle to a global memory object that contains the command string that was received in the WM_DDE_EXECUTE message.
When replying to all other messages, the low-order word specifies a DDEACK structure containing a series of flags that indicate the status of the response. The high-order word contains a global atom that identifies the name of the data item for which the response is sent.
Return Value
No return value.
Remarks
Posting
Except in response to the WM_DDE_INITIATE message, the application posts the WM_DDE_ACK message by calling the PostMessage function, not by calling the SendMessage function. When responding to WM_DDE_INITIATE, the application sends the WM_DDE_ACK message by calling SendMessage. In this case, neither the application-name atom nor the topic-name atom should be NULL (even if the WM_DDE_INITIATE message specified NULL atoms).
When acknowledging any message with an accompanying atom, the application posting WM_DDE_ACK can either reuse the atom that accompanied the original message, or it can delete it and create a new one.
When acknowledging WM_DDE_EXECUTE, the application that posts WM_DDE_ACK should reuse the global memory object identified in the original WM_DDE_EXECUTE message.
All posted WM_DDE_ACK messages must create or reuse the lParam parameter by calling the PackDDElParam function or the ReuseDDElParam function.
If an application has initiated the termination of a conversation by posting WM_DDE_TERMINATE and is awaiting confirmation, the waiting application should not acknowledge (positively or negatively) any subsequent messages sent by the other application. The waiting application should delete any atoms or shared memory objects received in these intervening messages. Memory objects should not be freed if the fRelease flag is set to FALSE in WM_DDE_POKE and WM_DDE_DATA messages.
Receiving
The application that receives a WM_DDE_ACK message should delete all atoms accompanying the message. If the application receives a WM_DDE_ACK in response to a message with an accompanying global memory object, and the object was sent with the fRelease flags set to FALSE, the application is responsible for deleting the object.
If the application receives a negative WM_DDE_ACK message posted in reply to a WM_DDE_ADVISE message, the application should delete the global memory object posted with the original WM_DDE_ADVISE message. If the application receives a negative WM_DDE_ACK message posted in reply to a WM_DDE_DATA, WM_DDE_POKE, or WM_DDE_EXECUTE message, the application should delete the global memory object posted with the original WM_DDE_DATA, WM_DDE_POKE, or WM_DDE_EXECUTE message.
The application that receives a posted WM_DDE_ACK message must free the lParam parameter by using the FreeDDElParam function.
Notification Requirements
Minimum DLL Version None
Header Declared in Dde.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1
See Also</misc>
</message>
<message value="0x3E2">
<name>WM_DDE_ADVISE</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
No return value.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Handle to the client window posting the message. </wmisc>
</wparam>
<lparam value="">
<lname>lpDdeAdvise</lname>
<lmisc>lpDdeAdvise
The low-order word is a handle to a global memory object containing a DDEADVISE structure that specifies how the data is to be sent.
The high-order word contains an atom that identifies the requested data item. </lmisc>
</lparam>
<misc>WM_DDE_ADVISE Notification
A Dynamic Data Exchange (DDE) client application posts the WM_DDE_ADVISE message to a DDE server application to request the server to supply an update for a data item whenever the item changes.
To post this message, call the PostMessage function with the following parameters.
Syntax
PostMessage(
(HWND) hWnd,
WM_DDE_ADVISE,
(WPARAM) wParam,
(LPARAM) lParam
);
Parameters
wParam
Handle to the client window posting the message.
lpDdeAdvise
The low-order word is a handle to a global memory object containing a DDEADVISE structure that specifies how the data is to be sent.
The high-order word contains an atom that identifies the requested data item.
Return Value
No return value.
Remarks
If a client application supports more than one clipboard format for a single topic and item, it can post multiple WM_DDE_ADVISE messages for the topic and item, specifying a different clipboard format with each message. Note that a server can support multiple formats only for hot data links, not warm data links.
Posting
The client application posts the WM_DDE_ADVISE message by calling the PostMessage function, not the SendMessage function.
The client application allocates the global memory object using the GlobalAlloc function. It allocates the atom using the GlobalAddAtom function.
The client application must create or reuse the WM_DDE_ADVISE lpDdeAdvise parameter by calling the PackDDElParam function or the ReuseDDElParam function.
If the receiving (server) application responds with a negative WM_DDE_ACK message, the posting application must delete the object.
The fRelease flag is not used in WM_DDE_ADVISE messages, but their data-freeing behavior is similar to that of WM_DDE_DATA and WM_DDE_POKE messages where fRelease is TRUE.
Receiving
The server application posts the WM_DDE_ACK message to respond positively or negatively. When posting WM_DDE_ACK, the application can reuse the atom or delete it and create a new one. If the WM_DDE_ACK message is positive, the application should delete the global memory object; otherwise, the application should not delete the object.
The server must create or reuse the WM_DDE_ACK lParam parameter by calling the PackDDElParam function or the ReuseDDElParam function.
Notification Requirements
Minimum DLL Version None
Header Declared in Dde.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x3E5">
<name>WM_DDE_DATA</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
No return value.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Handle to the server window posting the message. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
The low-order word is a handle to a global memory object containing a DDEDATA structure with the data and additional information. The handle should be set to NULL if the server is notifying the client that the data-item value has changed during a warm data link. A warm link is established by the client sending a WM_DDE_ADVISE message with the fDeferUpd bit set.
The high-order word contains an atom that identifies the data item for which the data or notification is sent.
</lmisc>
</lparam>
<misc>WM_DDE_DATA Notification
A Dynamic Data Exchange (DDE) server application posts a WM_DDE_DATA message to a DDE client application to pass a data item to the client or to notify the client of the availability of a data item.
To post this message, call the PostMessage function with the following parameters.
Syntax
PostMessage(
(HWND) hWnd,
WM_DDE_DATA,
(WPARAM) wParam,
(LPARAM) lParam
);
Parameters
wParam
Handle to the server window posting the message.
lParam
The low-order word is a handle to a global memory object containing a DDEDATA structure with the data and additional information. The handle should be set to NULL if the server is notifying the client that the data-item value has changed during a warm data link. A warm link is established by the client sending a WM_DDE_ADVISE message with the fDeferUpd bit set.
The high-order word contains an atom that identifies the data item for which the data or notification is sent.
Return Value
No return value.
Remarks
Posting
The server application allocates the global memory object using the GlobalAlloc function. It allocates the atom using the GlobalAddAtom function.
The server must create or reuse the WM_DDE_DATA lParam parameter by calling the PackDDElParam function or the ReuseDDElParam function.
If the receiving (client) application responds with a negative WM_DDE_ACK message, the posting (server) application must delete the global memory object; otherwise, the client must delete the object after extracting its contents by calling the UnpackDDElParam function.
If the server application sets the fRelease member of the DDEDATA structure to FALSE, the server is responsible for deleting the object upon receiving either a positive or negative acknowledgment.
The server application should not set both the fAckReq and fRelease members of the DDEDATA structure to FALSE. If both members are set to FALSE, it is impossible for the server to determine when to delete the object.
Receiving
If fAckReq is TRUE, the client application should post the WM_DDE_ACK message to respond positively or negatively. When posting WM_DDE_ACK, the client can either reuse the atom, or it can delete it and create a new one.
The client must create or reuse the WM_DDE_ACK lParam parameter by calling the PackDDElParam function or the ReuseDDElParam function.
If fAckReq is FALSE, the client application should delete the atom.
If the posting application specified global memory object as NULL, the receiving application can request the server to send the data by posting a WM_DDE_REQUEST message.
After processing a WM_DDE_DATA message in which the global memory object is not NULL, the client should free the object, unless one of the following conditions is true:
* The fRelease member is FALSE.
* The fRelease member is TRUE, but the client application responds with a negative WM_DDE_ACK message.
Notification Requirements
Minimum DLL Version None
Header Declared in Dde.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x3E8">
<name>WM_DDE_EXECUTE</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
No return value.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Handle to the client window posting the message. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Contains a global memory object that references an ANSI or Unicode command string, depending on the types of windows involved in the conversation.
</lmisc>
</lparam>
<misc>WM_DDE_EXECUTE Notification
A Dynamic Data Exchange (DDE) client application posts a WM_DDE_EXECUTE message to a DDE server application to send a string to the server to be processed as a series of commands. The server application is expected to post a WM_DDE_ACK message in response.
To post this message, call the PostMessage function with the following parameters.
Syntax
PostMessage(
(HWND) hWnd,
WM_DDE_EXECUTE,
(WPARAM) wParam,
(LPARAM) lParam
);
Parameters
wParam
Handle to the client window posting the message.
lParam
Contains a global memory object that references an ANSI or Unicode command string, depending on the types of windows involved in the conversation.
Return Value
No return value.
Remarks
The command string is a null-terminated string consisting of one or more opcode strings enclosed in single brackets ([ ]). Each opcode string has the following syntax, where the parameters list is optional:
opcode parameters
The opcode is any application-defined single token. It cannot include spaces, commas, parentheses, brackets, or quotation marks.
The parameters list can contain any application-defined value or values. Multiple parameters are separated by commas, and the entire parameter list is enclosed in parentheses. Parameters cannot include commas or parentheses except inside a quoted string. If a bracket or parenthesis character is to appear in a quoted string, it need not be doubled, as was the case under the old rules.
The following are valid command strings:
Copy Code
[connect][download(query1,results.txt)][disconnect]
[query("sales per employee for each district")]
[open("sample.xlm")][run("r1c1")]
[quote_case("This is a "" character")]
[bracket_or_paren_case("()s or []s should be no problem.")]
Note that, under the old rules, parentheses and brackets had to be doubled, as follows:
Copy Code
[bracket_or_paren_case("(())s or [[]]s should be no problem.")]
Servers should be able to parse commands in either form.
Unicode execute strings should be used only when both the client and server window handles cause the IsWindowUnicode function to return TRUE.
Posting
The client application allocates the global memory object by calling the GlobalAlloc function.
When processing the WM_DDE_ACK message that the server posts in reply to a WM_DDE_EXECUTE message, the client application must delete the object returned by the WM_DDE_ACK message.
Receiving
The server application posts the WM_DDE_ACK message to respond positively or negatively. The server should reuse the global memory object.
Unless specified otherwise by a sub-protocol, the server should not post the WM_DDE_ACK message until all the actions specified by the execute command string are completed. The one exception to this rule is when the string causes the server to terminate the conversation.
Notification Requirements
Minimum DLL Version None
Header Declared in Dde.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x3E0">
<name>WM_DDE_FIRST</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x3E0">
<name>WM_DDE_INITIATE</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
No return value.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Handle to the client window sending the message. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
The low-order word contains an atom that identifies the application with which a conversation is requested. The application name cannot contain slashes (/) or backslashes (\). These characters are reserved for network implementations. If this parameter is NULL, a conversation with all applications is requested.
The high-order word contains an atom that identifies the topic for which a conversation is requested. If the topic is NULL, conversations for all available topics are requested.
</lmisc>
</lparam>
<misc>WM_DDE_INITIATE Message
A Dynamic Data Exchange (DDE) client application sends a WM_DDE_INITIATE message to initiate a conversation with a server application responding to the specified application and topic names. Upon receiving this message, all server applications with names that match the specified application and that support the specified topic are expected to acknowledge it. (For more information, see the WM_DDE_ACK message.)
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage(
(HWND) hWndControl, // handle to destination control
(UINT) WM_DDE_INITIATE, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Handle to the client window sending the message.
lParam
The low-order word contains an atom that identifies the application with which a conversation is requested. The application name cannot contain slashes (/) or backslashes (\). These characters are reserved for network implementations. If this parameter is NULL, a conversation with all applications is requested.
The high-order word contains an atom that identifies the topic for which a conversation is requested. If the topic is NULL, conversations for all available topics are requested.
Return Value
No return value.
Remarks
If the low-order word of lParam is NULL, any server application can respond. If the high-order word of lParam is NULL, any topic is valid. Upon receiving a WM_DDE_INITIATE request with the high-order word of the lParam parameter set to NULL, a server must send a WM_DDE_ACK message for each of the topics it supports.
Sending
The client broadcasts the message to all top-level windows by setting the first parameter of SendMessage to HWND_BROADCAST.
If the client application has already obtained the window handle of the desired server, it can send WM_DDE_INITIATE directly to the server window by passing the server's window handle as the first parameter of SendMessage.
The client application allocates atoms by calling the GlobalAddAtom function.
When SendMessage returns, the client application must delete the atoms.
Receiving
To complete the initiation of a conversation, the server application must respond with one or more WM_DDE_ACK messages, where each message is for a separate topic. When sending WM_DDE_ACK message, the server should create new atoms; it should not reuse the atoms sent with WM_DDE_INITIATE.
Message Information
Header Declared in Dde.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x3E8">
<name>WM_DDE_LAST</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x3E7">
<name>WM_DDE_POKE</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
No return value.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Handle to the client window posting the message. </wmisc>
</wparam>
<lparam value="">
<lname>lpDdePoke</lname>
<lmisc>lpDdePoke
The low-order word is a handle to a global memory object containing a DDEPOKE structure with the data and additional information.
The high-order word contains a global atom that identifies the data item for which the data or notification is being sent.
</lmisc>
</lparam>
<misc>WM_DDE_POKE Notification
A Dynamic Data Exchange (DDE) client application posts a WM_DDE_POKE message to a DDE server application. A client uses this message to request the server to accept an unsolicited data item. The server is expected to reply with a WM_DDE_ACK message indicating whether it accepted the data item.
To post this message, call the PostMessage function with the following parameters.
Syntax
PostMessage(
(HWND) hWnd,
WM_DDE_POKE,
(WPARAM) wParam,
(LPARAM) lParam
);
Parameters
wParam
Handle to the client window posting the message.
lpDdePoke
The low-order word is a handle to a global memory object containing a DDEPOKE structure with the data and additional information.
The high-order word contains a global atom that identifies the data item for which the data or notification is being sent.
Return Value
No return value.
Remarks
Posting
The client application must allocate memory for the global memory object using the GlobalAlloc function. The client application must delete the object if either of the following conditions is true:
* The server application responds with a negative WM_DDE_ACK message.
* The fRelease member is FALSE, but the server application responds with either a positive or negative WM_DDE_ACK.
The client application must create the atom using the GlobalAddAtom function.
The client application must create or reuse the WM_DDE_POKE lpDdePoke parameter by calling the PackDDElParam function or the ReuseDDElParam function.
Receiving
The server application should post the WM_DDE_ACK message to respond positively or negatively. When posting WM_DDE_ACK, the server can either reuse the atom, or it can delete it and create a new one.
The server must create or reuse the WM_DDE_ACK lParam parameter by calling the PackDDElParam function or the ReuseDDElParam function.
To free the global memory object, the server should call the GlobalFree function. Also, if the data format is either CF_DSPMETAFILEPICT or CF_METAFILEPICT, the server must also call DeleteMetaFile with the embedded metafile handle. These two formats have an extra level of indirection; that is, an application must lock the object to get a pointer to a handle, then lock that handle to get a pointer to a METAFILEPICT structure, and finally call DeleteMetaFile with the handle from the hMF member of the METAFILEPICT structure.
To free the object, the server should call the FreeDDElParam function.
Notification Requirements
Minimum DLL Version None
Header Declared in Dde.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x3E6">
<name>WM_DDE_REQUEST</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
No return value.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Handle to the client window sending the message. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
The low-order word specifies a standard or registered clipboard format.
The high-order word contains an atom that identifies the data item requested from the server. </lmisc>
</lparam>
<misc>WM_DDE_REQUEST Notification
A Dynamic Data Exchange (DDE) client application posts a WM_DDE_REQUEST message to a DDE server application to request the value of a data item.
To post this message, call the PostMessage function with the following parameters.
Syntax
PostMessage(
(HWND) hWnd,
WM_DDE_REQUEST,
(WPARAM) wParam,
(LPARAM) lParam
);
Parameters
wParam
Handle to the client window sending the message.
lParam
The low-order word specifies a standard or registered clipboard format.
The high-order word contains an atom that identifies the data item requested from the server.
Return Value
No return value.
Remarks
Posting
The client application allocates the atom by calling the GlobalAddAtom function.
Receiving
If the receiving (server) application can satisfy the request, it responds with a WM_DDE_DATA message containing the requested data. Otherwise, it responds with a negative WM_DDE_ACK message.
When responding with either a WM_DDE_DATA or WM_DDE_ACK message, the server application can either reuse the atom or it can delete the atom and create a new one.
Notification Requirements
Minimum DLL Version None
Header Declared in Dde.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x3E1">
<name>WM_DDE_TERMINATE</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
No return value.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Handle to the client or server window posting the message. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used. </lmisc>
</lparam>
<misc>WM_DDE_TERMINATE Notification
A Dynamic Data Exchange (DDE) application (client or server) posts a WM_DDE_TERMINATE message to terminate a conversation.
To post this message, call the PostMessage function with the following parameters.
Syntax
PostMessage(
(HWND) hWnd,
WM_DDE_TERMINATE,
(WPARAM) wParam,
(LPARAM) lParam
);
Parameters
wParam
Handle to the client or server window posting the message.
lParam
This parameter is not used.
Return Value
No return value.
Remarks
Posting
While waiting for confirmation of the termination, the posting application should not post any other messages to the receiving application. If the sending application receives messages (other than WM_DDE_TERMINATE) from the receiving application, it should delete any atoms or shared memory objects accompanying the messages, except global memory objects associated with WM_DDE_POKE or WM_DDE_DATA messages that do not have the fRelease member set.
Receiving
The client or server application should respond by posting a WM_DDE_TERMINATE message.
Notification Requirements
Minimum DLL Version None
Header Declared in Dde.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x3E3">
<name>WM_DDE_UNADVISE</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
No return value.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Handle to the client window sending the message. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
The low-order word specifies the clipboard format of the item for which the update request is being retracted. If this is NULL, all active WM_DDE_ADVISE conversations for the item are to be terminated.
The high-order word contains a global atom that identifies the item for which the update request is being retracted. If this is NULL, all active WM_DDE_ADVISE links associated with the conversation are to be terminated.
</lmisc>
</lparam>
<misc>WM_DDE_UNADVISE Notification
A Dynamic Data Exchange (DDE) client application posts a WM_DDE_UNADVISE message to inform a DDE server application that the specified item or a particular clipboard format for the item should no longer be updated. This terminates the warm or hot data link for the specified item.
To post this message, call the PostMessage function with the following parameters.
Syntax
PostMessage(
(HWND) hWnd,
WM_DDE_UNADVISE,
(WPARAM) wParam,
(LPARAM) lParam
);
Parameters
wParam
Handle to the client window sending the message.
lParam
The low-order word specifies the clipboard format of the item for which the update request is being retracted. If this is NULL, all active WM_DDE_ADVISE conversations for the item are to be terminated.
The high-order word contains a global atom that identifies the item for which the update request is being retracted. If this is NULL, all active WM_DDE_ADVISE links associated with the conversation are to be terminated.
Return Value
No return value.
Remarks
The client application allocates the high-order word of lParam by calling the GlobalAddAtom function.
The server application posts the WM_DDE_ACK message to respond positively or negatively. When posting WM_DDE_ACK, the server can either reuse the atom, or it can delete the atom and create a new one.
Notification Requirements
Minimum DLL Version None
Header Declared in Dde.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x103">
<name>WM_DEADCHAR</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
An application should return zero if it processes this message. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the character code generated by the dead key. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Specifies the repeat count, scan code, extended-key flag, context code, previous key-state flag, and transition-state flag, as shown in the following table.
0-15
Specifies the repeat count for the current message. The value is the number of times the keystroke is autorepeated as a result of the user holding down the key. If the keystroke is held long enough, multiple messages are sent. However, the repeat count is not cumulative.
16-23
Specifies the scan code. The value depends on the OEM.
24
Specifies whether the key is an extended key, such as the right-hand ALT and CTRL keys that appear on an enhanced 101- or 102-key keyboard. The value is 1 if it is an extended key; otherwise, it is 0.
25-28
Reserved; do not use.
29
Specifies the context code. The value is 1 if the ALT key is held down while the key is pressed; otherwise, the value is 0.
30
Specifies the previous key state. The value is 1 if the key is down before the message is sent, or it is 0 if the key is up.
31
Specifies the transition state. The value is 1 if the key is being released, or it is 0 if the key is being pressed.
</lmisc>
</lparam>
<misc>WM_DEADCHAR Notification
The WM_DEADCHAR message is posted to the window with the keyboard focus when a WM_KEYUP message is translated by the TranslateMessage function. WM_DEADCHAR specifies a character code generated by a dead key. A dead key is a key that generates a character, such as the umlaut (double-dot), that is combined with another character to form a composite character. For example, the umlaut-O character is generated by typing the dead key for the umlaut character, and then typing the O key.
Syntax
WM_DEADCHAR
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Specifies the character code generated by the dead key.
lParam
Specifies the repeat count, scan code, extended-key flag, context code, previous key-state flag, and transition-state flag, as shown in the following table.
0-15
Specifies the repeat count for the current message. The value is the number of times the keystroke is autorepeated as a result of the user holding down the key. If the keystroke is held long enough, multiple messages are sent. However, the repeat count is not cumulative.
16-23
Specifies the scan code. The value depends on the OEM.
24
Specifies whether the key is an extended key, such as the right-hand ALT and CTRL keys that appear on an enhanced 101- or 102-key keyboard. The value is 1 if it is an extended key; otherwise, it is 0.
25-28
Reserved; do not use.
29
Specifies the context code. The value is 1 if the ALT key is held down while the key is pressed; otherwise, the value is 0.
30
Specifies the previous key state. The value is 1 if the key is down before the message is sent, or it is 0 if the key is up.
31
Specifies the transition state. The value is 1 if the key is being released, or it is 0 if the key is being pressed.
Return Value
An application should return zero if it processes this message.
Remarks
The WM_DEADCHAR message typically is used by applications to give the user feedback about each key pressed. For example, an application can display the accent in the current character position without moving the caret.
Because there is not necessarily a one-to-one correspondence between keys pressed and character messages generated, the information in the high-order word of the lParam parameter is generally not useful to applications. The information in the high-order word applies only to the most recent WM_KEYDOWN message that precedes the posting of the WM_DEADCHAR message.
For enhanced 101- and 102-key keyboards, extended keys are the right ALT and the right CTRL keys on the main section of the keyboard; the INS, DEL, HOME, END, PAGE UP, PAGE DOWN and arrow keys in the clusters to the left of the numeric keypad; and the divide (/) and ENTER keys in the numeric keypad. Some other keyboards may support the extended-key bit in the lParam parameter.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x2D">
<name>WM_DELETEITEM</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
An application should return TRUE if it processes this message.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the identifier of the control that sent the WM_DELETEITEM message. </wmisc>
</wparam>
<lparam value="DELETEITEMSTRUCT">
<lname>lpDeleteItem</lname>
<lmisc>lpDeleteItem
Pointer to a DELETEITEMSTRUCT structure that contains information about the item deleted from a list box. </lmisc>
</lparam>
<misc>WM_DELETEITEM Notification
Sent to the owner of a list box or combo box when the list box or combo box is destroyed or when items are removed by the LB_DELETESTRING, LB_RESETCONTENT, CB_DELETESTRING, or CB_RESETCONTENT message. The system sends a WM_DELETEITEM message for each deleted item. The system sends the WM_DELETEITEM message for any deleted list box or combo box item with nonzero item data.
Syntax
WM_DELETEITEM
WPARAM wParam
lpDeleteItem = (LPDELETEITEMSTRUCT) lParam;
Parameters
wParam
Specifies the identifier of the control that sent the WM_DELETEITEM message.
lpDeleteItem
Pointer to a DELETEITEMSTRUCT structure that contains information about the item deleted from a list box.
Return Value
An application should return TRUE if it processes this message.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x2">
<name>WM_DESTROY</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used.</lmisc>
</lparam>
<misc>WM_DESTROY Notification
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.
A window receives this message through its WindowProc function.
Syntax
WM_DESTROY
WPARAM wParam
LPARAM lParam;
Parameters
wParam
This parameter is not used.
lParam
This parameter is not used.
Return Value
Remarks
If the window being destroyed is part of the clipboard viewer chain (set by calling the SetClipboardViewer function), the window must remove itself from the chain by processing the ChangeClipboardChain function before returning from the WM_DESTROY message.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x307">
<name>WM_DESTROYCLIPBOARD</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used; must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used; must be zero.</lmisc>
</lparam>
<misc>WM_DESTROYCLIPBOARD Notification
The WM_DESTROYCLIPBOARD message is sent to the clipboard owner when a call to the EmptyClipboard function empties the clipboard.
A window receives this message through its WindowProc function.
Syntax
WM_DESTROYCLIPBOARD
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x219">
<name>WM_DEVICECHANGE</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
Return TRUE to grant the request.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
The event that has occurred. This parameter can be one of the following values from the Dbt.h header file.
Value Meaning
DBT_CONFIGCHANGECANCELED
0x0019
A request to change the current configuration (dock or undock) has been canceled.
DBT_CONFIGCHANGED
0x0018
The current configuration has changed, due to a dock or undock.
DBT_CUSTOMEVENT
0x8006
A custom event has occurred.
DBT_DEVICEARRIVAL
0x8000
A device or piece of media has been inserted and is now available.
DBT_DEVICEQUERYREMOVE
0x8001
Permission is requested to remove a device or piece of media. Any application can deny this request and cancel the removal.
DBT_DEVICEQUERYREMOVEFAILED
0x8002
A request to remove a device or piece of media has been canceled.
DBT_DEVICEREMOVECOMPLETE
0x8004
A device or piece of media has been removed.
DBT_DEVICEREMOVEPENDING
0x8003
A device or piece of media is about to be removed. Cannot be denied.
DBT_DEVICETYPESPECIFIC
0x8005
A device-specific event has occurred.
DBT_DEVNODES_CHANGED
0x0007
A device has been added to or removed from the system.
DBT_QUERYCHANGECONFIG
0x0017
Permission is requested to change the current configuration (dock or undock).
DBT_USERDEFINED
0xFFFF
The meaning of this message is user-defined.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
A pointer to a structure that contains event-specific data. Its format depends on the value of the wParam parameter. For more information, refer to the documentation for each event.
</lmisc>
</lparam>
<misc>WM_DEVICECHANGE Message
Notifies an application of a change to the hardware configuration of a device or the computer.
A window receives this message through its WindowProc function.
LRESULT CALLBACK WindowProc(
HWND hwnd, // handle to window
UINT uMsg, // message identifier
WPARAM wParam, // device-change event
LPARAM lParam // event-specific data
);
Parameters
hwnd
A handle to the window.
uMsg
The WM_DEVICECHANGE identifier.
wParam
The event that has occurred. This parameter can be one of the following values from the Dbt.h header file.
Value Meaning
DBT_CONFIGCHANGECANCELED
0x0019
A request to change the current configuration (dock or undock) has been canceled.
DBT_CONFIGCHANGED
0x0018
The current configuration has changed, due to a dock or undock.
DBT_CUSTOMEVENT
0x8006
A custom event has occurred.
DBT_DEVICEARRIVAL
0x8000
A device or piece of media has been inserted and is now available.
DBT_DEVICEQUERYREMOVE
0x8001
Permission is requested to remove a device or piece of media. Any application can deny this request and cancel the removal.
DBT_DEVICEQUERYREMOVEFAILED
0x8002
A request to remove a device or piece of media has been canceled.
DBT_DEVICEREMOVECOMPLETE
0x8004
A device or piece of media has been removed.
DBT_DEVICEREMOVEPENDING
0x8003
A device or piece of media is about to be removed. Cannot be denied.
DBT_DEVICETYPESPECIFIC
0x8005
A device-specific event has occurred.
DBT_DEVNODES_CHANGED
0x0007
A device has been added to or removed from the system.
DBT_QUERYCHANGECONFIG
0x0017
Permission is requested to change the current configuration (dock or undock).
DBT_USERDEFINED
0xFFFF
The meaning of this message is user-defined.
lParam
A pointer to a structure that contains event-specific data. Its format depends on the value of the wParam parameter. For more information, refer to the documentation for each event.
Return Value
Return TRUE to grant the request.
Return BROADCAST_QUERY_DENY to deny the request.
Remarks
For devices that offer software-controllable features, such as ejection and locking, the system typically sends a DBT_DEVICEREMOVEPENDING message to let applications and device drivers end their use of the device gracefully. If the system forcibly removes a device, it may not send a DBT_DEVICEQUERYREMOVE message before doing so.
Requirements
Minimum supported client Windows 2000 Professional
Minimum supported server Windows 2000 Server
Header Winuser.h (include Windows.h or Dbt.h)</misc>
</message>
<message value="0x1B">
<name>WM_DEVMODECHANGE</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
An application should return zero if it processes this message.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Pointer to a string that specifies the device name.</lmisc>
</lparam>
<misc>WM_DEVMODECHANGE Message
The WM_DEVMODECHANGE message is sent to all top-level windows whenever the user changes device-mode settings.
A window receives this message through its WindowProc function.
LRESULT CALLBACK WindowProc(
HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
);
Parameters
hwnd
Handle to window
uMsg
WM_DEVMODECHANGE
wParam
This parameter is not used.
lParam
Pointer to a string that specifies the device name.
Return Value
An application should return zero if it processes this message.
Remarks
This message cannot be sent directly to a window. To send the WM_DEVMODECHANGE message to all top-level windows, use the SendMessageTimeout function with the hWnd parameter set to HWND_BROADCAST.
Requirements
Client Requires Windows Vista, Windows XP, Windows 2000 Professional, Windows NT Workstation 3.1 and later, Windows Me, Windows 98, or Windows 95.
Header Declared in Winuser.h; include Windows.h.</misc>
</message>
<message value="0x7E">
<name>WM_DISPLAYCHANGE</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
This message does not return a value.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the new image depth of the display, in bits per pixel.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
The low-order word specifies the horizontal resolution of the screen.
The high-order word specifies the vertical resolution of the screen.</lmisc>
</lparam>
<misc>WM_DISPLAYCHANGE Message
The WM_DISPLAYCHANGE message is sent to all windows when the display resolution has changed.
A window receives this message through its WindowProc function.
LRESULT CALLBACK WindowProc(
HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
);
Parameters
wParam
Specifies the new image depth of the display, in bits per pixel.
lParam
The low-order word specifies the horizontal resolution of the screen.
The high-order word specifies the vertical resolution of the screen.
Return Value
This message does not return a value.
Remarks
This message is only sent to top-level windows. For all other windows it is posted.
Requirements
Client Requires Windows Vista, Windows XP, Windows 2000 Professional, Windows NT Workstation, Windows Me, Windows 98, or Windows 95.
Header Declared in Winuser.h; include Windows.h.</misc>
</message>
<message value="0x308">
<name>WM_DRAWCLIPBOARD</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
No return value.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used; must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used; must be zero.</lmisc>
</lparam>
<misc>WM_DRAWCLIPBOARD Notification
The WM_DRAWCLIPBOARD message is sent to the first window in the clipboard viewer chain when the content of the clipboard changes. This enables a clipboard viewer window to display the new content of the clipboard.
A window receives this message through its WindowProc function.
Syntax
WM_DRAWCLIPBOARD
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
No return value.
Remarks
Only clipboard viewer windows receive this message. These are windows that have been added to the clipboard viewer chain by using the SetClipboardViewer function.
Each window that receives the WM_DRAWCLIPBOARD message must call the SendMessage function to pass the message on to the next window in the clipboard viewer chain. The handle to the next window in the chain is returned by SetClipboardViewer, and may change in response to a WM_CHANGECBCHAIN message.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x2B">
<name>WM_DRAWITEM</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the identifier of the control that sent the WM_DRAWITEM message. If the message was sent by a menu, this parameter is zero.
</wmisc>
</wparam>
<lparam value="DRAWITEMSTRUCT">
<lname>lpDrawItem</lname>
<lmisc>lpDrawItem
Pointer to a DRAWITEMSTRUCT structure containing information about the item to be drawn and the type of drawing required.
</lmisc>
</lparam>
<misc>WM_DRAWITEM Notification
The WM_DRAWITEM message is sent to the parent window of an owner-drawn button, combo box, list box, or menu when a visual aspect of the button, combo box, list box, or menu has changed.
A window receives this message through its WindowProc function.
Syntax
WM_DRAWITEM
WPARAM wParam
lpDrawItem = (LPDRAWITEMSTRUCT) lParam;
Parameters
wParam
Specifies the identifier of the control that sent the WM_DRAWITEM message. If the message was sent by a menu, this parameter is zero.
lpDrawItem
Pointer to a DRAWITEMSTRUCT structure containing information about the item to be drawn and the type of drawing required.
Return Value
Remarks
By default, the DefWindowProc function draws the focus rectangle for an owner-drawn list box item.
The itemAction member of the DRAWITEMSTRUCT structure specifies the drawing operation that an application should perform.
Before returning from processing this message, an application should ensure that the device context identified by the hDC member of the DRAWITEMSTRUCT structure is in the default state.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x233">
<name>WM_DROPFILES</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>hDrop</wname>
<wmisc>hDrop
A handle to an internal structure describing the dropped files. Pass this handle DragFinish, DragQueryFile, or DragQueryPoint to retrieve information about the dropped files.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Must be zero.</lmisc>
</lparam>
<misc>WM_DROPFILES Message
Sent when the user drops a file on the window of an application that has registered itself as a recipient of dropped files.
Syntax
PostMessage(
(HWND) hWndControl, // handle to destination control
(UINT) WM_DROPFILES, // message ID
(WPARAM) wParam, // = (WPARAM) (HDROP) hDrop;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
hDrop
A handle to an internal structure describing the dropped files. Pass this handle DragFinish, DragQueryFile, or DragQueryPoint to retrieve information about the dropped files.
lParam
Must be zero.
Return Value
Remarks
The HDROP handle is declared in Shellapi.h. You must include this header in your build to use WM_DROPFILES. For further discussion of how to use drag-and-drop to transfer Shell data, see Transferring Shell Data Using Drag-and-Drop or the Clipboard.
Message Information
Header winuser.h
Minimum operating systems Windows NT 3.1, Windows 95</misc>
</message>
<message value="0xA">
<name>WM_ENABLE</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies whether the window has been enabled or disabled. This parameter is TRUE if the window has been enabled or FALSE if the window has been disabled.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used.</lmisc>
</lparam>
<misc>WM_ENABLE Notification
The WM_ENABLE message is sent when an application changes the enabled state of a window. It is sent to the window whose enabled state is changing. This message is sent before the EnableWindow function returns, but after the enabled state (WS_DISABLED style bit) of the window has changed.
A window receives this message through its WindowProc function.
Syntax
WM_ENABLE
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Specifies whether the window has been enabled or disabled. This parameter is TRUE if the window has been enabled or FALSE if the window has been disabled.
lParam
This parameter is not used.
Return Value
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x16">
<name>WM_ENDSESSION</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
If an application processes this message, it should return zero.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
If the session is being ended, this parameter is TRUE; the session can end any time after all applications have returned from processing this message. Otherwise, it is FALSE.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter can be one or more of the following values. If this parameter is 0, the system is shutting down or restarting (it is not possible to determine which event is occurring).
Value Meaning
ENDSESSION_CLOSEAPP
0x1
If wParam is TRUE, the application must shut down. Any data should be saved automatically without prompting the user (for more information, see Remarks). The Restart Manager sends this message when the application is using a file that needs to be replaced, when it must service the system, or when system resources are exhausted. The application will be restarted if it has registered for restart using the RegisterApplicationRestart function. For more information, see Guidelines for Applications.
If wParam is FALSE, the application should not shut down.
ENDSESSION_CRITICAL
0x40000000
The application is forced to shut down.
ENDSESSION_LOGOFF
0x80000000
The user is logging off. For more information, see Logging Off.
Note that this parameter is a bit mask. To test for this value, use a bit-wise operation; do not test for equality.
</lmisc>
</lparam>
<misc>WM_ENDSESSION Message
The WM_ENDSESSION message is sent to an application after the system processes the results of the WM_QUERYENDSESSION message. The WM_ENDSESSION message informs the application whether the session is ending.
A window receives this message through its WindowProc function.
LRESULT CALLBACK WindowProc(
HWND hwnd, // handle to window
UINT uMsg, // message identifier
WPARAM wParam, // end-session option
LPARAM lParam // logoff option
);
Parameters
hwnd
A handle to the window.
uMsg
The WM_ENDSESSION identifier.
wParam
If the session is being ended, this parameter is TRUE; the session can end any time after all applications have returned from processing this message. Otherwise, it is FALSE.
lParam
This parameter can be one or more of the following values. If this parameter is 0, the system is shutting down or restarting (it is not possible to determine which event is occurring).
Value Meaning
ENDSESSION_CLOSEAPP
0x1
If wParam is TRUE, the application must shut down. Any data should be saved automatically without prompting the user (for more information, see Remarks). The Restart Manager sends this message when the application is using a file that needs to be replaced, when it must service the system, or when system resources are exhausted. The application will be restarted if it has registered for restart using the RegisterApplicationRestart function. For more information, see Guidelines for Applications.
If wParam is FALSE, the application should not shut down.
ENDSESSION_CRITICAL
0x40000000
The application is forced to shut down.
ENDSESSION_LOGOFF
0x80000000
The user is logging off. For more information, see Logging Off.
Note that this parameter is a bit mask. To test for this value, use a bit-wise operation; do not test for equality.
Return Value
If an application processes this message, it should return zero.
Remarks
Applications that have unsaved data could save the data to a temporary location and restore it the next time the application starts. It is recommended that applications save their data and state frequently; for example, automatically save data between save operations initiated by the user to reduce the amount of data to be saved at shutdown.
The application need not call the DestroyWindow or PostQuitMessage function when the session is ending.
Requirements
Minimum supported client Windows 2000 Professional
Minimum supported server Windows 2000 Server
Header WinUser.h (include Windows.h)</misc>
</message>
<message value="0x121">
<name>WM_ENTERIDLE</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies whether the message is the result of a dialog box or a menu being displayed. This parameter can be one of the following values.
MSGF_DIALOGBOX
The system is idle because a dialog box is displayed.
MSGF_MENU
The system is idle because a menu is displayed.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Handle to the dialog box (if wParam is MSGF_DIALOGBOX) or window containing the displayed menu (if wParam is MSGF_MENU).
</lmisc>
</lparam>
<misc>WM_ENTERIDLE Notification
The WM_ENTERIDLE message is sent to the owner window of a modal dialog box or menu that is entering an idle state. A modal dialog box or menu enters an idle state when no messages are waiting in its queue after it has processed one or more previous messages.
Syntax
WM_ENTERIDLE
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Specifies whether the message is the result of a dialog box or a menu being displayed. This parameter can be one of the following values.
MSGF_DIALOGBOX
The system is idle because a dialog box is displayed.
MSGF_MENU
The system is idle because a menu is displayed.
lParam
Handle to the dialog box (if wParam is MSGF_DIALOGBOX) or window containing the displayed menu (if wParam is MSGF_MENU).
Return Value
Remarks
You can suppress the WM_ENTERIDLE message for a dialog box by creating the dialog box with the DS_NOIDLEMSG style.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x211">
<name>WM_ENTERMENULOOP</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
An application should return zero if it processes this message. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies whether the window menu was entered using the TrackPopupMenu function. This parameter has a value of TRUE if the window menu was entered using TrackPopupMenu, and FALSE if it was not.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used. </lmisc>
</lparam>
<misc>WM_ENTERMENULOOP Notification
The WM_ENTERMENULOOP message informs an application's main window procedure that a menu modal loop has been entered.
Syntax
WM_ENTERMENULOOP
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Specifies whether the window menu was entered using the TrackPopupMenu function. This parameter has a value of TRUE if the window menu was entered using TrackPopupMenu, and FALSE if it was not.
lParam
This parameter is not used.
Return Value
An application should return zero if it processes this message.
Remarks
The DefWindowProc function returns zero.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x231">
<name>WM_ENTERSIZEMOVE</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used.
</lmisc>
</lparam>
<misc>WM_ENTERSIZEMOVE Notification
The WM_ENTERSIZEMOVE message is sent one time to a window after it enters the moving or sizing modal loop. The window enters the moving or sizing modal loop when the user clicks the window's title bar or sizing border, or when the window passes the WM_SYSCOMMAND message to the DefWindowProc function and the wParam parameter of the message specifies the SC_MOVE or SC_SIZE value. The operation is complete when DefWindowProc returns.
The system sends the WM_ENTERSIZEMOVE message regardless of whether the dragging of full windows is enabled.
A window receives this message through its WindowProc function.
Syntax
WM_ENTERSIZEMOVE
WPARAM wParam
LPARAM lParam;
Parameters
wParam
This parameter is not used.
lParam
This parameter is not used.
Return Value
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.51</misc>
</message>
<message value="0x14">
<name>WM_ERASEBKGND</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
An application should return nonzero if it erases the background; otherwise, it should return zero.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Handle to the device context. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used. </lmisc>
</lparam>
<misc>WM_ERASEBKGND Notification
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.
Syntax
WM_ERASEBKGND
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Handle to the device context.
lParam
This parameter is not used.
Return Value
An application should return nonzero if it erases the background; otherwise, it should return zero.
Remarks
The DefWindowProc function erases the background by using the class background brush specified by the hbrBackground member of the WNDCLASS structure. If hbrBackground is NULL, the application should process the WM_ERASEBKGND message and erase the background.
An application should return nonzero in response to WM_ERASEBKGND if it processes the message and erases the background; this indicates that no further erasing is required. If the application returns zero, the window will remain marked for erasing. (Typically, this indicates that the fErase member of the PAINTSTRUCT structure will be TRUE.)
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x212">
<name>WM_EXITMENULOOP</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
An application should return zero if it processes this message.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies whether the menu is a shortcut menu. This parameter has a value of TRUE if it is a shortcut menu, FALSE if it is not.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used. </lmisc>
</lparam>
<misc>WM_EXITMENULOOP Notification
The WM_EXITMENULOOP message informs an application's main window procedure that a menu modal loop has been exited.
Syntax
WM_EXITMENULOOP
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Specifies whether the menu is a shortcut menu. This parameter has a value of TRUE if it is a shortcut menu, FALSE if it is not.
lParam
This parameter is not used.
Return Value
An application should return zero if it processes this message.
Remarks
The DefWindowProc function returns zero.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x232">
<name>WM_EXITSIZEMOVE</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used.</lmisc>
</lparam>
<misc>WM_EXITSIZEMOVE Notification
The WM_EXITSIZEMOVE message is sent one time to a window, after it has exited the moving or sizing modal loop. The window enters the moving or sizing modal loop when the user clicks the window's title bar or sizing border, or when the window passes the WM_SYSCOMMAND message to the DefWindowProc function and the wParam parameter of the message specifies the SC_MOVE or SC_SIZE value. The operation is complete when DefWindowProc returns.
A window receives this message through its WindowProc function.
Syntax
WM_EXITSIZEMOVE
WPARAM wParam
LPARAM lParam;
Parameters
wParam
This parameter is not used.
lParam
This parameter is not used.
Return Value
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.51</misc>
</message>
<message value="0x1D">
<name>WM_FONTCHANGE</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc>WM_FONTCHANGE Message
An application sends the WM_FONTCHANGE message to all top-level windows in the system after changing the pool of font resources.
To send this message, call the SendMessage function with the following parameters.
SendMessage(
(HWND) hWnd,
WM_FONTCHANGE,
(WPARAM) wParam,
(LPARAM) lParam
);
Remarks
An application that adds or removes fonts from the system (for example, by using the AddFontResource or RemoveFontResource function) should send this message to all top-level windows.
To send the WM_FONTCHANGE message to all top-level windows, an application can call the SendMessage function with the hwnd parameter set to HWND_BROADCAST.
Requirements
Client Requires Windows Vista, Windows XP, Windows 2000 Professional, Windows NT Workstation 3.1 and later, Windows Me, Windows 98, or Windows 95.
Header Declared in Winuser.h; include Windows.h.</misc>
</message>
<message value="0x37F">
<name>WM_FORWARDMSG</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>WPARAM
Data defined by user</wmisc>
</wparam>
<lparam value="MSG">
<lname>lParam</lname>
<lmisc>LPARAM
A pointer to a MSG structure that contains information about a message</lmisc>
</lparam>
<misc>WM_FORWARDMSG
This macro forwards a message received by a window to another window for processing.
WM_FORWARDMSG
Return Value
Nonzero if the message was processed, zero if not.
Remarks
Use WM_FORWARDMSG to forward a message received by a window to another window for processing. The LPARAM and WPARAM parameters are used as follows:
Parameter
Usage
WPARAM
Data defined by user
LPARAM
A pointer to a MSG structure that contains information about a message
Example
In the following example, m_hWndOther represents the other window that receives this message.
Visual C++
Copy Code
LRESULT CMyWindow::OnMsg(UINT nMsg, WPARAM wParam, LPARAM lParam,
BOOL bHandled)
{
MSG msg = { m_hWnd, nMsg, wParam, lParam, 0, { 0, 0 } };
LRESULT lRet = SendMessage(m_hWndOther, WM_FORWARDMSG, 0, (LPARAM)msg);
if(lRet == 0) // not handled
bHandled = FALSE;
return 0;
}
Requirements
Header: atlbase.h
</misc>
</message>
<message value="0x87">
<name>WM_GETDLGCODE</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
The return value is one or more of the following values, indicating which type of input the application processes.
DLGC_BUTTON Button.
DLGC_DEFPUSHBUTTON Default push button.
DLGC_HASSETSEL EM_SETSEL messages.
DLGC_RADIOBUTTON Radio button.
DLGC_STATIC Static control.
DLGC_UNDEFPUSHBUTTON Non-default push button.
DLGC_WANTALLKEYS All keyboard input.
DLGC_WANTARROWS Direction keys.
DLGC_WANTCHARS WM_CHAR messages.
DLGC_WANTMESSAGE All keyboard input (the application passes this message in the MSG structure to the control).
DLGC_WANTTAB TAB key.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
The virtual key, pressed by the user, that prompted Microsoft Windows to issue this notification. The handler must selectively handle these keys. For instance, the handler might accept and process VK_RETURN but delegate VK_TAB to the owner window.
</wmisc>
</wparam>
<lparam value="MSG">
<lname>lParam</lname>
<lmisc>lParam
Pointer to an MSG structure (or NULL if the system is performing a query).
</lmisc>
</lparam>
<misc>WM_GETDLGCODE Notification
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.
Syntax
WM_GETDLGCODE
WPARAM wParam
LPARAM lParam;
Parameters
wParam
The virtual key, pressed by the user, that prompted Microsoft Windows to issue this notification. The handler must selectively handle these keys. For instance, the handler might accept and process VK_RETURN but delegate VK_TAB to the owner window.
lParam
Pointer to an MSG structure (or NULL if the system is performing a query).
Return Value
The return value is one or more of the following values, indicating which type of input the application processes.
DLGC_BUTTON Button.
DLGC_DEFPUSHBUTTON Default push button.
DLGC_HASSETSEL EM_SETSEL messages.
DLGC_RADIOBUTTON Radio button.
DLGC_STATIC Static control.
DLGC_UNDEFPUSHBUTTON Non-default push button.
DLGC_WANTALLKEYS All keyboard input.
DLGC_WANTARROWS Direction keys.
DLGC_WANTCHARS WM_CHAR messages.
DLGC_WANTMESSAGE All keyboard input (the application passes this message in the MSG structure to the control).
DLGC_WANTTAB TAB key.
Remarks
Although the DefWindowProc function always returns zero in response to the WM_GETDLGCODE message, the window procedure for the predefined control classes return a code appropriate for each class.
The WM_GETDLGCODE message and the returned values are useful only with user-defined dialog box controls or standard controls modified by subclassing.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x31">
<name>WM_GETFONT</name>
<return value="HFONT">
<returninfo>returns HFONT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used; must be zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used; must be zero. </lmisc>
</lparam>
<misc>WM_GETFONT Message
An application sends a WM_GETFONT message to a control to retrieve the font with which the control is currently drawing its text.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns HFONT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) WM_GETFONT, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x33">
<name>WM_GETHOTKEY</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
The return value is the virtual-key code and modifiers for the hot key, or NULL if no hot key is associated with the window. The virtual-key code is in the low byte of the return value and the modifiers are in the high byte. The modifiers can be a combination of the following flags.
HOTKEYF_ALT ALT key
HOTKEYF_CONTROL CTRL key
HOTKEYF_EXT Extended key
HOTKEYF_SHIFT SHIFT key</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used; must be zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used; must be zero. </lmisc>
</lparam>
<misc>WM_GETHOTKEY Message
An application sends a WM_GETHOTKEY message to determine the hot key associated with a window.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) WM_GETHOTKEY, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
The return value is the virtual-key code and modifiers for the hot key, or NULL if no hot key is associated with the window. The virtual-key code is in the low byte of the return value and the modifiers are in the high byte. The modifiers can be a combination of the following flags.
HOTKEYF_ALT ALT key
HOTKEYF_CONTROL CTRL key
HOTKEYF_EXT Extended key
HOTKEYF_SHIFT SHIFT key
Remarks
These hot keys are unrelated to the hot keys set by the RegisterHotKey function.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x7F">
<name>WM_GETICON</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
The return value is a handle to the large or small icon, depending on the value of wParam. When an application receives this message, it can return a handle to a large or small icon, or pass the message to the DefWindowProc function.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the type of icon being retrieved. This parameter can be one of the following values.
ICON_BIG
Retrieve the large icon for the window.
ICON_SMALL
Retrieve the small icon for the window.
ICON_SMALL2
Windows XP: Retrieves the small icon provided by the application. If the application does not provide one, the system uses the system-generated icon for that window.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used.
</lmisc>
</lparam>
<misc>WM_GETICON Notification
The WM_GETICON message is sent to a window to retrieve a handle to the large or small icon associated with a window. The system displays the large icon in the ALT+TAB dialog, and the small icon in the window caption.
A window receives this message through its WindowProc function.
Syntax
WM_GETICON
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Specifies the type of icon being retrieved. This parameter can be one of the following values.
ICON_BIG
Retrieve the large icon for the window.
ICON_SMALL
Retrieve the small icon for the window.
ICON_SMALL2
Windows XP: Retrieves the small icon provided by the application. If the application does not provide one, the system uses the system-generated icon for that window.
lParam
This parameter is not used.
Return Value
The return value is a handle to the large or small icon, depending on the value of wParam. When an application receives this message, it can return a handle to a large or small icon, or pass the message to the DefWindowProc function.
Remarks
When an application receives this message, it can return a handle to a large or small icon, or pass the message to DefWindowProc.
DefWindowProc returns a handle to the large or small icon associated with the window, depending on the value of wParam.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0x24">
<name>WM_GETMINMAXINFO</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used.</wmisc>
</wparam>
<lparam value="MINMAXINFO">
<lname>lParam</lname>
<lmisc>lParam
Pointer to a MINMAXINFO structure that contains the default maximized position and dimensions, and the default minimum and maximum tracking sizes. An application can override the defaults by setting the members of this structure.
</lmisc>
</lparam>
<misc>WM_GETMINMAXINFO Notification
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.
A window receives this message through its WindowProc function.
Syntax
WM_GETMINMAXINFO
WPARAM wParam
LPARAM lParam;
Parameters
wParam
This parameter is not used.
lParam
Pointer to a MINMAXINFO structure that contains the default maximized position and dimensions, and the default minimum and maximum tracking sizes. An application can override the defaults by setting the members of this structure.
Return Value
Remarks
The maximum tracking size is the largest window size that can be produced by using the borders to size the window. The minimum tracking size is the smallest window size that can be produced by using the borders to size the window.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x3D">
<name>WM_GETOBJECT</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
If the window or control does not need to respond to this message, it should pass the message to the DefWindowProc function; otherwise, the window or control should return a value that corresponds to the request specified by dwObjId:
* If dwObjId is equal to UiaRootObjectId and the window or control implements UI Automation, the window or control should return the value obtained by a call to the UiaReturnRawElementProvider function.
* If dwObjId is OBJID_NATIVEOM and the window exposes a native Object Model, the windows should return the value obtained by a call to the LresultFromObject function.
* If dwObjId is OBJID_CLIENT and the window implements IAccessible, the window should return the value obtained by a call to the LresultFromObject function.
</returnmisc>
</return>
<wparam value="DWORD">
<wname>dwFlags</wname>
<wmisc>dwFlags
Provides additional information about the message and is used only by the system. Servers pass dwFlags as the wParam parameter in the call to LresultFromObject when handling the message.
</wmisc>
</wparam>
<lparam value="DWORD">
<lname>dwObjId</lname>
<lmisc>dwObjId
Object identifier. This value is one of the object identifier constants or a custom object identifier. A server application must check this value to identify the type of information being requested. Before comparing this value against the OBJID_ values, the server must cast it to DWORD; otherwise, on Win64, the sign extension of the lParam can interfere with the comparison.
* If dwObjId is one of the OBJID_ values such as OBJID_CLIENT, the request is for a Microsoft Active Accessibility object that implements IAccessible.
* If dwObjId is equal to UiaRootObjectId, the request is for a UI Automation provider. If the server is implementing UI Automation, it should return a provider using the UiaReturnRawElementProvider function.
* If dwObjId is OBJID_NATIVEOM, the request is for the controls underlying object model. If the control supports this request, it should return an appropriate COM interface by calling the LresultFromObject function.
* If dwObjId is OBJID_QUERYCLASSNAMEIDX, the request is for the control to identify itself as a standard Windows control or a common control implemented by the common control library (ComCtrl.dll).
</lmisc>
</lparam>
<misc>WM_GETOBJECT Message
Sent by both Active Accessibility and UI Automation to obtain information about an accessible object contained in a server application.
Applications never send this message directly. Active Accessibility sends this message in response to calls to AccessibleObjectFromPoint, AccessibleObjectFromEvent, or AccessibleObjectFromWindow. However, server applications handle this message. UI Automation sends this message in response to calls to IUIAutomation::ElementFromHandle, ElementFromPoint, and GetFocusedElement, and when handling events for which a client has registered.
dwFlags = (WPARAM)(DWORD) wParam;
dwObjId = (LPARAM)(DWORD) lParam;
Parameters
dwFlags
Provides additional information about the message and is used only by the system. Servers pass dwFlags as the wParam parameter in the call to LresultFromObject when handling the message.
dwObjId
Object identifier. This value is one of the object identifier constants or a custom object identifier. A server application must check this value to identify the type of information being requested. Before comparing this value against the OBJID_ values, the server must cast it to DWORD; otherwise, on Win64, the sign extension of the lParam can interfere with the comparison.
* If dwObjId is one of the OBJID_ values such as OBJID_CLIENT, the request is for a Microsoft Active Accessibility object that implements IAccessible.
* If dwObjId is equal to UiaRootObjectId, the request is for a UI Automation provider. If the server is implementing UI Automation, it should return a provider using the UiaReturnRawElementProvider function.
* If dwObjId is OBJID_NATIVEOM, the request is for the controls underlying object model. If the control supports this request, it should return an appropriate COM interface by calling the LresultFromObject function.
* If dwObjId is OBJID_QUERYCLASSNAMEIDX, the request is for the control to identify itself as a standard Windows control or a common control implemented by the common control library (ComCtrl.dll).
Return Value
If the window or control does not need to respond to this message, it should pass the message to the DefWindowProc function; otherwise, the window or control should return a value that corresponds to the request specified by dwObjId:
* If dwObjId is equal to UiaRootObjectId and the window or control implements UI Automation, the window or control should return the value obtained by a call to the UiaReturnRawElementProvider function.
* If dwObjId is OBJID_NATIVEOM and the window exposes a native Object Model, the windows should return the value obtained by a call to the LresultFromObject function.
* If dwObjId is OBJID_CLIENT and the window implements IAccessible, the window should return the value obtained by a call to the LresultFromObject function.
Remarks
When a client calls AccessibleObjectFromWindow or any of the other AccessibleObjectFromX APIs that retrieve an interface to an object, Active Accessibility sends the WM_GETOBJECT message to the appropriate window procedure within the appropriate server application. While processing WM_GETOBJECT, server applications call LresultFromObject and use the return value of this function as the return value for the message. Active Accessibility, in conjunction with the COM library, performs the appropriate marshaling and passes the interface pointer from the server back to the client.
Servers do not respond to WM_GETOBJECT before the object is fully initialized or after it begins to close down. When an application creates a new window, the system sends EVENT_OBJECT_CREATE to notify clients before it sends the WM_CREATE message to the application's window procedure. Because many applications use WM_CREATE to start their initialization process, servers do not respond to the WM_GETOBJECT message until finished processing the WM_CREATE message.
A server uses WM_GETOBJECT to perform the following tasks:
* Create New Accessible Objects
* Reuse Existing Pointers to Objects
* Create New Interfaces to the Same Object
For clients, this means that they might receive distinct interface pointers for the same user interface element, depending on the server's action. To determine if two interface pointers point to the same user interface element, clients compare IAccessible properties of the object. Comparing pointers does not work.
Requirements
Client Requires Windows Vista, Windows XP, Windows Server 2003, Windows 2000 Professional, or Windows 98.
Server Requires Windows Server 2003.
Redistributable Requires Active Accessibility 1.3 RDK on Windows NT 4.0 with SP6 and later and Windows 95.
Header Declared in Winuser.h; include Windows.h.</misc>
</message>
<message value="0xD">
<name>WM_GETTEXT</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
The return value is the number of TCHARs copied, not including the terminating null character. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the maximum number of TCHARs to be copied, including the terminating null character.
Windows NT/2000/XP:ANSI applications may have the string in the buffer reduced in size (to a minimum of half that of the wParam value) due to conversion from ANSI to Unicode.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Pointer to the buffer that is to receive the text. </lmisc>
</lparam>
<misc>WM_GETTEXT Message
An application sends a WM_GETTEXT message to copy the text that corresponds to a window into a buffer provided by the caller.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) WM_GETTEXT, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Specifies the maximum number of TCHARs to be copied, including the terminating null character.
Windows NT/2000/XP:ANSI applications may have the string in the buffer reduced in size (to a minimum of half that of the wParam value) due to conversion from ANSI to Unicode.
lParam
Pointer to the buffer that is to receive the text.
Return Value
The return value is the number of TCHARs copied, not including the terminating null character.
Remarks
The DefWindowProc function copies the text associated with the window into the specified buffer and returns the number of characters copied. Note, for non-text static controls this gives you the text with which the control was originally created, that is, the ID number. However, it gives you the ID of the non-text static control as originally created. That is, if you subsequently used a STM_SETIMAGE to change it the original ID would still be returned.
For an edit control, the text to be copied is the content of the edit control. For a combo box, the text is the content of the edit control (or static-text) portion of the combo box. For a button, the text is the button name. For other windows, the text is the window title. To copy the text of an item in a list box, an application can use the LB_GETTEXT message.
When the WM_GETTEXT message is sent to a static control with the SS_ICON style, a handle to the icon will be returned in the first four bytes of the buffer pointed to by lParam. This is true only if the WM_SETTEXT message has been used to set the icon.
Rich Edit: If the text to be copied exceeds 64K, use either the EM_STREAMOUT or EM_GETSELTEXT message.
Windows 2000/XP: Sending a WM_GETTEXT message to a non-text static control, such as a static bitmap or static icon control, does not return a string value. Instead, it returns zero. In addition, in previous versions of Microsoft Windows and Microsoft Windows NT, applications could send a WM_GETTEXT message to a non-text static control to retrieve the control's ID. To retrieve a control's ID in Windows 2000/XP, applications can use GetWindowLong passing GWL_ID as the index value or GetWindowLongPtr using GWLP_ID.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0xE">
<name>WM_GETTEXTLENGTH</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
The return value is the length of the text in TCHARs, not including the terminating null character. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used and must be zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used and must be zero. </lmisc>
</lparam>
<misc>WM_GETTEXTLENGTH Message
An application sends a WM_GETTEXTLENGTH message to determine the length, in characters, of the text associated with a window.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) WM_GETTEXTLENGTH, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
This parameter is not used and must be zero.
lParam
This parameter is not used and must be zero.
Return Value
The return value is the length of the text in TCHARs, not including the terminating null character.
Remarks
For an edit control, the text to be copied is the content of the edit control. For a combo box, the text is the content of the edit control (or static-text) portion of the combo box. For a button, the text is the button name. For other windows, the text is the window title. To determine the length of an item in a list box, an application can use the LB_GETTEXTLEN message.
When the WM_GETTEXTLENGTH message is sent, the DefWindowProc function returns the length, in characters, of the text. Under certain conditions, the DefWindowProc function returns a value that is larger than the actual length of the text. This occurs with certain mixtures of ANSI and Unicode, and is due to the system allowing for the possible existence of double-byte character set (DBCS) characters within the text. The return value, however, will always be at least as large as the actual length of the text; you can thus always use it to guide buffer allocation. This behavior can occur when an application uses both ANSI functions and common dialogs, which use Unicode.
To obtain the exact length of the text, use the WM_GETTEXT, LB_GETTEXT, or CB_GETLBTEXT messages, or the GetWindowText function.
Windows 2000/XP: Sending a WM_GETTEXTLENGTH message to a non-text static control, such as a static bitmap or static icon controlc, does not return a string value. Instead, it returns zero.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x358">
<name>WM_HANDHELDFIRST</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x35F">
<name>WM_HANDHELDLAST</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x53">
<name>WM_HELP</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns TRUE. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Must be zero.</wmisc>
</wparam>
<lparam value="LPHELPINFO">
<lname>lphi</lname>
<lmisc>lphi
The address of a HELPINFO structure that contains information about the menu item, control, dialog box, or window for which Help is requested.
</lmisc>
</lparam>
<misc>WM_HELP Message
Indicates that the user pressed the F1 key. If a menu is active when F1 is pressed, WM_HELP is sent to the window associated with the menu; otherwise, WM_HELP is sent to the window that has the keyboard focus. If no window has the keyboard focus, WM_HELP is sent to the currently active window.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) WM_HELP, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = (LPARAM) (LPHELPINFO) lphi;
);
Parameters
wParam
Must be zero.
lphi
The address of a HELPINFO structure that contains information about the menu item, control, dialog box, or window for which Help is requested.
Return Value
Returns TRUE.
Remarks
The DefWindowProc function passes WM_HELP to the parent window of a child window or to the owner of a top-level window.
Message Information
Header winuser.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x312">
<name>WM_HOTKEY</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
No return value.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the identifier of the hot key that generated the message. If the message was generated by a system-defined hot key, this parameter will be one of the following values.
IDHOT_SNAPDESKTOP
The "snap desktop" hot key was pressed.
IDHOT_SNAPWINDOW
The "snap window" hot key was pressed.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
The low-order word specifies the keys that were to be pressed in combination with the key specified by the high-order word to generate the WM_HOTKEY message. This word can be one or more of the following values. The high-order word specifies the virtual key code of the hot key.
MOD_ALT
Either ALT key was held down.
MOD_CONTROL
Either CTRL key was held down.
MOD_SHIFT
Either SHIFT key was held down.
MOD_WIN
Either WINDOWS key was held down. These keys are labeled with the Microsoft Windows logo. Hotkeys that involve the Windows key are reserved for use by the operating system.
</lmisc>
</lparam>
<misc>WM_HOTKEY Notification
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.
Syntax
WM_HOTKEY
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Specifies the identifier of the hot key that generated the message. If the message was generated by a system-defined hot key, this parameter will be one of the following values.
IDHOT_SNAPDESKTOP
The "snap desktop" hot key was pressed.
IDHOT_SNAPWINDOW
The "snap window" hot key was pressed.
lParam
The low-order word specifies the keys that were to be pressed in combination with the key specified by the high-order word to generate the WM_HOTKEY message. This word can be one or more of the following values. The high-order word specifies the virtual key code of the hot key.
MOD_ALT
Either ALT key was held down.
MOD_CONTROL
Either CTRL key was held down.
MOD_SHIFT
Either SHIFT key was held down.
MOD_WIN
Either WINDOWS key was held down. These keys are labeled with the Microsoft Windows logo. Hotkeys that involve the Windows key are reserved for use by the operating system.
Return Value
No return value.
Remarks
WM_HOTKEY is unrelated to the WM_GETHOTKEY and WM_SETHOTKEY hot keys. The WM_HOTKEY message is sent for generic hot keys while the WM_SETHOTKEY and WM_GETHOTKEY messages relate to window activation hot keys.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x114">
<name>WM_HSCROLL</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
If an application processes this message, it should return zero. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
The low-order word specifies a scroll bar value that indicates the user's scrolling request. This word can be one of the following values.
The high-order word specifies the current position of the scroll box if the low-order word is SB_THUMBPOSITION or SB_THUMBTRACK; otherwise, this word is not used.
SB_ENDSCROLL
Ends scroll.
SB_LEFT
Scrolls to the upper left.
SB_RIGHT
Scrolls to the lower right.
SB_LINELEFT
Scrolls left by one unit.
SB_LINERIGHT
Scrolls right by one unit.
SB_PAGELEFT
Scrolls left by the width of the window.
SB_PAGERIGHT
Scrolls right by the width of the window.
SB_THUMBPOSITION
The user has dragged the scroll box (thumb) and released the mouse button. The high-order word indicates the position of the scroll box at the end of the drag operation.
SB_THUMBTRACK
The user is dragging the scroll box. This message is sent repeatedly until the user releases the mouse button. The high-order word indicates the position that the scroll box has been dragged to.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
If the message is sent by a scroll bar, then this parameter is the handle to the scroll bar control. If the message is not sent by a scroll bar, this parameter is NULL.
</lmisc>
</lparam>
<misc>WM_HSCROLL Notification
The WM_HSCROLL message is sent to a window when a scroll event occurs in the window's standard horizontal scroll bar. This message is also sent to the owner of a horizontal scroll bar control when a scroll event occurs in the control.
A window receives this message through its WindowProc function.
Syntax
WM_HSCROLL
WPARAM wParam
LPARAM lParam;
Parameters
wParam
The low-order word specifies a scroll bar value that indicates the user's scrolling request. This word can be one of the following values.
The high-order word specifies the current position of the scroll box if the low-order word is SB_THUMBPOSITION or SB_THUMBTRACK; otherwise, this word is not used.
SB_ENDSCROLL
Ends scroll.
SB_LEFT
Scrolls to the upper left.
SB_RIGHT
Scrolls to the lower right.
SB_LINELEFT
Scrolls left by one unit.
SB_LINERIGHT
Scrolls right by one unit.
SB_PAGELEFT
Scrolls left by the width of the window.
SB_PAGERIGHT
Scrolls right by the width of the window.
SB_THUMBPOSITION
The user has dragged the scroll box (thumb) and released the mouse button. The high-order word indicates the position of the scroll box at the end of the drag operation.
SB_THUMBTRACK
The user is dragging the scroll box. This message is sent repeatedly until the user releases the mouse button. The high-order word indicates the position that the scroll box has been dragged to.
lParam
If the message is sent by a scroll bar, then this parameter is the handle to the scroll bar control. If the message is not sent by a scroll bar, this parameter is NULL.
Return Value
If an application processes this message, it should return zero.
Remarks
The SB_THUMBTRACK request code is typically used by applications that provide feedback as the user drags the scroll box.
If an application scrolls the content of the window, it must also reset the position of the scroll box by using the SetScrollPos function.
Note that the WM_HSCROLL message carries only 16 bits of scroll box position data. Thus, applications that rely solely on WM_HSCROLL (and WM_VSCROLL) for scroll position data have a practical maximum position value of 65,535.
However, because the SetScrollInfo, SetScrollPos, SetScrollRange, GetScrollInfo, GetScrollPos, and GetScrollRange functions support 32-bit scroll bar position data, there is a way to circumvent the 16-bit barrier of the WM_HSCROLL and WM_VSCROLL messages. See GetScrollInfo for a description of the technique.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x30E">
<name>WM_HSCROLLCLIPBOARD</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
If an application processes this message, it should return zero. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Handle to the clipboard viewer window. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
The low-order word of lParam specifies a scroll bar event. This parameter can be one of the following values. The high-order word of lParam specifies the current position of the scroll box if the low-order word of lParam is SB_THUMBPOSITION; otherwise, the high-order word is not used.
SB_ENDSCROLL
End scroll.
SB_LEFT
Scroll to upper left.
SB_RIGHT
Scroll to lower right.
SB_LINELEFT
Scrolls left by one unit.
SB_LINERIGHT
Scrolls right by one unit.
SB_PAGELEFT
Scrolls left by the width of the window.
SB_PAGERIGHT
Scrolls right by the width of the window.
SB_THUMBPOSITION
Scroll to absolute position. The current position is specified by the high-order word.</lmisc>
</lparam>
<misc>WM_HSCROLLCLIPBOARD Notification
The WM_HSCROLLCLIPBOARD message is sent to the clipboard owner by a clipboard viewer window. This occurs when the clipboard contains data in the CF_OWNERDISPLAY format and an event occurs in the clipboard viewer's horizontal scroll bar. The owner should scroll the clipboard image and update the scroll bar values.
Syntax
WM_HSCROLLCLIPBOARD
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Handle to the clipboard viewer window.
lParam
The low-order word of lParam specifies a scroll bar event. This parameter can be one of the following values. The high-order word of lParam specifies the current position of the scroll box if the low-order word of lParam is SB_THUMBPOSITION; otherwise, the high-order word is not used.
SB_ENDSCROLL
End scroll.
SB_LEFT
Scroll to upper left.
SB_RIGHT
Scroll to lower right.
SB_LINELEFT
Scrolls left by one unit.
SB_LINERIGHT
Scrolls right by one unit.
SB_PAGELEFT
Scrolls left by the width of the window.
SB_PAGERIGHT
Scrolls right by the width of the window.
SB_THUMBPOSITION
Scroll to absolute position. The current position is specified by the high-order word.
Return Value
If an application processes this message, it should return zero.
Remarks
The clipboard owner can use the ScrollWindow function to scroll the image in the clipboard viewer window and invalidate the appropriate region.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x27">
<name>WM_ICONERASEBKGND</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
An application should return nonzero if it processes this message. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Handle to the device context of the icon.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used. </lmisc>
</lparam>
<misc>WM_ICONERASEBKGND Notification
Windows NT 3.51 and earlier: The WM_ICONERASEBKGND message is sent to a minimized window when the background of the icon must be filled before painting the icon. A window receives this message only if a class icon is defined for the window; otherwise, WM_ERASEBKGND is sent. This message is not sent by newer versions of Windows.
Syntax
WM_ICONERASEBKGND
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Handle to the device context of the icon.
lParam
This parameter is not used.
Return Value
An application should return nonzero if it processes this message.
Remarks
Windows NT 3.51 and earlier: The DefWindowProc function fills the icon background with the class background brush of the parent window. On newer versions of Windows, the DefWindowProc function ignores the message.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x286">
<name>WM_IME_CHAR</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
DBCS: A single- or double-byte character value. For a double-byte character, (BYTE)(wParam >> 8) contains the lead byte. Note that the parentheses are necessary because the cast operator has higher precedence than the shift operator.
Unicode: A Unicode character value.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
The repeat count, scan code, extended key flag, context code, previous key state flag, and transition state flag, with values as defined below.
Bit Meaning
0-15 Repeat count. Since the first byte and second byte is continuous, this is always 1.
16-23 Scan code for a complete Asian character.
24 Extended key.
25-28 Not used.
29 Context code.
30 Previous key state.
31 Transition state.</lmisc>
</lparam>
<misc>WM_IME_CHAR Message
Sent to an application when the IME gets a character of the conversion result. A window receives this message through its WindowProc function.
LRESULT CALLBACK WindowProc(
HWND hwnd,
WM_IME_CHAR,
WPARAM wParam,
LPARAM lParam
);
Parameters
hwnd
A handle to window.
WM_IME_CHAR
The WM_IME_CHAR identifier.
wParam
DBCS: A single- or double-byte character value. For a double-byte character, (BYTE)(wParam >> 8) contains the lead byte. Note that the parentheses are necessary because the cast operator has higher precedence than the shift operator.
Unicode: A Unicode character value.
lParam
The repeat count, scan code, extended key flag, context code, previous key state flag, and transition state flag, with values as defined below.
Bit Meaning
0-15 Repeat count. Since the first byte and second byte is continuous, this is always 1.
16-23 Scan code for a complete Asian character.
24 Extended key.
25-28 Not used.
29 Context code.
30 Previous key state.
31 Transition state.
Remarks
Unlike the WM_CHAR message for a non-Unicode window, this message can include double-byte as well as single-byte character values. For a Unicode window, this message is the same as WM_CHAR.
For a non-Unicode window, if the WM_IME_CHAR message includes a double-byte character and the application passes this message to DefWindowProc, the IME converts this message into two WM_CHAR messages, each containing one byte of the double-byte character.
Requirements
Client Requires Windows 7, Windows Vista, Windows XP, Windows 2000 Professional, Windows NT Workstation 4.0, Windows Me/98, Windows 95.
Header Declared in Imm.h; include Windows.h.</misc>
</message>
<message value="0x10F">
<name>WM_IME_COMPOSITION</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Values
This message has no return value.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
DBCS character representing the latest change to the composition string.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Value specifying how the composition string or character changed. This parameter can be one or more of the following values. For more information about these values, see IME Composition String Values.
GCS_COMPATTR
GCS_COMPCLAUSE
GCS_COMPREADSTR
GCS_COMPREADATTR
GCS_COMPREADCLAUSE
GCS_COMPSTR
GCS_CURSORPOS
GCS_DELTASTART
GCS_RESULTCLAUSE
GCS_RESULTREADCLAUSE
GCS_RESULTREADSTR
GCS_RESULTSTR
The lParam parameter can also have one or more of the following values:
Value Meaning
CS_INSERTCHAR Insert the wParam composition character at the current insertion point. An application should display the composition character if it processes this message.
CS_NOMOVECARET Do not move the caret position as a result of processing the message. For example, if an IME specifies a combination of CS_INSERTCHAR and CS_NOMOVECARET, the application should insert the specified character at the current caret position but should not move the caret to the next position. A subsequent WM_IME_COMPOSITION message with GCS_RESULTSTR will replace this character.
</lmisc>
</lparam>
<misc>WM_IME_COMPOSITION
Sent to an application when the IME changes composition status as a result of a keystroke. A window receives this message through its WindowProc function.
LRESULT CALLBACK WindowProc(
HWND hwnd,
WM_IME_COMPOSITION,
WPARAM wParam,
LPARAM lParam
);
Parameters
wParam
DBCS character representing the latest change to the composition string.
lParam
Value specifying how the composition string or character changed. This parameter can be one or more of the following values. For more information about these values, see IME Composition String Values.
GCS_COMPATTR
GCS_COMPCLAUSE
GCS_COMPREADSTR
GCS_COMPREADATTR
GCS_COMPREADCLAUSE
GCS_COMPSTR
GCS_CURSORPOS
GCS_DELTASTART
GCS_RESULTCLAUSE
GCS_RESULTREADCLAUSE
GCS_RESULTREADSTR
GCS_RESULTSTR
The lParam parameter can also have one or more of the following values:
Value Meaning
CS_INSERTCHAR Insert the wParam composition character at the current insertion point. An application should display the composition character if it processes this message.
CS_NOMOVECARET Do not move the caret position as a result of processing the message. For example, if an IME specifies a combination of CS_INSERTCHAR and CS_NOMOVECARET, the application should insert the specified character at the current caret position but should not move the caret to the next position. A subsequent WM_IME_COMPOSITION message with GCS_RESULTSTR will replace this character.
Return Values
This message has no return value.
Remarks
An application should process this message if it displays composition characters itself. Otherwise, it should send the message to the IME window.
If the application has created an IME window, it should pass this message to that window. The DefWindowProc function processes this message by passing it to the default IME window. The IME window processes this message by updating its appearance based on the change flag specified. An application can call ImmGetCompositionString to retrieve the new composition status.
If none of the GCS_ values are set, the message indicates that the current composition has been canceled and applications that draw the composition string should delete the string.
Requirements
Windows NT/2000/XP/Vista: Included in Windows NT 4.0 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Imm.h; include Windows.h.</misc>
</message>
<message value="0x284">
<name>WM_IME_COMPOSITIONFULL</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
This message has no return value.</returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc>This message has no parameters.</wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc>This message has no parameters.</lmisc>
</lparam>
<misc>WM_IME_COMPOSITIONFULL Message
Sent to an application when the IME window finds no space to extend the area for the composition window. A window receives this message through its WindowProc function.
LRESULT CALLBACK WindowProc(
HWND hwnd,
WM_IME_COMPOSITIONFULL,
WPARAM wParam,
LPARAM lParam
);
Parameters
This message has no parameters.
Return Value
This message has no return value.
Remarks
The application should use the IMC_SETCOMPOSITIONWINDOW command to specify how the window should be displayed.
The IME window, instead of the IME, sends this notification message by the SendMessage function.
Requirements
Client Requires Windows 7, Windows Vista, Windows XP, Windows 2000 Professional, Windows NT Workstation 4.0, Windows Me/98, Windows 95.
Header Declared in Imm.h; include Windows.h.</misc>
</message>
<message value="0x283">
<name>WM_IME_CONTROL</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
The message returns a command-specific value.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
The command. This parameter can have one of the following values:
IMC_CLOSESTATUSWINDOW
IMC_GETCANDIDATEPOS
IMC_GETCOMPOSITIONFONT
IMC_GETCOMPOSITIONWINDOW
IMC_GETSTATUSWINDOWPOS
IMC_OPENSTATUSWINDOW
IMC_SETCANDIDATEPOS
IMC_SETCOMPOSITIONFONT
IMC_SETCOMPOSITIONWINDOW
IMC_SETSTATUSWINDOWPOS</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Command-specific data, with format dependent on the value of the wParam parameter. For more information, refer to the documentation for each command.
</lmisc>
</lparam>
<misc>WM_IME_CONTROL Message
Sent by an application to direct the IME window to carry out the requested command. The application uses this message to control the IME window that it has created. To send this message, the application calls the SendMessage function with the following parameters.
SendMessage(
HWND hwnd,
WM_IME_CONTROL,
WPARAM wParam,
LPARAM lParam
);
Parameters
hwnd
Handle to the window.
WM_IME_CONTROL
The WM_IME_CONTROL identifier.
wParam
The command. This parameter can have one of the following values:
IMC_CLOSESTATUSWINDOW
IMC_GETCANDIDATEPOS
IMC_GETCOMPOSITIONFONT
IMC_GETCOMPOSITIONWINDOW
IMC_GETSTATUSWINDOWPOS
IMC_OPENSTATUSWINDOW
IMC_SETCANDIDATEPOS
IMC_SETCOMPOSITIONFONT
IMC_SETCOMPOSITIONWINDOW
IMC_SETSTATUSWINDOWPOS
lParam
Command-specific data, with format dependent on the value of the wParam parameter. For more information, refer to the documentation for each command.
Return Value
The message returns a command-specific value.
Requirements
Client Requires Windows 7, Windows Vista, Windows XP, Windows 2000 Professional, Windows NT Workstation 4.0, Windows Me/98, Windows 95.
Header Declared in Imm.h; include Windows.h.</misc>
</message>
<message value="0x10E">
<name>WM_IME_ENDCOMPOSITION</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
This message has no return value.</returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc>This message has no parameters.</wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc>This message has no parameters.</lmisc>
</lparam>
<misc>WM_IME_ENDCOMPOSITION Message
Sent to an application when the IME ends composition. A window receives this message through its WindowProc function.
LRESULT CALLBACK WindowProc(
HWND hwnd,
WM_IME_ENDCOMPOSITION,
WPARAM wParam,
LPARAM lParam
);
Parameters
This message has no parameters.
Return Value
This message has no return value.
Remarks
An application should process this message if it displays composition characters itself.
If the application has created an IME window, it should pass this message to that window. The DefWindowProc function processes this message by passing it to the default IME window.
Requirements
Client Requires Windows 7, Windows Vista, Windows XP, Windows 2000 Professional, Windows NT Workstation 4.0, Windows Me/98, Windows 95.
Header Declared in Imm.h; include Windows.h.</misc>
</message>
<message value="0x290">
<name>WM_IME_KEYDOWN</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
An application should return 0 if it processes this message.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Virtual key code of the key.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Repeat count, scan code, extended key flag, context code, previous key state flag, and transition state flag, as shown in the following table.
Bit Meaning
0-15 Repeat count.
16-23 Scan code.
24 Extended key. This value is 1 if it is an extended key. Otherwise, it is 0.
25-28 Not used.
29 Context code. This value is always 0.
30 Previous key state. This value is 1 if the key is down or 0 if it is up.
31 Transition state. This value is always 0.</lmisc>
</lparam>
<misc>WM_IME_KEYDOWN Message
Sent to an application by the IME to notify the application of a key press and to keep message order. A window receives this message through its WindowProc function.
LRESULT CALLBACK WindowProc(
HWND hwnd,
WM_IME_KEYDOWN,
WPARAM wParam,
LPARAM lParam
);
Parameters
hwnd
A handle to window.
WM_IME_KEYDOWN
The WM_IME_KEYDOWN identifier.
wParam
Virtual key code of the key.
lParam
Repeat count, scan code, extended key flag, context code, previous key state flag, and transition state flag, as shown in the following table.
Bit Meaning
0-15 Repeat count.
16-23 Scan code.
24 Extended key. This value is 1 if it is an extended key. Otherwise, it is 0.
25-28 Not used.
29 Context code. This value is always 0.
30 Previous key state. This value is 1 if the key is down or 0 if it is up.
31 Transition state. This value is always 0.
Return Value
An application should return 0 if it processes this message.
Remarks
An application can process this message or pass it to the DefWindowProc function to generate a matching WM_KEYDOWN message.
Requirements
Client Requires Windows 7, Windows Vista, Windows XP, Windows 2000 Professional, Windows NT Workstation 4.0, Windows Me/98, Windows 95.
Header Declared in Imm.h; include Windows.h.</misc>
</message>
<message value="0x10F">
<name>WM_IME_KEYLAST</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x291">
<name>WM_IME_KEYUP</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
An application should return 0 if it processes this message.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Virtual key code of the key.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Repeat count, scan code, extended key flag, context code, previous key state flag, and transition state flag, as shown below.
Bit Meaning
0-15 Repeat count. This value is always 1.
16-23 Scan code.
24 Extended key. This value is 1 if it is an extended key. Otherwise, it is 0.
25-28 Not used.
29 Context code. This value is always 0.
30 Previous key state. This value is always 1.
31 Transition state. This value is always 1.</lmisc>
</lparam>
<misc>WM_IME_KEYUP Message
Sent to an application by the IME to notify the application of a key release and to keep message order. A window receives this message through its WindowProc function.
LRESULT CALLBACK WindowProc(
HWND hwnd,
WM_IME_KEYUP,
WPARAM wParam,
LPARAM lParam
);
Parameters
hwnd
A handle to window.
WM_IME_KEYUP
The WM_IME_KEYUP identifier.
wParam
Virtual key code of the key.
lParam
Repeat count, scan code, extended key flag, context code, previous key state flag, and transition state flag, as shown below.
Bit Meaning
0-15 Repeat count. This value is always 1.
16-23 Scan code.
24 Extended key. This value is 1 if it is an extended key. Otherwise, it is 0.
25-28 Not used.
29 Context code. This value is always 0.
30 Previous key state. This value is always 1.
31 Transition state. This value is always 1.
Return Value
An application should return 0 if it processes this message.
Remarks
An application can process this message or pass it to the DefWindowProc function to generate a matching WM_KEYUP message.
Requirements
Client Requires Windows 7, Windows Vista, Windows XP, Windows 2000 Professional, Windows NT Workstation 4.0, Windows Me/98, Windows 95.
Header Declared in Imm.h; include Windows.h.</misc>
</message>
<message value="0x282">
<name>WM_IME_NOTIFY</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
The return value depends on the command sent.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
The command. This parameter can have one of the following values.
IMN_CHANGECANDIDATE
IMN_CLOSECANDIDATE
IMN_CLOSESTATUSWINDOW
IMN_GUIDELINE
IMN_OPENCANDIDATE
IMN_OPENSTATUSWINDOW
IMN_SETCANDIDATEPOS
IMN_SETCOMPOSITIONFONT
IMN_SETCOMPOSITIONWINDOW
IMN_SETCONVERSIONMODE
IMN_SETOPENSTATUS
IMN_SETSENTENCEMODE
IMN_SETSTATUSWINDOWPOS</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Command-specific data, with format dependent on the value of the wParam parameter. For more information, refer to the documentation for each command.
</lmisc>
</lparam>
<misc>WM_IME_NOTIFY Message
Sent to an application to notify it of changes to the IME window. A window receives this message through its WindowProc function.
LRESULT CALLBACK WindowProc(
HWND hwnd,
WM_IME_NOTIFY,
WPARAM wParam,
LPARAM lParam
);
Parameters
hwnd
A handle to window.
WM_IME_NOTIFY
The WM_IME_NOTIFY identifier.
wParam
The command. This parameter can have one of the following values.
IMN_CHANGECANDIDATE
IMN_CLOSECANDIDATE
IMN_CLOSESTATUSWINDOW
IMN_GUIDELINE
IMN_OPENCANDIDATE
IMN_OPENSTATUSWINDOW
IMN_SETCANDIDATEPOS
IMN_SETCOMPOSITIONFONT
IMN_SETCOMPOSITIONWINDOW
IMN_SETCONVERSIONMODE
IMN_SETOPENSTATUS
IMN_SETSENTENCEMODE
IMN_SETSTATUSWINDOWPOS
lParam
Command-specific data, with format dependent on the value of the wParam parameter. For more information, refer to the documentation for each command.
Return Value
The return value depends on the command sent.
Remarks
An application processes this message if it is responsible for managing the IME window.
Requirements
Client Requires Windows 7, Windows Vista, Windows XP, Windows 2000 Professional, Windows NT Workstation 4.0, Windows Me/98, Windows 95.
Header Declared in Imm.h; include Windows.h.</misc>
</message>
<message value="0x280">
<name>WM_IME_REPORT</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x288">
<name>WM_IME_REQUEST</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
Returns a command-specific value.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Command. This parameter can have one of the following values:
IMR_CANDIDATEWINDOW
IMR_COMPOSITIONFONT
IMR_COMPOSITIONWINDOW
IMR_CONFIRMRECONVERTSTRING
IMR_DOCUMENTFEED
IMR_QUERYCHARPOSITION
IMR_RECONVERTSTRING</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Command-specific data. For more information, see the description for each command.</lmisc>
</lparam>
<misc>WM_IME_REQUEST Message
Sent to an application to provide commands and request information. A window receives this message through its WindowProc function.
LRESULT CALLBACK WindowProc(
HWND hwnd,
WM_IME_REQUEST,
WPARAM wParam,
LPARAM lParam
);
Parameters
hwnd
A handle to window.
WM_IME_REQUEST
The WM_IME_REQUEST identifier.
wParam
Command. This parameter can have one of the following values:
IMR_CANDIDATEWINDOW
IMR_COMPOSITIONFONT
IMR_COMPOSITIONWINDOW
IMR_CONFIRMRECONVERTSTRING
IMR_DOCUMENTFEED
IMR_QUERYCHARPOSITION
IMR_RECONVERTSTRING
lParam
Command-specific data. For more information, see the description for each command.
Return Value
Returns a command-specific value.
Requirements
Client Requires Windows 7, Windows Vista, Windows XP, Windows 2000 Professional, Windows NT Workstation 4.0, Windows Me/98, Windows 95.
Header Declared in Imm.h; include Windows.h.</misc>
</message>
<message value="0x285">
<name>WM_IME_SELECT</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
This message has no return value.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Selection indicator. This parameter specifies TRUE if the indicated IME is selected. The parameter is set to FALSE if the specified IME is no longer selected.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Input locale identifier associated with the IME.
</lmisc>
</lparam>
<misc>WM_IME_SELECT Message
Sent to an application when the operating system is about to change the current IME. A window receives this message through its WindowProc function.
LRESULT CALLBACK WindowProc(
HWND hwnd,
WM_IME_SELECT,
WPARAM wParam,
LPARAM lParam
);
Parameters
hwnd
A handle to window.
WM_IME_SELECT
The WM_IME_SELECT identifier.
wParam
Selection indicator. This parameter specifies TRUE if the indicated IME is selected. The parameter is set to FALSE if the specified IME is no longer selected.
lParam
Input locale identifier associated with the IME.
Return Value
This message has no return value.
Remarks
An application that has created an IME window should pass this message to that window so that it can retrieve the keyboard layout handle to the newly selected IME.
The DefWindowProc function processes this message by passing the information to the default IME window.
Requirements
Client Requires Windows 7, Windows Vista, Windows XP, Windows 2000 Professional, Windows NT Workstation 4.0, Windows Me/98, Windows 95.
Header Declared in Imm.h; include Windows.h.</misc>
</message>
<message value="0x281">
<name>WM_IME_SETCONTEXT</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
Returns the value returned by DefWindowProc or ImmIsUIMessage.</returnmisc>
</return>
<wparam value="BOOL">
<wname>wParam</wname>
<wmisc>wParam
TRUE if the window is active, and FALSE otherwise.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Display options. This parameter can have one or more of the following values.
Value Description
ISC_SHOWUICOMPOSITIONWINDOW Show the composition window by user interface window.
ISC_SHOWUIGUIDWINDOW Show the guide window by user interface window.
ISC_SHOWUISOFTKBD Show the soft keyboard by user interface window.
ISC_SHOWUICANDIDATEWINDOW Show the candidate window of index 0 by user interface window.
ISC_SHOWUICANDIDATEWINDOW 1 Show the candidate window of index 1 by user interface window.
ISC_SHOWUICANDIDATEWINDOW 2 Show the candidate window of index 2 by user interface window.
ISC_SHOWUICANDIDATEWINDOW 3 Show the candidate window of index 3 by user interface window.</lmisc>
</lparam>
<misc>WM_IME_SETCONTEXT Message
Sent to an application when a window is activated. A window receives this message through its WindowProc function.
LRESULT CALLBACK WindowProc(
HWND hwnd,
WM_IME_SETCONTEXT,
WPARAM wParam,
LPARAM lParam
);
Parameters
hwnd
A handle to window.
WM_IME_SETCONTEXT
The WM_IME_SETCONTEXT identifier.
wParam
TRUE if the window is active, and FALSE otherwise.
lParam
Display options. This parameter can have one or more of the following values.
Value Description
ISC_SHOWUICOMPOSITIONWINDOW Show the composition window by user interface window.
ISC_SHOWUIGUIDWINDOW Show the guide window by user interface window.
ISC_SHOWUISOFTKBD Show the soft keyboard by user interface window.
ISC_SHOWUICANDIDATEWINDOW Show the candidate window of index 0 by user interface window.
ISC_SHOWUICANDIDATEWINDOW 1 Show the candidate window of index 1 by user interface window.
ISC_SHOWUICANDIDATEWINDOW 2 Show the candidate window of index 2 by user interface window.
ISC_SHOWUICANDIDATEWINDOW 3 Show the candidate window of index 3 by user interface window.
Return Value
Returns the value returned by DefWindowProc or ImmIsUIMessage.
Remarks
If the application has created an IME window, it should call ImmIsUIMessage. Otherwise, it should pass this message to DefWindowProc.
If the application draws the composition window, the default IME window does not have to show its composition window. In this case, the application must clear the ISC_SHOWUICOMPOSITIONWINDOW value from the lParam parameter before passing the message to DefWindowProc or ImmIsUIMessage. To display a certain user interface window, an application should remove the corresponding value so that the IME will not display it.
Requirements
Client Requires Windows 7, Windows Vista, Windows XP, Windows 2000 Professional, Windows NT Workstation 4.0, Windows Me/98, Windows 95.
Header Declared in Imm.h; include Windows.h.</misc>
</message>
<message value="0x10D">
<name>WM_IME_STARTCOMPOSITION</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
This message has no return value.</returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc>This message has no parameters.</wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc>This message has no parameters.</lmisc>
</lparam>
<misc>WM_IME_STARTCOMPOSITION Message
Sent immediately before the IME generates the composition string as a result of a keystroke. A window receives this message through its WindowProc function.
LRESULT CALLBACK WindowProc(
HWND hwnd,
WM_IME_STARTCOMPOSITION,
WPARAM wParam,
LPARAM lParam
);
Parameters
This message has no parameters.
Return Value
This message has no return value.
Remarks
This message is a notification to an IME window to open its composition window. An application should process this message if it displays composition characters itself.
If an application has created an IME window, it should pass this message to that window. The DefWindowProc function processes the message by passing it to the default IME window.
Requirements
Client Requires Windows 7, Windows Vista, Windows XP, Windows 2000 Professional, Windows NT Workstation 4.0, Windows Me/98, Windows 95.
Header Declared in Imm.h; include Windows.h.</misc>
</message>
<message value="0x290">
<name>WM_IMEKEYDOWN</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x291">
<name>WM_IMEKEYUP</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x110">
<name>WM_INITDIALOG</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
The dialog box procedure should return TRUE to direct the system to set the keyboard focus to the control specified by wParam. Otherwise, it should return FALSE to prevent the system from setting the default keyboard focus.
The dialog box procedure should return the value directly. The DWL_MSGRESULT value set by the SetWindowLong function is ignored.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Handle to the control to receive the default keyboard focus. The system assigns the default keyboard focus only if the dialog box procedure returns TRUE.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Specifies additional initialization data. This data is passed to the system as the lParam parameter in a call to the CreateDialogIndirectParam, CreateDialogParam, DialogBoxIndirectParam, or DialogBoxParam function used to create the dialog box. For property sheets, this parameter is a pointer to the PROPSHEETPAGE structure used to create the page. This parameter is zero if any other dialog box creation function is used.
</lmisc>
</lparam>
<misc>WM_INITDIALOG Notification
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.
Syntax
WM_INITDIALOG
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Handle to the control to receive the default keyboard focus. The system assigns the default keyboard focus only if the dialog box procedure returns TRUE.
lParam
Specifies additional initialization data. This data is passed to the system as the lParam parameter in a call to the CreateDialogIndirectParam, CreateDialogParam, DialogBoxIndirectParam, or DialogBoxParam function used to create the dialog box. For property sheets, this parameter is a pointer to the PROPSHEETPAGE structure used to create the page. This parameter is zero if any other dialog box creation function is used.
Return Value
The dialog box procedure should return TRUE to direct the system to set the keyboard focus to the control specified by wParam. Otherwise, it should return FALSE to prevent the system from setting the default keyboard focus.
The dialog box procedure should return the value directly. The DWL_MSGRESULT value set by the SetWindowLong function is ignored.
Remarks
The control to receive the default keyboard focus is always the first control in the dialog box that is visible, not disabled, and that has the WS_TABSTOP style. When the dialog box procedure returns TRUE, the system checks the control to ensure that the procedure has not disabled it. If it has been disabled, the system sets the keyboard focus to the next control that is visible, not disabled, and has the WS_TABSTOP.
An application can return FALSE only if it has set the keyboard focus to one of the controls of the dialog box.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x116">
<name>WM_INITMENU</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
If an application processes this message, it should return zero. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Handle to the menu to be initialized.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used. </lmisc>
</lparam>
<misc>WM_INITMENU Message
The WM_INITMENU message is sent when a menu is about to become active. It occurs when the user clicks an item on the menu bar or presses a menu key. This allows the application to modify the menu before it is displayed.
A window receives this message through its WindowProc function.
Syntax
WM_INITMENU
WPARAM wParam
LPARAM lParam
Parameters
wParam
Handle to the menu to be initialized.
lParam
This parameter is not used.
Return Value
If an application processes this message, it should return zero.
Remarks
A WM_INITMENU message is sent only when a menu is first accessed; only one WM_INITMENU message is generated for each access. For example, moving the mouse across several menu items while holding down the button does not generate new messages. WM_INITMENU does not provide information about menu items.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x117">
<name>WM_INITMENUPOPUP</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
If an application processes this message, it should return zero. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Handle to the drop-down menu or submenu. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
The low-order word specifies the zero-based relative position of the menu item that opens the drop-down menu or submenu.
The high-order word indicates whether the drop-down menu is the window menu. If the menu is the window menu, this parameter is TRUE; otherwise, it is FALSE.
</lmisc>
</lparam>
<misc>WM_INITMENUPOPUP Notification
The WM_INITMENUPOPUP message is sent when a drop-down menu or submenu is about to become active. This allows an application to modify the menu before it is displayed, without changing the entire menu.
Syntax
WM_INITMENUPOPUP
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Handle to the drop-down menu or submenu.
lParam
The low-order word specifies the zero-based relative position of the menu item that opens the drop-down menu or submenu.
The high-order word indicates whether the drop-down menu is the window menu. If the menu is the window menu, this parameter is TRUE; otherwise, it is FALSE.
Return Value
If an application processes this message, it should return zero.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x51">
<name>WM_INPUTLANGCHANGE</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
An application should return nonzero if it processes this message.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the character set of the new locale. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Input locale identifier. For more information, see Languages, Locales, and Keyboard Layouts. </lmisc>
</lparam>
<misc>WM_INPUTLANGCHANGE Notification
The WM_INPUTLANGCHANGE message is sent to the topmost affected window after an application's input language has been changed. You should make any application-specific settings and pass the message to the DefWindowProc function, which passes the message to all first-level child windows. These child windows can pass the message to DefWindowProc to have it pass the message to their child windows, and so on.
A window receives this message through its WindowProc function.
Syntax
WM_INPUTLANGCHANGE
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Specifies the character set of the new locale.
lParam
Input locale identifier. For more information, see Languages, Locales, and Keyboard Layouts.
Return Value
An application should return nonzero if it processes this message.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0x50">
<name>WM_INPUTLANGCHANGEREQUEST</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
This message is posted, not sent, to the application, so the return value is ignored. To accept the change, the application should pass the message to DefWindowProc. To reject the change, the application should return zero without calling DefWindowProc.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Information about the new input locale. This parameter can be a combination of the following flags.
INPUTLANGCHANGE_BACKWARD
Windows 2000/XP: A hot key was used to choose the previous input locale in the installed list of input locales. This flag cannot be used with the INPUTLANGCHANGE_FORWARD flag.
INPUTLANGCHANGE_FORWARD
Windows 2000/XP: A hot key was used to choose the next input locale in the installed list of input locales. This flag cannot be used with the INPUTLANGCHANGE_BACKWARD flag.
INPUTLANGCHANGE_SYSCHARSET
Windows 2000/XP: The new input locale's keyboard layout can be used with the system character set.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Input locale identifier. For more information, see Languages, Locales, and Keyboard Layouts.
</lmisc>
</lparam>
<misc>WM_INPUTLANGCHANGEREQUEST Notification
The WM_INPUTLANGCHANGEREQUEST message is posted to the window with the focus when the user chooses a new input language, either with the hotkey (specified in the Keyboard control panel application) or from the indicator on the system taskbar. An application can accept the change by passing the message to the DefWindowProc function or reject the change (and prevent it from taking place) by returning immediately.
A window receives this message through its WindowProc function.
Syntax
WM_INPUTLANGCHANGEREQUEST
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Information about the new input locale. This parameter can be a combination of the following flags.
INPUTLANGCHANGE_BACKWARD
Windows 2000/XP: A hot key was used to choose the previous input locale in the installed list of input locales. This flag cannot be used with the INPUTLANGCHANGE_FORWARD flag.
INPUTLANGCHANGE_FORWARD
Windows 2000/XP: A hot key was used to choose the next input locale in the installed list of input locales. This flag cannot be used with the INPUTLANGCHANGE_BACKWARD flag.
INPUTLANGCHANGE_SYSCHARSET
Windows 2000/XP: The new input locale's keyboard layout can be used with the system character set.
lParam
Input locale identifier. For more information, see Languages, Locales, and Keyboard Layouts.
Return Value
This message is posted, not sent, to the application, so the return value is ignored. To accept the change, the application should pass the message to DefWindowProc. To reject the change, the application should return zero without calling DefWindowProc.
Remarks
When the DefWindowProc function receives the WM_INPUTLANGCHANGEREQUEST message, it activates the new input locale and notifies the application of the change by sending the WM_INPUTLANGCHANGE message.
The language indicator is present on the taskbar only if you have installed more than one keyboard layout and if you have enabled the indicator using the Keyboard control panel application.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0x10C">
<name>WM_INTERIM</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x100">
<name>WM_KEYDOWN</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
An application should return zero if it processes this message. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the virtual-key code of the nonsystem key. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Specifies the repeat count, scan code, extended-key flag, context code, previous key-state flag, and transition-state flag, as shown in the following table.
0-15
Specifies the repeat count for the current message. The value is the number of times the keystroke is autorepeated as a result of the user holding down the key. If the keystroke is held long enough, multiple messages are sent. However, the repeat count is not cumulative.
16-23
Specifies the scan code. The value depends on the OEM.
24
Specifies whether the key is an extended key, such as the right-hand ALT and CTRL keys that appear on an enhanced 101- or 102-key keyboard. The value is 1 if it is an extended key; otherwise, it is 0.
25-28
Reserved; do not use.
29
Specifies the context code. The value is always 0 for a WM_KEYDOWN message.
30
Specifies the previous key state. The value is 1 if the key is down before the message is sent, or it is zero if the key is up.
31
Specifies the transition state. The value is always zero for a WM_KEYDOWN message.</lmisc>
</lparam>
<misc>WM_KEYDOWN Notification
The WM_KEYDOWN message is posted to the window with the keyboard focus when a nonsystem key is pressed. A nonsystem key is a key that is pressed when the ALT key is not pressed.
Syntax
WM_KEYDOWN
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Specifies the virtual-key code of the nonsystem key.
lParam
Specifies the repeat count, scan code, extended-key flag, context code, previous key-state flag, and transition-state flag, as shown in the following table.
0-15
Specifies the repeat count for the current message. The value is the number of times the keystroke is autorepeated as a result of the user holding down the key. If the keystroke is held long enough, multiple messages are sent. However, the repeat count is not cumulative.
16-23
Specifies the scan code. The value depends on the OEM.
24
Specifies whether the key is an extended key, such as the right-hand ALT and CTRL keys that appear on an enhanced 101- or 102-key keyboard. The value is 1 if it is an extended key; otherwise, it is 0.
25-28
Reserved; do not use.
29
Specifies the context code. The value is always 0 for a WM_KEYDOWN message.
30
Specifies the previous key state. The value is 1 if the key is down before the message is sent, or it is zero if the key is up.
31
Specifies the transition state. The value is always zero for a WM_KEYDOWN message.
Return Value
An application should return zero if it processes this message.
Remarks
If the F10 key is pressed, the DefWindowProc function sets an internal flag. When DefWindowProc receives the WM_KEYUP message, the function checks whether the internal flag is set and, if so, sends a WM_SYSCOMMAND message to the top-level window. The WM_SYSCOMMAND parameter of the message is set to SC_KEYMENU.
Because of the autorepeat feature, more than one WM_KEYDOWN message may be posted before a WM_KEYUP message is posted. The previous key state (bit 30) can be used to determine whether the WM_KEYDOWN message indicates the first down transition or a repeated down transition.
For enhanced 101- and 102-key keyboards, extended keys are the right ALT and CTRL keys on the main section of the keyboard; the INS, DEL, HOME, END, PAGE UP, PAGE DOWN, and arrow keys in the clusters to the left of the numeric keypad; and the divide (/) and ENTER keys in the numeric keypad. Other keyboards may support the extended-key bit in the lParam parameter.
Windows 2000/XP: Applications must pass wParam to TranslateMessage without altering it at all.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x100">
<name>WM_KEYFIRST</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used.</lmisc>
</lparam>
<misc> WM_KEYFIRST
Windows Mobile Not SupportedWindows Embedded CE Supported
8/28/2008
This message filters for keyboard messages.
Syntax
Copy Code
WM_KEYFIRST wParam = 0;
lParam = 0;
Parameters
wParam
Not used.
lParam
Not used.
Return Value
None.
Remarks
Use the WM_KEYFIRST and WM_KEYLAST messages to filter for keyboard messages when using the GetMessage and PeekMessage functions.
Requirements
Header winuser.h
Windows Embedded CE Windows CE 1.0 and later</misc>
</message>
<message value="0x108">
<name>WM_KEYLAST</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used.</lmisc>
</lparam>
<misc> WM_KEYLAST
Windows Mobile Not SupportedWindows Embedded CE Supported
8/28/2008
This message filters for keyboard messages.
Syntax
Copy Code
WM_KEYLAST wParam = 0;
lParam = 0;
Parameters
wParam
Not used.
lParam
Not used.
Return Value
None.
Remarks
Use the WM_KEYFIRST and WM_KEYLAST messages to filter for keyboard messages when using the GetMessage and PeekMessage functions.
Requirements
Header winuser.h
Windows Embedded CE Windows CE 1.0 and later</misc>
</message>
<message value="0x101">
<name>WM_KEYUP</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
An application should return zero if it processes this message.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the virtual-key code of the nonsystem key. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Specifies the repeat count, scan code, extended-key flag, context code, previous key-state flag, and transition-state flag, as shown in the following table.
0-15
Specifies the repeat count for the current message. The value is the number of times the keystroke is autorepeated as a result of the user holding down the key. The repeat count is always one for a WM_KEYUP message.
16-23
Specifies the scan code. The value depends on the OEM.
24
Specifies whether the key is an extended key, such as the right-hand ALT and CTRL keys that appear on an enhanced 101- or 102-key keyboard. The value is 1 if it is an extended key; otherwise, it is 0.
25-28
Reserved; do not use.
29
Specifies the context code. The value is always 0 for a WM_KEYUP message.
30
Specifies the previous key state. The value is always 1 for a WM_KEYUP message.
31
Specifies the transition state. The value is always 1 for a WM_KEYUP message.</lmisc>
</lparam>
<misc>WM_KEYUP Notification
The WM_KEYUP message is posted to the window with the keyboard focus when a nonsystem key is released. A nonsystem key is a key that is pressed when the ALT key is not pressed, or a keyboard key that is pressed when a window has the keyboard focus.
Syntax
WM_KEYUP
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Specifies the virtual-key code of the nonsystem key.
lParam
Specifies the repeat count, scan code, extended-key flag, context code, previous key-state flag, and transition-state flag, as shown in the following table.
0-15
Specifies the repeat count for the current message. The value is the number of times the keystroke is autorepeated as a result of the user holding down the key. The repeat count is always one for a WM_KEYUP message.
16-23
Specifies the scan code. The value depends on the OEM.
24
Specifies whether the key is an extended key, such as the right-hand ALT and CTRL keys that appear on an enhanced 101- or 102-key keyboard. The value is 1 if it is an extended key; otherwise, it is 0.
25-28
Reserved; do not use.
29
Specifies the context code. The value is always 0 for a WM_KEYUP message.
30
Specifies the previous key state. The value is always 1 for a WM_KEYUP message.
31
Specifies the transition state. The value is always 1 for a WM_KEYUP message.
Return Value
An application should return zero if it processes this message.
Remarks
The DefWindowProc function sends a WM_SYSCOMMAND message to the top-level window if the F10 key or the ALT key was released. The wParam parameter of the message is set to SC_KEYMENU.
For enhanced 101- and 102-key keyboards, extended keys are the right ALT and CTRL keys on the main section of the keyboard; the INS, DEL, HOME, END, PAGE UP, PAGE DOWN, and arrow keys in the clusters to the left of the numeric keypad; and the divide (/) and ENTER keys in the numeric keypad. Other keyboards may support the extended-key bit in the lParam parameter.
Windows 2000/XP: Applications must pass wParam to TranslateMessage without altering it at all.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x8">
<name>WM_KILLFOCUS</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
An application should return zero if it processes this message. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Handle to the window that receives the keyboard focus. This parameter can be NULL. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used. </lmisc>
</lparam>
<misc>WM_KILLFOCUS Notification
The WM_KILLFOCUS message is sent to a window immediately before it loses the keyboard focus.
Syntax
WM_KILLFOCUS
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Handle to the window that receives the keyboard focus. This parameter can be NULL.
lParam
This parameter is not used.
Return Value
An application should return zero if it processes this message.
Remarks
If an application is displaying a caret, the caret should be destroyed at this point.
While processing this message, do not make any function calls that display or activate a window. This causes the thread to yield control and can cause the application to stop responding to messages. For more information, see Message Deadlocks.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x203">
<name>WM_LBUTTONDBLCLK</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Indicates whether various virtual keys are down. This parameter can be one or more of the following values.
MK_CONTROL
The CTRL key is down.
MK_LBUTTON
The left mouse button is down.
MK_MBUTTON
The middle mouse button is down.
MK_RBUTTON
The right mouse button is down.
MK_SHIFT
The SHIFT key is down.
MK_XBUTTON1
Windows 2000/XP: The first X button is down.
MK_XBUTTON2
Windows 2000/XP: The second X button is down.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
The low-order word specifies the x-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
The high-order word specifies the y-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
</lmisc>
</lparam>
<misc>WM_LBUTTONDBLCLK Notification
The WM_LBUTTONDBLCLK message is posted when the user double-clicks the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
A window receives this message through its WindowProc function.
Syntax
WM_LBUTTONDBLCLK
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Indicates whether various virtual keys are down. This parameter can be one or more of the following values.
MK_CONTROL
The CTRL key is down.
MK_LBUTTON
The left mouse button is down.
MK_MBUTTON
The middle mouse button is down.
MK_RBUTTON
The right mouse button is down.
MK_SHIFT
The SHIFT key is down.
MK_XBUTTON1
Windows 2000/XP: The first X button is down.
MK_XBUTTON2
Windows 2000/XP: The second X button is down.
lParam
The low-order word specifies the x-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
The high-order word specifies the y-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
Return Value
Remarks
Use the following code to obtain the horizontal and vertical position:
Copy Code
xPos = GET_X_LPARAM(lParam);
yPos = GET_Y_LPARAM(lParam);
You can also use the MAKEPOINTS macro to convert the lParam parameter to a POINTS structure.
Only windows that have the CS_DBLCLKS style can receive WM_LBUTTONDBLCLK messages, which the system generates whenever the user presses, releases, and again presses the left mouse button within the system's double-click time limit. Double-clicking the left mouse button actually generates a sequence of four messages: WM_LBUTTONDOWN, WM_LBUTTONUP, WM_LBUTTONDBLCLK, and WM_LBUTTONUP.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x201">
<name>WM_LBUTTONDOWN</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Indicates whether various virtual keys are down. This parameter can be one or more of the following values.
MK_CONTROL
The CTRL key is down.
MK_LBUTTON
The left mouse button is down.
MK_MBUTTON
The middle mouse button is down.
MK_RBUTTON
The right mouse button is down.
MK_SHIFT
The SHIFT key is down.
MK_XBUTTON1
Windows 2000/XP: The first X button is down.
MK_XBUTTON2
Windows 2000/XP: The second X button is down.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
The low-order word specifies the x-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
The high-order word specifies the y-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
</lmisc>
</lparam>
<misc>WM_LBUTTONDOWN Notification
The WM_LBUTTONDOWN message is posted when the user presses the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
A window receives this message through its WindowProc function.
Syntax
WM_LBUTTONDOWN
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Indicates whether various virtual keys are down. This parameter can be one or more of the following values.
MK_CONTROL
The CTRL key is down.
MK_LBUTTON
The left mouse button is down.
MK_MBUTTON
The middle mouse button is down.
MK_RBUTTON
The right mouse button is down.
MK_SHIFT
The SHIFT key is down.
MK_XBUTTON1
Windows 2000/XP: The first X button is down.
MK_XBUTTON2
Windows 2000/XP: The second X button is down.
lParam
The low-order word specifies the x-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
The high-order word specifies the y-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
Return Value
Remarks
Use the following code to obtain the horizontal and vertical position:
Copy Code
xPos = GET_X_LPARAM(lParam);
yPos = GET_Y_LPARAM(lParam);
You can also use the MAKEPOINTS macro to convert the lParam parameter to a POINTS structure.
To detect that the ALT key was pressed, check whether GetKeyState(VK_MENU) 0. Note, this must not be GetAsyncKeyState.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1
See Also</misc>
</message>
<message value="0x202">
<name>WM_LBUTTONUP</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Indicates whether various virtual keys are down. This parameter can be one or more of the following values.
MK_CONTROL
The CTRL key is down.
MK_MBUTTON
The middle mouse button is down.
MK_RBUTTON
The right mouse button is down.
MK_SHIFT
The SHIFT key is down.
MK_XBUTTON1
Windows 2000/XP: The first X button is down.
MK_XBUTTON2
Windows 2000/XP: The second X button is down.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
The low-order word specifies the x-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
The high-order word specifies the y-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
</lmisc>
</lparam>
<misc>WM_LBUTTONUP Notification
The WM_LBUTTONUP message is posted when the user releases the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
A window receives this message through its WindowProc function.
Syntax
WM_LBUTTONUP
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Indicates whether various virtual keys are down. This parameter can be one or more of the following values.
MK_CONTROL
The CTRL key is down.
MK_MBUTTON
The middle mouse button is down.
MK_RBUTTON
The right mouse button is down.
MK_SHIFT
The SHIFT key is down.
MK_XBUTTON1
Windows 2000/XP: The first X button is down.
MK_XBUTTON2
Windows 2000/XP: The second X button is down.
lParam
The low-order word specifies the x-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
The high-order word specifies the y-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
Return Value
Remarks
Use the following code to obtain the horizontal and vertical position:
Copy Code
xPos = GET_X_LPARAM(lParam);
yPos = GET_Y_LPARAM(lParam);
You can also use the MAKEPOINTS macro to convert the lParam parameter to a POINTS structure.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x209">
<name>WM_MBUTTONDBLCLK</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Indicates whether various virtual keys are down. This parameter can be one or more of the following values.
MK_CONTROL
The CTRL key is down.
MK_LBUTTON
The left mouse button is down.
MK_MBUTTON
The middle mouse button is down.
MK_RBUTTON
The right mouse button is down.
MK_SHIFT
The SHIFT key is down.
MK_XBUTTON1
Windows 2000/XP: The first X button is down.
MK_XBUTTON2
Windows 2000/XP: The second X button is down.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
The low-order word specifies the x-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
The high-order word specifies the y-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
</lmisc>
</lparam>
<misc>WM_MBUTTONDBLCLK Notification
The WM_MBUTTONDBLCLK message is posted when the user double-clicks the middle mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
A window receives this message through its WindowProc function.
Syntax
WM_MBUTTONDBLCLK
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Indicates whether various virtual keys are down. This parameter can be one or more of the following values.
MK_CONTROL
The CTRL key is down.
MK_LBUTTON
The left mouse button is down.
MK_MBUTTON
The middle mouse button is down.
MK_RBUTTON
The right mouse button is down.
MK_SHIFT
The SHIFT key is down.
MK_XBUTTON1
Windows 2000/XP: The first X button is down.
MK_XBUTTON2
Windows 2000/XP: The second X button is down.
lParam
The low-order word specifies the x-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
The high-order word specifies the y-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
Return Value
Remarks
Use the following code to obtain the horizontal and vertical position:
Copy Code
xPos = GET_X_LPARAM(lParam);
yPos = GET_Y_LPARAM(lParam);
You can also use the MAKEPOINTS macro to convert the lParam parameter to a POINTS structure.
Only windows that have the CS_DBLCLKS style can receive WM_MBUTTONDBLCLK messages, which the system generates when the user presses, releases, and again presses the middle mouse button within the system's double-click time limit. Double-clicking the middle mouse button actually generates four messages: WM_MBUTTONDOWN, WM_MBUTTONUP, WM_MBUTTONDBLCLK, and WM_MBUTTONUP again.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x207">
<name>WM_MBUTTONDOWN</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Indicates whether various virtual keys are down. This parameter can be one or more of the following values.
MK_CONTROL
The CTRL key is down.
MK_LBUTTON
The left mouse button is down.
MK_MBUTTON
The middle mouse button is down.
MK_RBUTTON
The right mouse button is down.
MK_SHIFT
The SHIFT key is down.
MK_XBUTTON1
Windows 2000/XP: The first X button is down.
MK_XBUTTON2
Windows 2000/XP: The second X button is down.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
The low-order word specifies the x-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
The high-order word specifies the y-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
</lmisc>
</lparam>
<misc>WM_MBUTTONDOWN Notification
The WM_MBUTTONDOWN message is posted when the user presses the middle mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
A window receives this message through its WindowProc function.
Syntax
WM_MBUTTONDOWN
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Indicates whether various virtual keys are down. This parameter can be one or more of the following values.
MK_CONTROL
The CTRL key is down.
MK_LBUTTON
The left mouse button is down.
MK_MBUTTON
The middle mouse button is down.
MK_RBUTTON
The right mouse button is down.
MK_SHIFT
The SHIFT key is down.
MK_XBUTTON1
Windows 2000/XP: The first X button is down.
MK_XBUTTON2
Windows 2000/XP: The second X button is down.
lParam
The low-order word specifies the x-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
The high-order word specifies the y-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
Return Value
Remarks
Use the following code to obtain the horizontal and vertical position:
Copy Code
xPos = GET_X_LPARAM(lParam);
yPos = GET_Y_LPARAM(lParam);
You can also use the MAKEPOINTS macro to convert the lParam parameter to a POINTS structure.
To detect that the ALT key was pressed, check whether GetKeyState(VK_MENU) 0. Note, this must not be GetAsyncKeyState.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x208">
<name>WM_MBUTTONUP</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Indicates whether various virtual keys are down. This parameter can be one or more of the following values.
MK_CONTROL
The CTRL key is down.
MK_LBUTTON
The left mouse button is down.
MK_MBUTTON
The middle mouse button is down.
MK_RBUTTON
The right mouse button is down.
MK_SHIFT
The SHIFT key is down.
MK_XBUTTON1
Windows 2000/XP: The first X button is down.
MK_XBUTTON2
Windows 2000/XP: The second X button is down.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
The low-order word specifies the x-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
The high-order word specifies the y-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
Note that when a shortcut menu is present (displayed), coordinates are relative to the screen, not the client area. Because TrackPopupMenu is an asynchronous call and the WM_MBUTTONUP notification does not have a special flag indicating coordinate derivation, an application cannot tell if the x,y coordinates contained in lParam are relative to the screen or the client area.
</lmisc>
</lparam>
<misc>WM_MBUTTONUP Notification
The WM_MBUTTONUP message is posted when the user releases the middle mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
A window receives this message through its WindowProc function.
Syntax
WM_MBUTTONUP
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Indicates whether various virtual keys are down. This parameter can be one or more of the following values.
MK_CONTROL
The CTRL key is down.
MK_LBUTTON
The left mouse button is down.
MK_MBUTTON
The middle mouse button is down.
MK_RBUTTON
The right mouse button is down.
MK_SHIFT
The SHIFT key is down.
MK_XBUTTON1
Windows 2000/XP: The first X button is down.
MK_XBUTTON2
Windows 2000/XP: The second X button is down.
lParam
The low-order word specifies the x-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
The high-order word specifies the y-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
Note that when a shortcut menu is present (displayed), coordinates are relative to the screen, not the client area. Because TrackPopupMenu is an asynchronous call and the WM_MBUTTONUP notification does not have a special flag indicating coordinate derivation, an application cannot tell if the x,y coordinates contained in lParam are relative to the screen or the client area.
Return Value
Remarks
Use the following code to obtain the horizontal and vertical position:
Copy Code
xPos = GET_X_LPARAM(lParam);
yPos = GET_Y_LPARAM(lParam);
You can also use the MAKEPOINTS macro to convert the lParam parameter to a POINTS structure.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x222">
<name>WM_MDIACTIVATE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
If an application sends this message to an MDI client window, the return value is zero.
</returnmisc>
</return>
<wparam value="HWND">
<wname>wParam</wname>
<wmisc>wParam
Handle to the MDI child window to be activated.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used. </lmisc>
</lparam>
<misc>WM_MDIACTIVATE Message
An application sends the WM_MDIACTIVATE message to a multiple-document interface (MDI) client window to instruct the client window to activate a different MDI child window.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) WM_MDIACTIVATE, // message ID
(WPARAM) wParam, // = (WPARAM) (HWND) wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Handle to the MDI child window to be activated.
lParam
This parameter is not used.
Return Value
If an application sends this message to an MDI client window, the return value is zero.
An MDI child window should return zero if it processes this message.
Remarks
As the client window processes this message, it sends WM_MDIACTIVATE to the child window being deactivated and to the child window being activated. The message parameters received by an MDI child window are as follows:
wParam
Handle to the MDI child window being deactivated.
lParam
Handle to the MDI child window being activated.
An MDI child window is activated independently of the MDI frame window. When the frame window becomes active, the child window last activated by using the WM_MDIACTIVATE message receives the WM_NCACTIVATE message to draw an active window frame and title bar; the child window does not receive another WM_MDIACTIVATE message.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x227">
<name>WM_MDICASCADE</name>
<return value="BOOL">
<returninfo>returns BOOL in lResult</returninfo>
<returnmisc>Return Value
If the message succeeds, the return value is TRUE.
If the message fails, the return value is FALSE. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the cascade behavior. This parameter can be one or more of the following values.
MDITILE_SKIPDISABLED
Prevents disabled MDI child windows from being cascaded.
MDITILE_ZORDER
Windows 2000/XP: Arranges the windows in Z order.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used. </lmisc>
</lparam>
<misc>WM_MDICASCADE Message
An application sends the WM_MDICASCADE message to a multiple-document interface (MDI) client window to arrange all its child windows in a cascade format.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns BOOL in lResult
(HWND) hWndControl, // handle to destination control
(UINT) WM_MDICASCADE, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Specifies the cascade behavior. This parameter can be one or more of the following values.
MDITILE_SKIPDISABLED
Prevents disabled MDI child windows from being cascaded.
MDITILE_ZORDER
Windows 2000/XP: Arranges the windows in Z order.
lParam
This parameter is not used.
Return Value
If the message succeeds, the return value is TRUE.
If the message fails, the return value is FALSE.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x220">
<name>WM_MDICREATE</name>
<return value="HWND">
<returninfo>returns HWND in lResult</returninfo>
<returnmisc>Return Value
If the message succeeds, the return value is the handle to the new child window.
If the message fails, the return value is NULL. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used. </wmisc>
</wparam>
<lparam value="LPMDICREATESTRUCT">
<lname>lParam</lname>
<lmisc>lParam
Pointer to an MDICREATESTRUCT structure containing information that the system uses to create the MDI child window.
</lmisc>
</lparam>
<misc>WM_MDICREATE Message
An application sends the WM_MDICREATE message to a multiple-document interface (MDI) client window to create an MDI child window.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns HWND in lResult
(HWND) hWndControl, // handle to destination control
(UINT) WM_MDICREATE, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) (LPMDICREATESTRUCT) lParam;
);
Parameters
wParam
This parameter is not used.
lParam
Pointer to an MDICREATESTRUCT structure containing information that the system uses to create the MDI child window.
Return Value
If the message succeeds, the return value is the handle to the new child window.
If the message fails, the return value is NULL.
Remarks
The MDI child window is created with the style bits WS_CHILD, WS_CLIPSIBLINGS, WS_CLIPCHILDREN, WS_SYSMENU, WS_CAPTION, WS_THICKFRAME, WS_MINIMIZEBOX, and WS_MAXIMIZEBOX, plus additional style bits specified in the MDICREATESTRUCT structure. The system adds the title of the new child window to the window menu of the frame window. An application should use this message to create all child windows of the client window.
If an MDI client window receives any message that changes the activation of its child windows while the active child window is maximized, the system restores the active child window and maximizes the newly activated child window.
When an MDI child window is created, the system sends the WM_CREATE message to the window. The lParam parameter of the WM_CREATE message contains a pointer to a CREATESTRUCT structure. The lpCreateParams member of this structure contains a pointer to the MDICREATESTRUCT structure passed with the WM_MDICREATE message that created the MDI child window.
An application should not send a second WM_MDICREATE message while a WM_MDICREATE message is still being processed. For example, it should not send a WM_MDICREATE message while an MDI child window is processing its WM_MDICREATE message.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x221">
<name>WM_MDIDESTROY</name>
<return value="">
<returninfo>returns zero in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="HWND">
<wname>wParam</wname>
<wmisc>wParam
Handle to the MDI child window to be closed. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used. </lmisc>
</lparam>
<misc>WM_MDIDESTROY Message
An application sends the WM_MDIDESTROY message to a multiple-document interface (MDI) client window to close an MDI child window.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns zero in lResult
(HWND) hWndControl, // handle to destination control
(UINT) WM_MDIDESTROY, // message ID
(WPARAM) wParam, // = (WPARAM) (HWND) wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Handle to the MDI child window to be closed.
lParam
This parameter is not used.
Return Value
Remarks
This message removes the title of the MDI child window from the MDI frame window and deactivates the child window. An application should use this message to close all MDI child windows.
If an MDI client window receives a message that changes the activation of its child windows and the active MDI child window is maximized, the system restores the active child window and maximizes the newly activated child window.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x229">
<name>WM_MDIGETACTIVE</name>
<return value="HWND">
<returninfo>returns HWND in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used. </wmisc>
</wparam>
<lparam value="LPBOOL">
<lname>lParam</lname>
<lmisc>lParam
Specifies the maximized state. If this parameter is not NULL, it is a pointer to a value that indicates the maximized state of the MDI child window. If the value is TRUE, the window is maximized; a value of FALSE indicates that it is not. If this parameter is NULL, the parameter is ignored.
</lmisc>
</lparam>
<misc>WM_MDIGETACTIVE Message
An application sends the WM_MDIGETACTIVE message to a multiple-document interface (MDI) client window to retrieve the handle to the active MDI child window.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns HWND in lResult
(HWND) hWndControl, // handle to destination control
(UINT) WM_MDIGETACTIVE, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) (LPBOOL) lParam;
);
Parameters
wParam
This parameter is not used.
lParam
Specifies the maximized state. If this parameter is not NULL, it is a pointer to a value that indicates the maximized state of the MDI child window. If the value is TRUE, the window is maximized; a value of FALSE indicates that it is not. If this parameter is NULL, the parameter is ignored.
Return Value
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x228">
<name>WM_MDIICONARRANGE</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
No return value.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used; it must be zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used; it must be zero. </lmisc>
</lparam>
<misc>WM_MDIICONARRANGE Message
An application sends the WM_MDIICONARRANGE message to a multiple-document interface (MDI) client window to arrange all minimized MDI child windows. It does not affect child windows that are not minimized.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage(
(HWND) hWndControl, // handle to destination control
(UINT) WM_MDIICONARRANGE, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
This parameter is not used; it must be zero.
lParam
This parameter is not used; it must be zero.
Return Value
No return value.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x225">
<name>WM_MDIMAXIMIZE</name>
<return value="">
<returninfo>returns zero in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="HWND">
<wname>wParam</wname>
<wmisc>wParam
Handle to the MDI child window to be maximized. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used. </lmisc>
</lparam>
<misc>WM_MDIMAXIMIZE Message
An application sends the WM_MDIMAXIMIZE message to a multiple-document interface (MDI) client window to maximize an MDI child window. The system resizes the child window to make its client area fill the client window. The system places the child window's window menu icon in the rightmost position of the frame window's menu bar, and places the child window's restore icon in the leftmost position. The system also appends the title bar text of the child window to that of the frame window.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns zero in lResult
(HWND) hWndControl, // handle to destination control
(UINT) WM_MDIMAXIMIZE, // message ID
(WPARAM) wParam, // = (WPARAM) (HWND) wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Handle to the MDI child window to be maximized.
lParam
This parameter is not used.
Return Value
Remarks
If an MDI client window receives any message that changes the activation of its child windows while the currently active MDI child window is maximized, the system restores the active child window and maximizes the newly activated child window.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x224">
<name>WM_MDINEXT</name>
<return value="">
<returninfo>returns zero in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="HWND">
<wname>wParam</wname>
<wmisc>wParam
Handle to the MDI child window. The system activates the child window that is immediately before or after the specified child window, depending on the value of the lParam parameter. If the wParam parameter is NULL, the system activates the child window that is immediately before or after the currently active child window.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
If this parameter is zero, the system activates the next MDI child window and places the child window identified by the wParam parameter behind all other child windows. If this parameter is nonzero, the system activates the previous child window, placing it in front of the child window identified by wParam.
</lmisc>
</lparam>
<misc>WM_MDINEXT Message
An application sends the WM_MDINEXT message to a multiple-document interface (MDI) client window to activate the next or previous child window.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns zero in lResult
(HWND) hWndControl, // handle to destination control
(UINT) WM_MDINEXT, // message ID
(WPARAM) wParam, // = (WPARAM) (HWND) wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Handle to the MDI child window. The system activates the child window that is immediately before or after the specified child window, depending on the value of the lParam parameter. If the wParam parameter is NULL, the system activates the child window that is immediately before or after the currently active child window.
lParam
If this parameter is zero, the system activates the next MDI child window and places the child window identified by the wParam parameter behind all other child windows. If this parameter is nonzero, the system activates the previous child window, placing it in front of the child window identified by wParam.
Return Value
Remarks
If an MDI client window receives any message that changes the activation of its child windows while the active MDI child window is maximized, the system restores the active child window and maximizes the newly activated child window.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x234">
<name>WM_MDIREFRESHMENU</name>
<return value="HMENU">
<returninfo>returns HMENU in lResult</returninfo>
<returnmisc>Return Value
If the message succeeds, the return value is the handle to the frame window menu.
If the message fails, the return value is NULL. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used; must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used; must be zero. </lmisc>
</lparam>
<misc>WM_MDIREFRESHMENU Message
An application sends the WM_MDIREFRESHMENU message to a multiple-document interface (MDI) client window to refresh the window menu of the MDI frame window.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns HMENU in lResult
(HWND) hWndControl, // handle to destination control
(UINT) WM_MDIREFRESHMENU, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
If the message succeeds, the return value is the handle to the frame window menu.
If the message fails, the return value is NULL.
Remarks
After sending this message, an application must call the DrawMenuBar function to update the menu bar.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x223">
<name>WM_MDIRESTORE</name>
<return value="">
<returninfo>returns zero in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="HWND">
<wname>wParam</wname>
<wmisc>wParam
Handle to the MDI child window to be restored.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used. </lmisc>
</lparam>
<misc>WM_MDIRESTORE Message
An application sends the WM_MDIRESTORE message to a multiple-document interface (MDI) client window to restore an MDI child window from maximized or minimized size.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns zero in lResult
(HWND) hWndControl, // handle to destination control
(UINT) WM_MDIRESTORE, // message ID
(WPARAM) wParam, // = (WPARAM) (HWND) wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Handle to the MDI child window to be restored.
lParam
This parameter is not used.
Return Value
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x230">
<name>WM_MDISETMENU</name>
<return value="HMENU">
<returninfo>returns HMENU in lResult</returninfo>
<returnmisc>Return Value
If the message succeeds, the return value is the handle to the old frame window menu.
If the message fails, the return value is zero. </returnmisc>
</return>
<wparam value="HMENU">
<wname>wParam</wname>
<wmisc>wParam
Handle to the new frame window menu. If this parameter is NULL, the frame window menu is not changed. </wmisc>
</wparam>
<lparam value="HMENU">
<lname>lParam</lname>
<lmisc>lParam
Handle to the new window menu. If this parameter is NULL, the window menu is not changed. </lmisc>
</lparam>
<misc>WM_MDISETMENU Message
An application sends the WM_MDISETMENU message to a multiple-document interface (MDI) client window to replace the entire menu of an MDI frame window, to replace the window menu of the frame window, or both.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns HMENU in lResult
(HWND) hWndControl, // handle to destination control
(UINT) WM_MDISETMENU, // message ID
(WPARAM) wParam, // = (WPARAM) (HMENU) wParam;
(LPARAM) lParam // = (LPARAM) (HMENU) lParam;
);
Parameters
wParam
Handle to the new frame window menu. If this parameter is NULL, the frame window menu is not changed.
lParam
Handle to the new window menu. If this parameter is NULL, the window menu is not changed.
Return Value
If the message succeeds, the return value is the handle to the old frame window menu.
If the message fails, the return value is zero.
Remarks
After sending this message, an application must call the DrawMenuBar function to update the menu bar.
If this message replaces the window menu, the MDI child window menu items are removed from the previous window menu and added to the new window menu.
If an MDI child window is maximized and this message replaces the MDI frame window menu, the window menu icon and restore icon are removed from the previous frame window menu and added to the new frame window menu.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x226">
<name>WM_MDITILE</name>
<return value="BOOL">
<returninfo>returns BOOL in lResult</returninfo>
<returnmisc>Return Value
If the message succeeds, the return value is TRUE.
If the message fails, the return value is FALSE. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the tiling option. This parameter can be one of the following values, optionally combined with MDITILE_SKIPDISABLED to prevent disabled MDI child windows from being tiled.
MDITILE_HORIZONTAL
Tiles windows horizontally.
MDITILE_VERTICAL
Tiles windows vertically.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used. </lmisc>
</lparam>
<misc>WM_MDITILE Message
An application sends the WM_MDITILE message to a multiple-document interface (MDI) client window to arrange all of its MDI child windows in a tile format.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns BOOL in lResult
(HWND) hWndControl, // handle to destination control
(UINT) WM_MDITILE, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Specifies the tiling option. This parameter can be one of the following values, optionally combined with MDITILE_SKIPDISABLED to prevent disabled MDI child windows from being tiled.
MDITILE_HORIZONTAL
Tiles windows horizontally.
MDITILE_VERTICAL
Tiles windows vertically.
lParam
This parameter is not used.
Return Value
If the message succeeds, the return value is TRUE.
If the message fails, the return value is FALSE.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x2C">
<name>WM_MEASUREITEM</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Contains the value of the CtlID member of the MEASUREITEMSTRUCT structure pointed to by the lpMeasureItem parameter. This value identifies the control that sent the WM_MEASUREITEM message. If the value is zero, the message was sent by a menu. If the value is nonzero, the message was sent by a combo box or by a list box. If the value is nonzero, and the value of the itemID member of the MEASUREITEMSTRUCT pointed to by lpMeasureItem is (UINT) 1, the message was sent by a combo edit field.
</wmisc>
</wparam>
<lparam value="LPMEASUREITEMSTRUCT">
<lname>lpMeasureItem</lname>
<lmisc>lpMeasureItem
Pointer to a MEASUREITEMSTRUCT structure that contains the dimensions of the owner-drawn control or menu item.
</lmisc>
</lparam>
<misc>WM_MEASUREITEM Notification
The WM_MEASUREITEM message is sent to the owner window of a combo box, list box, list view control, or menu item when the control or menu is created.
A window receives this message through its WindowProc function.
Syntax
WM_MEASUREITEM
WPARAM wParam
lpMeasureItem = (LPMEASUREITEMSTRUCT) lParam;
Parameters
wParam
Contains the value of the CtlID member of the MEASUREITEMSTRUCT structure pointed to by the lpMeasureItem parameter. This value identifies the control that sent the WM_MEASUREITEM message. If the value is zero, the message was sent by a menu. If the value is nonzero, the message was sent by a combo box or by a list box. If the value is nonzero, and the value of the itemID member of the MEASUREITEMSTRUCT pointed to by lpMeasureItem is (UINT) 1, the message was sent by a combo edit field.
lpMeasureItem
Pointer to a MEASUREITEMSTRUCT structure that contains the dimensions of the owner-drawn control or menu item.
Return Value
Remarks
When the owner window receives the WM_MEASUREITEM message, the owner fills in the MEASUREITEMSTRUCT structure pointed to by the lpMeasureItem parameter of the message and returns; this informs the system of the dimensions of the control. If a list box or combo box is created with the LBS_OWNERDRAWVARIABLE or CBS_OWNERDRAWVARIABLE style, this message is sent to the owner for each item in the control; otherwise, this message is sent once.
The system sends the WM_MEASUREITEM message to the owner window of combo boxes and list boxes created with the OWNERDRAWFIXED style before sending the WM_INITDIALOG message. As a result, when the owner receives this message, the system has not yet determined the height and width of the font used in the control; function calls and calculations requiring these values should occur in the main function of the application or library.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x120">
<name>WM_MENUCHAR</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
An application that processes this message should return one of the following values in the high-order word of the return value.
MNC_IGNORE Informs the system that it should discard the character the user pressed and create a short beep on the system speaker.
MNC_CLOSE Informs the system that it should close the active menu.
MNC_EXECUTE Informs the system that it should choose the item specified in the low-order word of the return value. The owner window receives a WM_COMMAND message.
MNC_SELECT Informs the system that it should select the item specified in the low-order word of the return value.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
The low-order word specifies the character code that corresponds to the key the user pressed.
The high-order word specifies the active menu type. This parameter can be one of the following values.
MF_POPUP
A drop-down menu, submenu, or shortcut menu.
MF_SYSMENU
The window menu.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Handle to the active menu. </lmisc>
</lparam>
<misc>WM_MENUCHAR Notification
The WM_MENUCHAR message is sent when a menu is active and the user presses a key that does not correspond to any mnemonic or accelerator key. This message is sent to the window that owns the menu.
Syntax
WM_MENUCHAR
WPARAM wParam
LPARAM lParam;
Parameters
wParam
The low-order word specifies the character code that corresponds to the key the user pressed.
The high-order word specifies the active menu type. This parameter can be one of the following values.
MF_POPUP
A drop-down menu, submenu, or shortcut menu.
MF_SYSMENU
The window menu.
lParam
Handle to the active menu.
Return Value
An application that processes this message should return one of the following values in the high-order word of the return value.
MNC_IGNORE Informs the system that it should discard the character the user pressed and create a short beep on the system speaker.
MNC_CLOSE Informs the system that it should close the active menu.
MNC_EXECUTE Informs the system that it should choose the item specified in the low-order word of the return value. The owner window receives a WM_COMMAND message.
MNC_SELECT Informs the system that it should select the item specified in the low-order word of the return value.
Remarks
The low-order word is ignored if the high-order word contains 0 or 1.
An application should process this message when an accelerator is used to select a menu item that displays a bitmap.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x126">
<name>WM_MENUCOMMAND</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
No return value.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the zero-based index of the item selected.
Windows 98/Me: The high word is the zero-based index of the item selected. The low word is the item ID.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Handle to the menu for the item selected. </lmisc>
</lparam>
<misc>WM_MENUCOMMAND Notification
The WM_MENUCOMMAND message is sent when the user makes a selection from a menu.
Syntax
WM_MENUCOMMAND
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Specifies the zero-based index of the item selected.
Windows 98/Me: The high word is the zero-based index of the item selected. The low word is the item ID.
lParam
Handle to the menu for the item selected.
Return Value
No return value.
Remarks
The WM_MENUCOMMAND message gives you a handle to the menuso you can access the menu data in the MENUINFO structure and also gives you the index of the selected item, which is typically what applications need. In contrast, the WM_COMMAND message gives you the menu item identifier.
The WM_MENUCOMMAND message is sent only for menus that are defined with the MNS_NOTIFYBYPOS flag set in the dwStyle member of the MENUINFO structure.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 98, Windows 2000</misc>
</message>
<message value="0x123">
<name>WM_MENUDRAG</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
The application should return one of the following values.
MND_CONTINUE Menu should remain active. If the mouse is released, it should be ignored.
MND_ENDMENU Menu should be ended.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the position of the item where the drag operation began. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Handle to the menu containing the item. </lmisc>
</lparam>
<misc>WM_MENUDRAG Notification
The WM_MENUDRAG message is sent to the owner of a drag-and-drop menu when the user drags a menu item.
Syntax
WM_MENUDRAG
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Specifies the position of the item where the drag operation began.
lParam
Handle to the menu containing the item.
Return Value
The application should return one of the following values.
MND_CONTINUE Menu should remain active. If the mouse is released, it should be ignored.
MND_ENDMENU Menu should be ended.
Remarks
The application can call the DoDragDrop function in response to this message.
To create a drag-and-drop menu, call SetMenuInfo with MNS_DRAGDROP.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 98, Windows 2000</misc>
</message>
<message value="0x124">
<name>WM_MENUGETOBJECT</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
The application should return one of the following values.
MNGO_NOERROR An interface pointer was returned in the pvObj member of MENUGETOBJECTINFO
MNGO_NOINTERFACE The interface is not supported.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used. </wmisc>
</wparam>
<lparam value="MENUGETOBJECTINFO">
<lname>lParam</lname>
<lmisc>lParam
Pointer to a MENUGETOBJECTINFO structure. </lmisc>
</lparam>
<misc>WM_MENUGETOBJECT Notification
The WM_MENUGETOBJECT message is sent to the owner of a drag-and-drop menu when the mouse cursor enters a menu item or moves from the center of the item to the top or bottom of the item.
Syntax
WM_MENUGETOBJECT
WPARAM wParam
LPARAM lParam;
Parameters
wParam
This parameter is not used.
lParam
Pointer to a MENUGETOBJECTINFO structure.
Return Value
The application should return one of the following values.
MNGO_NOERROR An interface pointer was returned in the pvObj member of MENUGETOBJECTINFO
MNGO_NOINTERFACE The interface is not supported.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 98, Windows 2000</misc>
</message>
<message value="0x122">
<name>WM_MENURBUTTONUP</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
No return value.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the position of the item when the mouse was released. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Handle to the menu containing the item. </lmisc>
</lparam>
<misc>WM_MENURBUTTONUP Notification
The WM_MENURBUTTONUP message is sent when the user releases the right mouse button while the cursor is on a menu item.
Syntax
WM_MENURBUTTONUP
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Specifies the position of the item when the mouse was released.
lParam
Handle to the menu containing the item.
Return Value
No return value.
Remarks
The WM_MENURBUTTONUP message allows applications to provide a context-sensitive menu also known as a shortcut menu for the menu item specified in this message. To display a context-sensitive menu for a menu item, call the TrackPopupMenuEx function with TPM_RECURSE.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 98, Windows 2000</misc>
</message>
<message value="0x11F">
<name>WM_MENUSELECT</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
If an application processes this message, it should return zero. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
The low-order word specifies the menu item or submenu index. If the selected item is a command item, this parameter contains the identifier of the menu item. If the selected item opens a drop-down menu or submenu, this parameter contains the index of the drop-down menu or submenu in the main menu, and the lParam parameter contains the handle to the main (clicked) menu; use the GetSubMenu function to get the menu handle to the drop-down menu or submenu.
The high-order word specifies one or more menu flags. This parameter can be one or more of the following values.
MF_BITMAP
Item displays a bitmap.
MF_CHECKED
Item is checked.
MF_DISABLED
Item is disabled.
MF_GRAYED
Item is grayed.
MF_HILITE
Item is highlighted.
MF_MOUSESELECT
Item is selected with the mouse.
MF_OWNERDRAW
Item is an owner-drawn item.
MF_POPUP
Item opens a drop-down menu or submenu.
MF_SYSMENU
Item is contained in the window menu. The lParam parameter contains a handle to the menu associated with the message.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Handle to the menu that was clicked. </lmisc>
</lparam>
<misc>WM_MENUSELECT Notification
The WM_MENUSELECT message is sent to a menu's owner window when the user selects a menu item.
Syntax
WM_MENUSELECT
WPARAM wParam
LPARAM lParam;
Parameters
wParam
The low-order word specifies the menu item or submenu index. If the selected item is a command item, this parameter contains the identifier of the menu item. If the selected item opens a drop-down menu or submenu, this parameter contains the index of the drop-down menu or submenu in the main menu, and the lParam parameter contains the handle to the main (clicked) menu; use the GetSubMenu function to get the menu handle to the drop-down menu or submenu.
The high-order word specifies one or more menu flags. This parameter can be one or more of the following values.
MF_BITMAP
Item displays a bitmap.
MF_CHECKED
Item is checked.
MF_DISABLED
Item is disabled.
MF_GRAYED
Item is grayed.
MF_HILITE
Item is highlighted.
MF_MOUSESELECT
Item is selected with the mouse.
MF_OWNERDRAW
Item is an owner-drawn item.
MF_POPUP
Item opens a drop-down menu or submenu.
MF_SYSMENU
Item is contained in the window menu. The lParam parameter contains a handle to the menu associated with the message.
lParam
Handle to the menu that was clicked.
Return Value
If an application processes this message, it should return zero.
Remarks
If the high-order word of wParam contains 0xFFFF and the lParam parameter contains NULL, the system has closed the menu.
Do not use the value 1 for the high-order word of wParam, because this value is specified as (UINT) HIWORD(wParam). If the value is 0xFFFF, it would be interpreted as 0x0000FFFF, not 1, because of the cast to a UINT.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x21">
<name>WM_MOUSEACTIVATE</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
The return value specifies whether the window should be activated and whether the identifier of the mouse message should be discarded. It must be one of the following values.
MA_ACTIVATE Activates the window, and does not discard the mouse message.
MA_ACTIVATEANDEAT Activates the window, and discards the mouse message.
MA_NOACTIVATE Does not activate the window, and does not discard the mouse message.
MA_NOACTIVATEANDEAT Does not activate the window, but discards the mouse message.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Handle to the top-level parent window of the window being activated. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
The low-order word specifies the hit-test value returned by the DefWindowProc function as a result of processing the WM_NCHITTEST message. For a list of hit-test values, see WM_NCHITTEST.
The high-order word specifies the identifier of the mouse message generated when the user pressed a mouse button. The mouse message is either discarded or posted to the window, depending on the return value.
</lmisc>
</lparam>
<misc>WM_MOUSEACTIVATE Notification
The WM_MOUSEACTIVATE message is sent when the cursor is in an inactive window and the user presses a mouse button. The parent window receives this message only if the child window passes it to the DefWindowProc function.
A window receives this message through its WindowProc function.
Syntax
WM_MOUSEACTIVATE
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Handle to the top-level parent window of the window being activated.
lParam
The low-order word specifies the hit-test value returned by the DefWindowProc function as a result of processing the WM_NCHITTEST message. For a list of hit-test values, see WM_NCHITTEST.
The high-order word specifies the identifier of the mouse message generated when the user pressed a mouse button. The mouse message is either discarded or posted to the window, depending on the return value.
Return Value
The return value specifies whether the window should be activated and whether the identifier of the mouse message should be discarded. It must be one of the following values.
MA_ACTIVATE Activates the window, and does not discard the mouse message.
MA_ACTIVATEANDEAT Activates the window, and discards the mouse message.
MA_NOACTIVATE Does not activate the window, and does not discard the mouse message.
MA_NOACTIVATEANDEAT Does not activate the window, but discards the mouse message.
Remarks
The DefWindowProc function passes the message to a child window's parent window before any processing occurs. The parent window determines whether to activate the child window. If it activates the child window, the parent window should return MA_NOACTIVATE or MA_NOACTIVATEANDEAT to prevent the system from processing the message further.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x2A1">
<name>WM_MOUSEHOVER</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Indicates whether various virtual keys are down. This parameter can be one or more of the following values.
MK_CONTROL
The CTRL key is depressed.
MK_LBUTTON
The left mouse button is depressed.
MK_MBUTTON
The middle mouse button is depressed.
MK_RBUTTON
The right mouse button is depressed.
MK_SHIFT
The SHIFT key is depressed.
MK_XBUTTON1
Windows 2000/XP: The first X button is down.
MK_XBUTTON2
Windows 2000/XP: The second X button is down.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
The low-order word specifies the x-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
The high-order word specifies the y-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
</lmisc>
</lparam>
<misc>WM_MOUSEHOVER Notification
The WM_MOUSEHOVER message is posted to a window when the cursor hovers over the client area of the window for the period of time specified in a prior call to TrackMouseEvent.
A window receives this message through its WindowProc function.
Syntax
WM_MOUSEHOVER
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Indicates whether various virtual keys are down. This parameter can be one or more of the following values.
MK_CONTROL
The CTRL key is depressed.
MK_LBUTTON
The left mouse button is depressed.
MK_MBUTTON
The middle mouse button is depressed.
MK_RBUTTON
The right mouse button is depressed.
MK_SHIFT
The SHIFT key is depressed.
MK_XBUTTON1
Windows 2000/XP: The first X button is down.
MK_XBUTTON2
Windows 2000/XP: The second X button is down.
lParam
The low-order word specifies the x-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
The high-order word specifies the y-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
Return Value
Remarks
Hover tracking stops when WM_MOUSEHOVER is generated. The application must call TrackMouseEvent again if it requires further tracking of mouse hover behavior.
Use the following code to obtain the horizontal and vertical position:
Copy Code
xPos = GET_X_LPARAM(lParam);
yPos = GET_Y_LPARAM(lParam);
You can also use the MAKEPOINTS macro to convert the lParam parameter to a POINTS structure.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 98, Windows NT 4.0</misc>
</message>
<message value="0x209">
<name>WM_MOUSELAST</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x2A3">
<name>WM_MOUSELEAVE</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used; must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used; must be zero.</lmisc>
</lparam>
<misc>WM_MOUSELEAVE Notification
The WM_MOUSELEAVE message is posted to a window when the cursor leaves the client area of the window specified in a prior call to TrackMouseEvent.
A window receives this message through its WindowProc function.
Syntax
WM_MOUSELEAVE
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
Remarks
All tracking requested by TrackMouseEvent is canceled when this message is generated. The application must call TrackMouseEvent when the mouse reenters its window if it requires further tracking of mouse hover behavior.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 98, Windows NT 4.0</misc>
</message>
<message value="0x200">
<name>WM_MOUSEMOVE</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Indicates whether various virtual keys are down. This parameter can be one or more of the following values.
MK_CONTROL
The CTRL key is down.
MK_LBUTTON
The left mouse button is down.
MK_MBUTTON
The middle mouse button is down.
MK_RBUTTON
The right mouse button is down.
MK_SHIFT
The SHIFT key is down.
MK_XBUTTON1
Windows 2000/XP: The first X button is down.
MK_XBUTTON2
Windows 2000/XP: The second X button is down.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
The low-order word specifies the x-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
The high-order word specifies the y-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
</lmisc>
</lparam>
<misc>WM_MOUSEMOVE Notification
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.
A window receives this message through its WindowProc function.
Syntax
WM_MOUSEMOVE
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Indicates whether various virtual keys are down. This parameter can be one or more of the following values.
MK_CONTROL
The CTRL key is down.
MK_LBUTTON
The left mouse button is down.
MK_MBUTTON
The middle mouse button is down.
MK_RBUTTON
The right mouse button is down.
MK_SHIFT
The SHIFT key is down.
MK_XBUTTON1
Windows 2000/XP: The first X button is down.
MK_XBUTTON2
Windows 2000/XP: The second X button is down.
lParam
The low-order word specifies the x-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
The high-order word specifies the y-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
Return Value
Remarks
Use the following code to obtain the horizontal and vertical position:
Copy Code
xPos = GET_X_LPARAM(lParam);
yPos = GET_Y_LPARAM(lParam);
You can also use the MAKEPOINTS macro to convert the lParam parameter to a POINTS structure.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x20A">
<name>WM_MOUSEWHEEL</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
The high-order word indicates the distance the wheel is rotated, expressed in multiples or divisions of WHEEL_DELTA, which is 120. A positive value indicates that the wheel was rotated forward, away from the user; a negative value indicates that the wheel was rotated backward, toward the user.
The low-order word indicates whether various virtual keys are down. This parameter can be one or more of the following values.
MK_CONTROL
The CTRL key is down.
MK_LBUTTON
The left mouse button is down.
MK_MBUTTON
The middle mouse button is down.
MK_RBUTTON
The right mouse button is down.
MK_SHIFT
The SHIFT key is down.
MK_XBUTTON1
Windows 2000/XP: The first X button is down.
MK_XBUTTON2
Windows 2000/XP: The second X button is down.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
The low-order word specifies the x-coordinate of the pointer, relative to the upper-left corner of the screen.
The high-order word specifies the y-coordinate of the pointer, relative to the upper-left corner of the screen.
</lmisc>
</lparam>
<misc>WM_MOUSEWHEEL Notification
The WM_MOUSEWHEEL message is sent to the focus window when the mouse wheel is rotated. The DefWindowProc function propagates the message to the window's parent. There should be no internal forwarding of the message, since DefWindowProc propagates it up the parent chain until it finds a window that processes it.
A window receives this message through its WindowProc function.
Syntax
WM_MOUSEWHEEL
WPARAM wParam
LPARAM lParam;
Parameters
wParam
The high-order word indicates the distance the wheel is rotated, expressed in multiples or divisions of WHEEL_DELTA, which is 120. A positive value indicates that the wheel was rotated forward, away from the user; a negative value indicates that the wheel was rotated backward, toward the user.
The low-order word indicates whether various virtual keys are down. This parameter can be one or more of the following values.
MK_CONTROL
The CTRL key is down.
MK_LBUTTON
The left mouse button is down.
MK_MBUTTON
The middle mouse button is down.
MK_RBUTTON
The right mouse button is down.
MK_SHIFT
The SHIFT key is down.
MK_XBUTTON1
Windows 2000/XP: The first X button is down.
MK_XBUTTON2
Windows 2000/XP: The second X button is down.
lParam
The low-order word specifies the x-coordinate of the pointer, relative to the upper-left corner of the screen.
The high-order word specifies the y-coordinate of the pointer, relative to the upper-left corner of the screen.
Return Value
Remarks
Use the following code to get the information in the wParam parameter:
Copy Code
fwKeys = GET_KEYSTATE_WPARAM(wParam);
zDelta = GET_WHEEL_DELTA_WPARAM(wParam);
Use the following code to obtain the horizontal and vertical position:
Copy Code
xPos = GET_X_LPARAM(lParam);
yPos = GET_Y_LPARAM(lParam);
You can also use the MAKEPOINTS macro to convert the lParam parameter to a POINTS structure.
The wheel rotation will be a multiple of WHEEL_DELTA, which is set at 120. This is the threshold for action to be taken, and one such action (for example, scrolling one increment) should occur for each delta.
The delta was set to 120 to allow Microsoft or other vendors to build finer-resolution wheels in the future, including perhaps a freely-rotating wheel with no notches. The expectation is that such a device would send more messages per rotation, but with a smaller value in each message. To support this possibility, you should either add the incoming delta values until WHEEL_DELTA is reached (so for a delta-rotation you get the same response), or scroll partial lines in response to the more frequent messages. You could also choose your scroll granularity and accumulate deltas until it is reached.
Windows 95, Windows NT 3.51: Support for the mouse wheel is provided through a separately-running module, MSWheel, that generates a MSH_MOUSEWHEEL message. The MSWheel module, which consists of MSWheel.exe and MSWheel.dll, is installed with the IntelliPoint software that is shipped with the IntelliMouse pointing device. In addition, MSH_MOUSEWHEEL is defined in the header file (ZMouse.h) that an application must use to implement support for the wheel via the MSWheel module.
Copy Code
MSH_MOUSEWHEEL
zDelta = (int) wParam; // wheel rotation
xPos = LOWORD(lParam); // horizontal position of pointer
yPos = HIWORD(lParam); // vertical position of pointer
Note, there is no fwKeys for MSH_MOUSEWHEEL. Otherwise, the parameters are exactly the same as for WM_MOUSEWHEEL.
It is up to the application to forward MSH_MOUSEWHEEL to any embedded objects or controls. The application is required to send the message to an active embedded OLE application. It is optional that the application sends it to a wheel-enabled control with focus. If the application does send the message to a control, it can check the return value to see if the message was processed. Controls are required to return a value of TRUE if they process the message.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 98, Windows NT 4.0</misc>
</message>
<message value="0x3">
<name>WM_MOVE</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
If an application processes this message, it should return zero. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Specifies the x and y coordinates of the upper-left corner of the client area of the window. The low-order word contains the x-coordinate while the high-order word contains the y coordinate.
</lmisc>
</lparam>
<misc>WM_MOVE Notification
The WM_MOVE message is sent after a window has been moved.
A window receives this message through its WindowProc function.
Syntax
WM_MOVE
WPARAM wParam
LPARAM lParam;
Parameters
wParam
This parameter is not used.
lParam
Specifies the x and y coordinates of the upper-left corner of the client area of the window. The low-order word contains the x-coordinate while the high-order word contains the y coordinate.
Return Value
If an application processes this message, it should return zero.
Remarks
The parameters are given in screen coordinates for overlapped and pop-up windows and in parent-client coordinates for child windows.
The following example demonstrates how to obtain the position from the lParam parameter.
Copy Code
xPos = (int)(short) LOWORD(lParam); // horizontal position
yPos = (int)(short) HIWORD(lParam); // vertical position
You can also use the MAKEPOINTS macro to convert the lParam parameter to a POINTS structure.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x216">
<name>WM_MOVING</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used.</wmisc>
</wparam>
<lparam value="RECT">
<lname>lParam</lname>
<lmisc>lParam
Pointer to a RECT structure with the current position of the window, in screen coordinates. To change the position of the drag rectangle, an application must change the members of this structure.
</lmisc>
</lparam>
<misc>WM_MOVING Notification
The WM_MOVING message is sent to a window that the user is moving. By processing this message, an application can monitor the position of the drag rectangle and, if needed, change its position.
A window receives this message through its WindowProc function.
Syntax
WM_MOVING
WPARAM wParam
LPARAM lParam;
Parameters
wParam
This parameter is not used.
lParam
Pointer to a RECT structure with the current position of the window, in screen coordinates. To change the position of the drag rectangle, an application must change the members of this structure.
Return Value
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0x86">
<name>WM_NCACTIVATE</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Value
When the wParam parameter is FALSE, an application should return TRUE to indicate that the system should proceed with the default processing, or it should return FALSE to prevent the title bar or icon from being deactivated. When wParam is TRUE, the return value is ignored.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies when a title bar or icon needs to be changed to indicate an active or inactive state. If an active title bar or icon is to be drawn, the wParam parameter is TRUE. It is FALSE for an inactive title bar or icon.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used. </lmisc>
</lparam>
<misc>WM_NCACTIVATE Notification
The WM_NCACTIVATE message is sent to a window when its nonclient area needs to be changed to indicate an active or inactive state.
A window receives this message through its WindowProc function.
Syntax
WM_NCACTIVATE
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Specifies when a title bar or icon needs to be changed to indicate an active or inactive state. If an active title bar or icon is to be drawn, the wParam parameter is TRUE. It is FALSE for an inactive title bar or icon.
lParam
This parameter is not used.
Return Value
When the wParam parameter is FALSE, an application should return TRUE to indicate that the system should proceed with the default processing, or it should return FALSE to prevent the title bar or icon from being deactivated. When wParam is TRUE, the return value is ignored.
Remarks
The DefWindowProc function draws the title bar or icon title in its active colors when the wParam parameter is TRUE and in its inactive colors when wParam is FALSE.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x83">
<name>WM_NCCALCSIZE</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
If the wParam parameter is FALSE, the application should return zero.
If wParam is TRUE, the application should return zero or a combination of the following values.
If wParam is TRUE and an application returns zero, the old client area is preserved and is aligned with the upper-left corner of the new client area.
WVR_ALIGNTOP Specifies that the client area of the window is to be preserved and aligned with the top of the new position of the window. For example, to align the client area to the upper-left corner, return the WVR_ALIGNTOP and WVR_ALIGNLEFT values.
WVR_ALIGNRIGHT Specifies that the client area of the window is to be preserved and aligned with the right side of the new position of the window. For example, to align the client area to the lower-right corner, return the WVR_ALIGNRIGHT and WVR_ALIGNBOTTOM values.
WVR_ALIGNLEFT Specifies that the client area of the window is to be preserved and aligned with the left side of the new position of the window. For example, to align the client area to the lower-left corner, return the WVR_ALIGNLEFT and WVR_ALIGNBOTTOM values.
WVR_ALIGNBOTTOM Specifies that the client area of the window is to be preserved and aligned with the bottom of the new position of the window. For example, to align the client area to the top-left corner, return the WVR_ALIGNTOP and WVR_ALIGNLEFT values.
WVR_HREDRAW Used in combination with any other values, except WVR_VALIDRECTS, causes the window to be completely redrawn if the client rectangle changes size horizontally. This value is similar to CS_HREDRAW class style
WVR_VREDRAW Used in combination with any other values, except WVR_VALIDRECTS, causes the window to be completely redrawn if the client rectangle changes size vertically. This value is similar to CS_VREDRAW class style
WVR_REDRAW This value causes the entire window to be redrawn. It is a combination of WVR_HREDRAW and WVR_VREDRAW values.
WVR_VALIDRECTS This value indicates that, upon return from WM_NCCALCSIZE, the rectangles specified by the rgrc[1] and rgrc[2] members of the NCCALCSIZE_PARAMS structure contain valid destination and source area rectangles, respectively. The system combines these rectangles to calculate the area of the window to be preserved. The system copies any part of the window image that is within the source rectangle and clips the image to the destination rectangle. Both rectangles are in parent-relative or screen-relative coordinates. This flag cannot be combined with any other flags.
This return value allows an application to implement more elaborate client-area preservation strategies, such as centering or preserving a subset of the client area.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
If wParam is TRUE, it specifies that the application should indicate which part of the client area contains valid information. The system copies the valid information to the specified area within the new client area.
If wParam is FALSE, the application does not need to indicate the valid part of the client area.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
If wParam is TRUE, lParam points to an NCCALCSIZE_PARAMS structure that contains information an application can use to calculate the new size and position of the client rectangle.
If wParam is FALSE, lParam points to a RECT structure. On entry, the structure contains the proposed window rectangle for the window. On exit, the structure should contain the screen coordinates of the corresponding window client area.
</lmisc>
</lparam>
<misc>WM_NCCALCSIZE Notification
The WM_NCCALCSIZE message is sent when the size and position of a window's client area must be calculated. By processing this message, an application can control the content of the window's client area when the size or position of the window changes.
A window receives this message through its WindowProc function.
Syntax
WM_NCCALCSIZE
WPARAM wParam
LPARAM lParam;
Parameters
wParam
If wParam is TRUE, it specifies that the application should indicate which part of the client area contains valid information. The system copies the valid information to the specified area within the new client area.
If wParam is FALSE, the application does not need to indicate the valid part of the client area.
lParam
If wParam is TRUE, lParam points to an NCCALCSIZE_PARAMS structure that contains information an application can use to calculate the new size and position of the client rectangle.
If wParam is FALSE, lParam points to a RECT structure. On entry, the structure contains the proposed window rectangle for the window. On exit, the structure should contain the screen coordinates of the corresponding window client area.
Return Value
If the wParam parameter is FALSE, the application should return zero.
If wParam is TRUE, the application should return zero or a combination of the following values.
If wParam is TRUE and an application returns zero, the old client area is preserved and is aligned with the upper-left corner of the new client area.
WVR_ALIGNTOP Specifies that the client area of the window is to be preserved and aligned with the top of the new position of the window. For example, to align the client area to the upper-left corner, return the WVR_ALIGNTOP and WVR_ALIGNLEFT values.
WVR_ALIGNRIGHT Specifies that the client area of the window is to be preserved and aligned with the right side of the new position of the window. For example, to align the client area to the lower-right corner, return the WVR_ALIGNRIGHT and WVR_ALIGNBOTTOM values.
WVR_ALIGNLEFT Specifies that the client area of the window is to be preserved and aligned with the left side of the new position of the window. For example, to align the client area to the lower-left corner, return the WVR_ALIGNLEFT and WVR_ALIGNBOTTOM values.
WVR_ALIGNBOTTOM Specifies that the client area of the window is to be preserved and aligned with the bottom of the new position of the window. For example, to align the client area to the top-left corner, return the WVR_ALIGNTOP and WVR_ALIGNLEFT values.
WVR_HREDRAW Used in combination with any other values, except WVR_VALIDRECTS, causes the window to be completely redrawn if the client rectangle changes size horizontally. This value is similar to CS_HREDRAW class style
WVR_VREDRAW Used in combination with any other values, except WVR_VALIDRECTS, causes the window to be completely redrawn if the client rectangle changes size vertically. This value is similar to CS_VREDRAW class style
WVR_REDRAW This value causes the entire window to be redrawn. It is a combination of WVR_HREDRAW and WVR_VREDRAW values.
WVR_VALIDRECTS This value indicates that, upon return from WM_NCCALCSIZE, the rectangles specified by the rgrc[1] and rgrc[2] members of the NCCALCSIZE_PARAMS structure contain valid destination and source area rectangles, respectively. The system combines these rectangles to calculate the area of the window to be preserved. The system copies any part of the window image that is within the source rectangle and clips the image to the destination rectangle. Both rectangles are in parent-relative or screen-relative coordinates. This flag cannot be combined with any other flags.
This return value allows an application to implement more elaborate client-area preservation strategies, such as centering or preserving a subset of the client area.
Remarks
The window may be redrawn, depending on whether the CS_HREDRAW or CS_VREDRAW class style is specified. This is the default, backward-compatible processing of this message by the DefWindowProc function (in addition to the usual client rectangle calculation described in the preceding table).
When wParam is TRUE, simply returning 0 without processing the NCCALCSIZE_PARAMS rectangles will cause the client area to resize to the size of the window, including the window frame. This will remove the window frame and caption items from your window, leaving only the client area displayed.
Windows Vista: Removing the standard frame by simply returning 0 when the wParam is TRUE does not affect frames that are extended into the client area using the DwmExtendFrameIntoClientArea function. Only the standard frame will be removed.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x81">
<name>WM_NCCREATE</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
If an application processes this message, it should return TRUE to continue creation of the window. If the application returns FALSE, the CreateWindow or CreateWindowEx function will return a NULL handle.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used. </wmisc>
</wparam>
<lparam value="CREATESTRUCT">
<lname>lParam</lname>
<lmisc>lParam
Pointer to the CREATESTRUCT structure that contains information about the window being created. The members of CREATESTRUCT are identical to the parameters of the CreateWindowEx function.
</lmisc>
</lparam>
<misc>WM_NCCREATE Notification
The WM_NCCREATE message is sent prior to the WM_CREATE message when a window is first created.
A window receives this message through its WindowProc function.
Syntax
WM_NCCREATE
WPARAM wParam
LPARAM lParam;
Parameters
wParam
This parameter is not used.
lParam
Pointer to the CREATESTRUCT structure that contains information about the window being created. The members of CREATESTRUCT are identical to the parameters of the CreateWindowEx function.
Return Value
If an application processes this message, it should return TRUE to continue creation of the window. If the application returns FALSE, the CreateWindow or CreateWindowEx function will return a NULL handle.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x82">
<name>WM_NCDESTROY</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used.</lmisc>
</lparam>
<misc>WM_NCDESTROY Notification
The WM_NCDESTROY message informs a window that its nonclient area is being destroyed. The DestroyWindow function sends the WM_NCDESTROY message to the window following the WM_DESTROY message. WM_DESTROY is used to free the allocated memory object associated with the window.
The WM_NCDESTROY message is sent after the child windows have been destroyed. In contrast, WM_DESTROY is sent before the child windows are destroyed.
A window receives this message through its WindowProc function.
Syntax
WM_NCDESTROY
WPARAM wParam
LPARAM lParam;
Parameters
wParam
This parameter is not used.
lParam
This parameter is not used.
Return Value
Remarks
This message frees any memory internally allocated for the window.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x84">
<name>WM_NCHITTEST</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
The return value of the DefWindowProc function is one of the following values, indicating the position of the cursor hot spot.
Value Location of hot spot
HTBORDER In the border of a window that does not have a sizing border.
HTBOTTOM In the lower-horizontal border of a resizable window (the user can click the mouse to resize the window vertically).
HTBOTTOMLEFT In the lower-left corner of a border of a resizable window (the user can click the mouse to resize the window diagonally).
HTBOTTOMRIGHT In the lower-right corner of a border of a resizable window (the user can click the mouse to resize the window diagonally).
HTCAPTION In a title bar.
HTCLIENT In a client area.
HTCLOSE In a Close button.
HTERROR On the screen background or on a dividing line between windows (same as HTNOWHERE, except that the DefWindowProc function produces a system beep to indicate an error).
HTGROWBOX In a size box (same as HTSIZE).
HTHELP In a Help button.
HTHSCROLL In a horizontal scroll bar.
HTLEFT In the left border of a resizable window (the user can click the mouse to resize the window horizontally).
HTMENU In a menu.
HTMAXBUTTON In a Maximize button.
HTMINBUTTON In a Minimize button.
HTNOWHERE On the screen background or on a dividing line between windows.
HTREDUCE In a Minimize button.
HTRIGHT In the right border of a resizable window (the user can click the mouse to resize the window horizontally).
HTSIZE In a size box (same as HTGROWBOX).
HTSYSMENU In a window menu or in a Close button in a child window.
HTTOP In the upper-horizontal border of a window.
HTTOPLEFT In the upper-left corner of a window border.
HTTOPRIGHT In the upper-right corner of a window border.
HTTRANSPARENT In a window currently covered by another window in the same thread (the message will be sent to underlying windows in the same thread until one of them returns a code that is not HTTRANSPARENT).
HTVSCROLL In the vertical scroll bar.
HTZOOM In a Maximize button.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
The low-order word specifies the x-coordinate of the cursor. The coordinate is relative to the upper-left corner of the screen.
The high-order word specifies the y-coordinate of the cursor. The coordinate is relative to the upper-left corner of the screen.
</lmisc>
</lparam>
<misc>WM_NCHITTEST Notification
The WM_NCHITTEST message is sent to a window when the cursor moves, or when a mouse button is pressed or released. If the mouse is not captured, the message is sent to the window beneath the cursor. Otherwise, the message is sent to the window that has captured the mouse.
A window receives this message through its WindowProc function.
Syntax
WM_NCHITTEST
WPARAM wParam
LPARAM lParam;
Parameters
wParam
This parameter is not used.
lParam
The low-order word specifies the x-coordinate of the cursor. The coordinate is relative to the upper-left corner of the screen.
The high-order word specifies the y-coordinate of the cursor. The coordinate is relative to the upper-left corner of the screen.
Return Value
The return value of the DefWindowProc function is one of the following values, indicating the position of the cursor hot spot.
Value Location of hot spot
HTBORDER In the border of a window that does not have a sizing border.
HTBOTTOM In the lower-horizontal border of a resizable window (the user can click the mouse to resize the window vertically).
HTBOTTOMLEFT In the lower-left corner of a border of a resizable window (the user can click the mouse to resize the window diagonally).
HTBOTTOMRIGHT In the lower-right corner of a border of a resizable window (the user can click the mouse to resize the window diagonally).
HTCAPTION In a title bar.
HTCLIENT In a client area.
HTCLOSE In a Close button.
HTERROR On the screen background or on a dividing line between windows (same as HTNOWHERE, except that the DefWindowProc function produces a system beep to indicate an error).
HTGROWBOX In a size box (same as HTSIZE).
HTHELP In a Help button.
HTHSCROLL In a horizontal scroll bar.
HTLEFT In the left border of a resizable window (the user can click the mouse to resize the window horizontally).
HTMENU In a menu.
HTMAXBUTTON In a Maximize button.
HTMINBUTTON In a Minimize button.
HTNOWHERE On the screen background or on a dividing line between windows.
HTREDUCE In a Minimize button.
HTRIGHT In the right border of a resizable window (the user can click the mouse to resize the window horizontally).
HTSIZE In a size box (same as HTGROWBOX).
HTSYSMENU In a window menu or in a Close button in a child window.
HTTOP In the upper-horizontal border of a window.
HTTOPLEFT In the upper-left corner of a window border.
HTTOPRIGHT In the upper-right corner of a window border.
HTTRANSPARENT In a window currently covered by another window in the same thread (the message will be sent to underlying windows in the same thread until one of them returns a code that is not HTTRANSPARENT).
HTVSCROLL In the vertical scroll bar.
HTZOOM In a Maximize button.
Remarks
Use the following code to obtain the horizontal and vertical position:
Copy Code
xPos = GET_X_LPARAM(lParam);
yPos = GET_Y_LPARAM(lParam);
You can also use the MAKEPOINTS macro to convert the lParam parameter to a POINTS structure.
Windows Vista: When creating custom frames that include the standard caption buttons, this message should first be passed to the DwmDefWindowProc function. This enables the Desktop Window Manager (DWM) to provide hit-testing for the captions buttons. If DwmDefWindowProc does not handle the message, further processing of WM_NCHITTEST may be needed.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0xA3">
<name>WM_NCLBUTTONDBLCLK</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the hit-test value returned by the DefWindowProc function as a result of processing the WM_NCHITTEST message. For a list of hit-test values, see WM_NCHITTEST.
</wmisc>
</wparam>
<lparam value="POINTS">
<lname>lParam</lname>
<lmisc>lParam
Specifies a POINTS structure that contains the x- and y-coordinates of the cursor. The coordinates are relative to the upper-left corner of the screen.
</lmisc>
</lparam>
<misc>WM_NCLBUTTONDBLCLK Notification
The WM_NCLBUTTONDBLCLK message is posted when the user double-clicks the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.
A window receives this message through its WindowProc function.
Syntax
WM_NCLBUTTONDBLCLK
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Specifies the hit-test value returned by the DefWindowProc function as a result of processing the WM_NCHITTEST message. For a list of hit-test values, see WM_NCHITTEST.
lParam
Specifies a POINTS structure that contains the x- and y-coordinates of the cursor. The coordinates are relative to the upper-left corner of the screen.
Return Value
Remarks
You can also use the GET_X_LPARAM and GET_Y_LPARAM macros to extract the values of the x- and y- coordinates from lParam.
Copy Code
xPos = GET_X_LPARAM(lParam);
yPos = GET_Y_LPARAM(lParam);
By default, the DefWindowProc function tests the specified point to find out the location of the cursor and performs the appropriate action. If appropriate, DefWindowProc sends the WM_SYSCOMMAND message to the window.
A window need not have the CS_DBLCLKS style to receive WM_NCLBUTTONDBLCLK messages.
The system generates a WM_NCLBUTTONDBLCLK message when the user presses, releases, and again presses the left mouse button within the system's double-click time limit. Double-clicking the left mouse button actually generates four messages: WM_NCLBUTTONDOWN, WM_NCLBUTTONUP, WM_NCLBUTTONDBLCLK, and WM_NCLBUTTONUP again.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0xA1">
<name>WM_NCLBUTTONDOWN</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the hit-test value returned by the DefWindowProc function as a result of processing the WM_NCHITTEST message. For a list of hit-test values, see WM_NCHITTEST.
</wmisc>
</wparam>
<lparam value="POINTS">
<lname>lParam</lname>
<lmisc>lParam
Specifies a POINTS structure that contains the x- and y-coordinates of the cursor. The coordinates are relative to the upper-left corner of the screen.
</lmisc>
</lparam>
<misc>WM_NCLBUTTONDOWN Notification
The WM_NCLBUTTONDOWN message is posted when the user presses the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.
A window receives this message through its WindowProc function.
Syntax
WM_NCLBUTTONDOWN
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Specifies the hit-test value returned by the DefWindowProc function as a result of processing the WM_NCHITTEST message. For a list of hit-test values, see WM_NCHITTEST.
lParam
Specifies a POINTS structure that contains the x- and y-coordinates of the cursor. The coordinates are relative to the upper-left corner of the screen.
Return Value
Remarks
The DefWindowProc function tests the specified point to find the location of the cursor and performs the appropriate action. If appropriate, DefWindowProc sends the WM_SYSCOMMAND message to the window.
You can also use the GET_X_LPARAM and GET_Y_LPARAM macros to extract the values of the x- and y- coordinates from lParam.
Copy Code
xPos = GET_X_LPARAM(lParam);
yPos = GET_Y_LPARAM(lParam);
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0xA2">
<name>WM_NCLBUTTONUP</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the hit-test value returned by the DefWindowProc function as a result of processing the WM_NCHITTEST message. For a list of hit-test values, see WM_NCHITTEST.
</wmisc>
</wparam>
<lparam value="POINTS">
<lname>lParam</lname>
<lmisc>lParam
Specifies a POINTS structure that contains the x- and y-coordinates of the cursor. The coordinates are relative to the upper-left corner of the screen.
</lmisc>
</lparam>
<misc>WM_NCLBUTTONUP Notification
The WM_NCLBUTTONUP message is posted when the user releases the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.
A window receives this message through its WindowProc function.
Syntax
WM_NCLBUTTONUP
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Specifies the hit-test value returned by the DefWindowProc function as a result of processing the WM_NCHITTEST message. For a list of hit-test values, see WM_NCHITTEST.
lParam
Specifies a POINTS structure that contains the x- and y-coordinates of the cursor. The coordinates are relative to the upper-left corner of the screen.
Return Value
Remarks
The DefWindowProc function tests the specified point to find out the location of the cursor and performs the appropriate action. If appropriate, DefWindowProc sends the WM_SYSCOMMAND message to the window.
You can also use the GET_X_LPARAM and GET_Y_LPARAM macros to extract the values of the x- and y- coordinates from lParam.
Copy Code
xPos = GET_X_LPARAM(lParam);
yPos = GET_Y_LPARAM(lParam);
If it is appropriate to do so, the system sends the WM_SYSCOMMAND message to the window.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0xA9">
<name>WM_NCMBUTTONDBLCLK</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the hit-test value returned by the DefWindowProc function as a result of processing the WM_NCHITTEST message. For a list of hit-test values, see WM_NCHITTEST.
</wmisc>
</wparam>
<lparam value="POINTS">
<lname>lParam</lname>
<lmisc>lParam
Specifies a POINTS structure that contains the x- and y-coordinates of the cursor. The coordinates are relative to the upper-left corner of the screen.
</lmisc>
</lparam>
<misc>WM_NCMBUTTONDBLCLK Notification
The WM_NCMBUTTONDBLCLK message is posted when the user double-clicks the middle mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.
A window receives this message through its WindowProc function.
Syntax
WM_NCMBUTTONDBLCLK
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Specifies the hit-test value returned by the DefWindowProc function as a result of processing the WM_NCHITTEST message. For a list of hit-test values, see WM_NCHITTEST.
lParam
Specifies a POINTS structure that contains the x- and y-coordinates of the cursor. The coordinates are relative to the upper-left corner of the screen.
Return Value
Remarks
A window need not have the CS_DBLCLKS style to receive WM_NCMBUTTONDBLCLK messages.
The system generates a WM_NCMBUTTONDBLCLK message when the user presses, releases, and again presses the middle mouse button within the system's double-click time limit. Double-clicking the middle mouse button actually generates four messages: WM_NCMBUTTONDOWN, WM_NCMBUTTONUP, WM_NCMBUTTONDBLCLK, and WM_NCMBUTTONUP again.
You can also use the GET_X_LPARAM and GET_Y_LPARAM macros to extract the values of the x- and y- coordinates from lParam.
Copy Code
xPos = GET_X_LPARAM(lParam);
yPos = GET_Y_LPARAM(lParam);
If it is appropriate to do so, the system sends the WM_SYSCOMMAND message to the window.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0xA7">
<name>WM_NCMBUTTONDOWN</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the hit-test value returned by the DefWindowProc function as a result of processing the WM_NCHITTEST message. For a list of hit-test values, see WM_NCHITTEST.
</wmisc>
</wparam>
<lparam value="POINTS">
<lname>lParam</lname>
<lmisc>lParam
Specifies a POINTS structure that contains the x- and y-coordinates of the cursor. The coordinates are relative to the upper-left corner of the screen.
</lmisc>
</lparam>
<misc>WM_NCMBUTTONDOWN Notification
The WM_NCMBUTTONDOWN message is posted when the user presses the middle mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.
A window receives this message through its WindowProc function.
Syntax
WM_NCMBUTTONDOWN
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Specifies the hit-test value returned by the DefWindowProc function as a result of processing the WM_NCHITTEST message. For a list of hit-test values, see WM_NCHITTEST.
lParam
Specifies a POINTS structure that contains the x- and y-coordinates of the cursor. The coordinates are relative to the upper-left corner of the screen.
Return Value
Remarks
You can also use the GET_X_LPARAM and GET_Y_LPARAM macros to extract the values of the x- and y- coordinates from lParam.
Copy Code
xPos = GET_X_LPARAM(lParam);
yPos = GET_Y_LPARAM(lParam);
If it is appropriate to do so, the system sends the WM_SYSCOMMAND message to the window.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0xA8">
<name>WM_NCMBUTTONUP</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the hit-test value returned by the DefWindowProc function as a result of processing the WM_NCHITTEST message. For a list of hit-test values, see WM_NCHITTEST.
</wmisc>
</wparam>
<lparam value="POINTS">
<lname>lParam</lname>
<lmisc>lParam
Specifies a POINTS structure that contains the x- and y-coordinates of the cursor. The coordinates are relative to the upper-left corner of the screen.
</lmisc>
</lparam>
<misc>WM_NCMBUTTONUP Notification
The WM_NCMBUTTONUP message is posted when the user releases the middle mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.
A window receives this message through its WindowProc function.
Syntax
WM_NCMBUTTONUP
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Specifies the hit-test value returned by the DefWindowProc function as a result of processing the WM_NCHITTEST message. For a list of hit-test values, see WM_NCHITTEST.
lParam
Specifies a POINTS structure that contains the x- and y-coordinates of the cursor. The coordinates are relative to the upper-left corner of the screen.
Return Value
Remarks
You can also use the GET_X_LPARAM and GET_Y_LPARAM macros to extract the values of the x- and y- coordinates from lParam.
Copy Code
xPos = GET_X_LPARAM(lParam);
yPos = GET_Y_LPARAM(lParam);
If it is appropriate to do so, the system sends the WM_SYSCOMMAND message to the window.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x2A0">
<name>WM_NCMOUSEHOVER</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the hit-test value returned by the DefWindowProc function as a result of processing the WM_NCHITTEST message. For a list of hit-test values, see WM_NCHITTEST.
</wmisc>
</wparam>
<lparam value="POINTS">
<lname>lParam</lname>
<lmisc>lParam
Specifies a POINTS structure that contains the x- and y-coordinates of the cursor. The coordinates are relative to the upper-left corner of the screen.
</lmisc>
</lparam>
<misc>WM_NCMOUSEHOVER Notification
The WM_NCMOUSEHOVER message is posted to a window when the cursor hovers over the nonclient area of the window for the period of time specified in a prior call to TrackMouseEvent.
A window receives this message through its WindowProc function.
Syntax
WM_NCMOUSEHOVER
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Specifies the hit-test value returned by the DefWindowProc function as a result of processing the WM_NCHITTEST message. For a list of hit-test values, see WM_NCHITTEST.
lParam
Specifies a POINTS structure that contains the x- and y-coordinates of the cursor. The coordinates are relative to the upper-left corner of the screen.
Return Value
Remarks
Hover tracking stops when this message is generated. The application must call TrackMouseEvent again if it requires further tracking of mouse hover behavior.
You can also use the GET_X_LPARAM and GET_Y_LPARAM macros to extract the values of the x- and y- coordinates from lParam.
Copy Code
xPos = GET_X_LPARAM(lParam);
yPos = GET_Y_LPARAM(lParam);
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 98, Windows 2000</misc>
</message>
<message value="0x2A2">
<name>WM_NCMOUSELEAVE</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used, must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used, must be zero.</lmisc>
</lparam>
<misc>WM_NCMOUSELEAVE Notification
The WM_NCMOUSELEAVE message is posted to a window when the cursor leaves the nonclient area of the window specified in a prior call to TrackMouseEvent.
A window receives this message through its WindowProc function.
Syntax
WM_NCMOUSELEAVE
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Not used, must be zero.
lParam
Not used, must be zero.
Return Value
Remarks
All tracking requested by TrackMouseEvent is canceled when this message is generated. The application must call TrackMouseEvent when the mouse reenters its window if it requires further tracking of mouse hover behavior.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 98, Windows 2000</misc>
</message>
<message value="0xA0">
<name>WM_NCMOUSEMOVE</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the hit-test value returned by the DefWindowProc function as a result of processing the WM_NCHITTEST message. For a list of hit-test values, see WM_NCHITTEST.
</wmisc>
</wparam>
<lparam value="POINTS">
<lname>lParam</lname>
<lmisc>lParam
Specifies a POINTS structure that contains the x- and y-coordinates of the cursor. The coordinates are relative to the upper-left corner of the screen.
</lmisc>
</lparam>
<misc>WM_NCMOUSEMOVE Notification
The WM_NCMOUSEMOVE message is posted to a window when the cursor is moved within the nonclient area of the window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.
A window receives this message through its WindowProc function.
Syntax
WM_NCMOUSEMOVE
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Specifies the hit-test value returned by the DefWindowProc function as a result of processing the WM_NCHITTEST message. For a list of hit-test values, see WM_NCHITTEST.
lParam
Specifies a POINTS structure that contains the x- and y-coordinates of the cursor. The coordinates are relative to the upper-left corner of the screen.
Return Value
Remarks
If it is appropriate to do so, the system sends the WM_SYSCOMMAND message to the window.
You can also use the GET_X_LPARAM and GET_Y_LPARAM macros to extract the values of the x- and y- coordinates from lParam.
Copy Code
xPos = GET_X_LPARAM(lParam);
yPos = GET_Y_LPARAM(lParam);
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x85">
<name>WM_NCPAINT</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
An application returns zero if it processes this message.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Handle to the update region of the window. The update region is clipped to the window frame.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used.</lmisc>
</lparam>
<misc>WM_NCPAINT Message
The WM_NCPAINT message is sent to a window when its frame must be painted.
A window receives this message through its WindowProc function.
LRESULT CALLBACK WindowProc(
HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
);
Parameters
wParam
Handle to the update region of the window. The update region is clipped to the window frame.
lParam
This parameter is not used.
Return Value
An application returns zero if it processes this message.
Remarks
The DefWindowProc function paints the window frame.
An application can intercept the WM_NCPAINT message and paint its own custom window frame. The clipping region for a window is always rectangular, even if the shape of the frame is altered.
The wParam value can be passed to GetDCEx as in the following example.
Copy Code
case WM_NCPAINT:
{
HDC hdc;
hdc = GetDCEx(hwnd, (HRGN)wParam, DCX_WINDOW|DCX_INTERSECTRGN);
// Paint into this DC
ReleaseDC(hwnd, hdc);
}
Requirements
Client Requires Windows Vista, Windows XP, Windows 2000 Professional, Windows NT Workstation 3.1 and later, Windows Me, Windows 98, or Windows 95.
Header Declared in Winuser.h; include Windows.h.</misc>
</message>
<message value="0xA6">
<name>WM_NCRBUTTONDBLCLK</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the hit-test value returned by the DefWindowProc function as a result of processing the WM_NCHITTEST message. For a list of hit-test values, see WM_NCHITTEST.
</wmisc>
</wparam>
<lparam value="POINTS">
<lname>lParam</lname>
<lmisc>lParam
Specifies a POINTS structure that contains the x- and y-coordinates of the cursor. The coordinates are relative to the upper-left corner of the screen.
</lmisc>
</lparam>
<misc>WM_NCRBUTTONDBLCLK Notification
The WM_NCRBUTTONDBLCLK message is posted when the user double-clicks the right mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.
A window receives this message through its WindowProc function.
Syntax
WM_NCRBUTTONDBLCLK
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Specifies the hit-test value returned by the DefWindowProc function as a result of processing the WM_NCHITTEST message. For a list of hit-test values, see WM_NCHITTEST.
lParam
Specifies a POINTS structure that contains the x- and y-coordinates of the cursor. The coordinates are relative to the upper-left corner of the screen.
Return Value
Remarks
A window need not have the CS_DBLCLKS style to receive WM_NCRBUTTONDBLCLK messages.
The system generates a WM_NCRBUTTONDBLCLK message when the user presses, releases, and again presses the right mouse button within the system's double-click time limit. Double-clicking the right mouse button actually generates four messages: WM_NCRBUTTONDOWN, WM_NCRBUTTONUP, WM_NCRBUTTONDBLCLK, and WM_NCRBUTTONUP again.
You can also use the GET_X_LPARAM and GET_Y_LPARAM macros to extract the values of the x- and y- coordinates from lParam.
Copy Code
xPos = GET_X_LPARAM(lParam);
yPos = GET_Y_LPARAM(lParam);
If it is appropriate to do so, the system sends the WM_SYSCOMMAND message to the window.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0xA4">
<name>WM_NCRBUTTONDOWN</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the hit-test value returned by the DefWindowProc function as a result of processing the WM_NCHITTEST message. For a list of hit-test values, see WM_NCHITTEST.
</wmisc>
</wparam>
<lparam value="POINTS">
<lname>lParam</lname>
<lmisc>lParam
Specifies a POINTS structure that contains the x- and y-coordinates of the cursor. The coordinates are relative to the upper-left corner of the screen.
</lmisc>
</lparam>
<misc>WM_NCRBUTTONDOWN Notification
The WM_NCRBUTTONDOWN message is posted when the user presses the right mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.
A window receives this message through its WindowProc function.
Syntax
WM_NCRBUTTONDOWN
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Specifies the hit-test value returned by the DefWindowProc function as a result of processing the WM_NCHITTEST message. For a list of hit-test values, see WM_NCHITTEST.
lParam
Specifies a POINTS structure that contains the x- and y-coordinates of the cursor. The coordinates are relative to the upper-left corner of the screen.
Return Value
Remarks
You can also use the GET_X_LPARAM and GET_Y_LPARAM macros to extract the values of the x- and y- coordinates from lParam.
Copy Code
xPos = GET_X_LPARAM(lParam);
yPos = GET_Y_LPARAM(lParam);
If it is appropriate to do so, the system sends the WM_SYSCOMMAND message to the window.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0xA5">
<name>WM_NCRBUTTONUP</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the hit-test value returned by the DefWindowProc function as a result of processing the WM_NCHITTEST message. For a list of hit-test values, see WM_NCHITTEST.
</wmisc>
</wparam>
<lparam value="POINTS">
<lname>lParam</lname>
<lmisc>lParam
Specifies a POINTS structure that contains the x- and y-coordinates of the cursor. The coordinates are relative to the upper-left corner of the screen.
</lmisc>
</lparam>
<misc>WM_NCRBUTTONUP Notification
The WM_NCRBUTTONUP message is posted when the user releases the right mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.
A window receives this message through its WindowProc function.
Syntax
WM_NCRBUTTONUP
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Specifies the hit-test value returned by the DefWindowProc function as a result of processing the WM_NCHITTEST message. For a list of hit-test values, see WM_NCHITTEST.
lParam
Specifies a POINTS structure that contains the x- and y-coordinates of the cursor. The coordinates are relative to the upper-left corner of the screen.
Return Value
Remarks
You can also use the GET_X_LPARAM and GET_Y_LPARAM macros to extract the values of the x- and y- coordinates from lParam.
Copy Code
xPos = GET_X_LPARAM(lParam);
yPos = GET_Y_LPARAM(lParam);
If it is appropriate to do so, the system sends the WM_SYSCOMMAND message to the window.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0xAD">
<name>WM_NCXBUTTONDBLCLK</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
The low-order word specifies the hit-test value returned by the DefWindowProc function from processing the WM_NCHITTEST message. For a list of hit-test values, see WM_NCHITTEST.
The high-order word indicates which button was double-clicked. It can be one of the following values.
XBUTTON1
The first X button was double-clicked..
XBUTTON2
The second X button was double-clicked.</wmisc>
</wparam>
<lparam value="POINTS">
<lname>lParam</lname>
<lmisc>lParam
Pointer to a POINTS structure that contains the x- and y-coordinates of the cursor. The coordinates are relative to the upper-left corner of the screen.
</lmisc>
</lparam>
<misc>WM_NCXBUTTONDBLCLK Notification
The WM_NCXBUTTONDBLCLK message is posted when the user double-clicks the first or second X button while the cursor is in the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.
A window receives this message through its WindowProc function.
Syntax
WM_NCXBUTTONDBLCLK
WPARAM wParam
LPARAM lParam;
Parameters
wParam
The low-order word specifies the hit-test value returned by the DefWindowProc function from processing the WM_NCHITTEST message. For a list of hit-test values, see WM_NCHITTEST.
The high-order word indicates which button was double-clicked. It can be one of the following values.
XBUTTON1
The first X button was double-clicked..
XBUTTON2
The second X button was double-clicked.
lParam
Pointer to a POINTS structure that contains the x- and y-coordinates of the cursor. The coordinates are relative to the upper-left corner of the screen.
Return Value
Remarks
Use the following code to get the information in the wParam parameter.
Copy Code
nHittest = GET_NCHITTEST_WPARAM(wParam);
fwButton = GET_XBUTTON_WPARAM(wParam);
You can also use the following code to get the x- and y-coordinates from lParam:
Copy Code
xPos = GET_X_LPARAM(lParam);
yPos = GET_Y_LPARAM(lParam);
By default, the DefWindowProc function tests the specified point to get the position of the cursor and performs the appropriate action. If appropriate, it sends the WM_SYSCOMMAND message to the window.
A window need not have the CS_DBLCLKS style to receive WM_NCXBUTTONDBLCLK messages. The system generates a WM_NCXBUTTONDBLCLK message when the user presses, releases, and again presses an X button within the system's double-click time limit. Double-clicking one of these buttons actually generates four messages: WM_NCXBUTTONDOWN, WM_NCXBUTTONUP, WM_NCXBUTTONDBLCLK, and WM_NCXBUTTONUP again.
Unlike the WM_NCLBUTTONDBLCLK, WM_NCMBUTTONDBLCLK, and WM_NCRBUTTONDBLCLK messages, an application should return TRUE from this message if it processes it. Doing so will allow software that simulates this message on Microsoft Windows systems earlier than Windows 2000 to determine whether the window procedure processed the message or called DefWindowProc to process it.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Millennium, Windows 2000</misc>
</message>
<message value="0xAB">
<name>WM_NCXBUTTONDOWN</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
The low-order word specifies the hit-test value returned by the DefWindowProc function from processing the WM_NCHITTEST message. For a list of hit-test values, see WM_NCHITTEST. The high-order word indicates which button was pressed. It can be one of the following values.
XBUTTON1
The first X button was pressed.
XBUTTON2
The second X button was pressed.</wmisc>
</wparam>
<lparam value="POINTS">
<lname>lParam</lname>
<lmisc>lParam
Pointer to a POINTS structure that contains the x- and y-coordinates of the cursor. The coordinates are relative to the upper-left corner of the screen.
</lmisc>
</lparam>
<misc>WM_NCXBUTTONDOWN Notification
The WM_NCXBUTTONDOWN message is posted when the user presses the first or second X button while the cursor is in the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.
A window receives this message through its WindowProc function.
Syntax
WM_NCXBUTTONDOWN
WPARAM wParam
LPARAM lParam;
Parameters
wParam
The low-order word specifies the hit-test value returned by the DefWindowProc function from processing the WM_NCHITTEST message. For a list of hit-test values, see WM_NCHITTEST. The high-order word indicates which button was pressed. It can be one of the following values.
XBUTTON1
The first X button was pressed.
XBUTTON2
The second X button was pressed.
lParam
Pointer to a POINTS structure that contains the x- and y-coordinates of the cursor. The coordinates are relative to the upper-left corner of the screen.
Return Value
Remarks
Use the following code to get the information in the wParam parameter.
Copy Code
nHittest = GET_NCHITTEST_WPARAM(wParam);
fwButton = GET_XBUTTON_WPARAM(wParam);
You can also use the following code to get the x- and y-coordinates from lParam:
Copy Code
xPos = GET_X_LPARAM(lParam);
yPos = GET_Y_LPARAM(lParam);
By default, the DefWindowProc function tests the specified point to get the position of the cursor and performs the appropriate action. If appropriate, it sends the WM_SYSCOMMAND message to the window.
Unlike the WM_NCLBUTTONDOWN, WM_NCMBUTTONDOWN, and WM_NCRBUTTONDOWN messages, an application should return TRUE from this message if it processes it. Doing so will allow software that simulates this message on Microsoft Windows systems earlier than Windows 2000 to determine whether the window procedure processed the message or called DefWindowProc to process it.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Millennium, Windows 2000</misc>
</message>
<message value="0xAC">
<name>WM_NCXBUTTONUP</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
The low-order word specifies the hit-test value returned by the DefWindowProc function from processing the WM_NCHITTEST message. For a list of hit-test values, see WM_NCHITTEST.
The high-order word indicates which button was released. It can be one of the following values.
XBUTTON1
The first X button was released.
XBUTTON2
The second X button was released.</wmisc>
</wparam>
<lparam value="POINTS">
<lname>lParam</lname>
<lmisc>lParam
Pointer to a POINTS structure that contains the x- and y-coordinates of the cursor. The coordinates are relative to the upper-left corner of the screen.
</lmisc>
</lparam>
<misc>WM_NCXBUTTONUP Notification
The WM_NCXBUTTONUP message is posted when the user releases the first or second X button while the cursor is in the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.
A window receives this message through its WindowProc function.
Syntax
WM_NCXBUTTONUP
WPARAM wParam
LPARAM lParam;
Parameters
wParam
The low-order word specifies the hit-test value returned by the DefWindowProc function from processing the WM_NCHITTEST message. For a list of hit-test values, see WM_NCHITTEST.
The high-order word indicates which button was released. It can be one of the following values.
XBUTTON1
The first X button was released.
XBUTTON2
The second X button was released.
lParam
Pointer to a POINTS structure that contains the x- and y-coordinates of the cursor. The coordinates are relative to the upper-left corner of the screen.
Return Value
Remarks
Use the following code to get the information in the wParam parameter.
Copy Code
nHittest = GET_NCHITTEST_WPARAM(wParam);
fwButton = GET_XBUTTON_WPARAM(wParam);
You can also use the following code to get the x- and y-coordinates from lParam:
Copy Code
xPos = GET_X_LPARAM(lParam);
yPos = GET_Y_LPARAM(lParam);
By default, the DefWindowProc function tests the specified point to get the position of the cursor and performs the appropriate action. If appropriate, it sends the WM_SYSCOMMAND message to the window.
Unlike the WM_NCLBUTTONUP, WM_NCMBUTTONUP, and WM_NCRBUTTONUP messages, an application should return TRUE from this message if it processes it. Doing so will allow software that simulates this message on Microsoft Windows systems earlier than Windows 2000 to determine whether the window procedure processed the message or called DefWindowProc to process it.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Millennium, Windows 2000</misc>
</message>
<message value="0x28">
<name>WM_NEXTDLGCTL</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
If lParam is TRUE, this parameter identifies the control that receives the focus. If lParam is FALSE, this parameter indicates whether the next or previous control with the WS_TABSTOP style receives the focus. If wParam is zero, the next control receives the focus; otherwise, the previous control with the WS_TABSTOP style receives the focus.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
The low-order word indicates how the system uses wParam. If the low-order word is TRUE, wParam is a handle associated with the control that receives the focus; otherwise, wParam is a flag that indicates whether the next or previous control with the WS_TABSTOP style receives the focus.
</lmisc>
</lparam>
<misc>WM_NEXTDLGCTL Notification
The WM_NEXTDLGCTL message is sent to a dialog box procedure to set the keyboard focus to a different control in the dialog box.
Syntax
WM_NEXTDLGCTL
WPARAM wParam
LPARAM lParam;
Parameters
wParam
If lParam is TRUE, this parameter identifies the control that receives the focus. If lParam is FALSE, this parameter indicates whether the next or previous control with the WS_TABSTOP style receives the focus. If wParam is zero, the next control receives the focus; otherwise, the previous control with the WS_TABSTOP style receives the focus.
lParam
The low-order word indicates how the system uses wParam. If the low-order word is TRUE, wParam is a handle associated with the control that receives the focus; otherwise, wParam is a flag that indicates whether the next or previous control with the WS_TABSTOP style receives the focus.
Return Value
Remarks
This message performs additional dialog box management operations beyond those performed by the SetFocus function WM_NEXTDLGCTL updates the default pushbutton border, sets the default control identifier, and automatically selects the text of an edit control (if the target window is an edit control).
Do not use the SendMessage function to send a WM_NEXTDLGCTL message if your application will concurrently process other messages that set the focus. Use the PostMessage function instead.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x213">
<name>WM_NEXTMENU</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
No return value.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the virtual-key code of the key. </wmisc>
</wparam>
<lparam value="LPMDINEXTMENU">
<lname>lpMdiNextMenu</lname>
<lmisc>lpMdiNextMenu
Pointer to a MDINEXTMENU structure that contains information about the menu to be activated. </lmisc>
</lparam>
<misc>WM_NEXTMENU Notification
The WM_NEXTMENU message is sent to an application when the right or left arrow key is used to switch between the menu bar and the system menu.
Syntax
WM_NEXTMENU
WPARAM wParam
lpMdiNextMenu = (LPMDINEXTMENU) lParam;
Parameters
wParam
Specifies the virtual-key code of the key.
lpMdiNextMenu
Pointer to a MDINEXTMENU structure that contains information about the menu to be activated.
Return Value
No return value.
Remarks
In responding to this message, the application can specify the menu to switch to in the hmenuNext member of MDINEXTMENU and the window to receive the menu notification messages in the hwndNext member of the MDINEXTMENU structure. You must set both members for the changes to take effect (they are initially NULL).
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0x4E">
<name>WM_NOTIFY</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="int">
<wname>idCtrl</wname>
<wmisc>idCtrl
The identifier of the common control sending the message. This identifier is not guaranteed to be unique. An application should use the hwndFrom or idFrom member of the NMHDR structure (passed as the lParam parameter) to identify the control.
</wmisc>
</wparam>
<lparam value="LPNMHDR">
<lname>pnmh</lname>
<lmisc>pnmh
A pointer to an NMHDR structure that contains the notification code and additional information. For some notification messages, this parameter points to a larger structure that has the NMHDR structure as its first member.
</lmisc>
</lparam>
<misc>WM_NOTIFY Message
Sent by a common control to its parent window when an event has occurred or the control requires some information.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) WM_NOTIFY, // message ID
(WPARAM) wParam, // = (WPARAM) (int) idCtrl;
(LPARAM) lParam // = (LPARAM) (LPNMHDR) pnmh;
);
Parameters
idCtrl
The identifier of the common control sending the message. This identifier is not guaranteed to be unique. An application should use the hwndFrom or idFrom member of the NMHDR structure (passed as the lParam parameter) to identify the control.
pnmh
A pointer to an NMHDR structure that contains the notification code and additional information. For some notification messages, this parameter points to a larger structure that has the NMHDR structure as its first member.
Return Value
Remarks
The standard SendMessage syntax shown on this page is somewhat misleading. The destination of the message must be the HWND of the parent of the control. This value can be obtained by using GetParent, as shown in the following example, where m_controlHwnd is the HWND of the control itself.
Copy Code
NMHDR nmh;
nmh.code = CUSTOM_SELCHANGE; // Message type defined by control.
nmh.idFrom = GetDlgCtrlID(m_controlHwnd);
nmh.hwndFrom = m_controlHwnd;
SendMessage(GetParent(m_controlHwnd),
WM_NOTIFY,
(WPARAM)m_controlHwnd,
(LPARAM)nmh);
Applications handle the message in the window procedure of the parent window, as shown in the following example, which handles the notification message sent by the custom control in the previous example.
Copy Code
INT_PTR CALLBACK DlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_NOTIFY:
switch (((LPNMHDR)lParam)-code)
{
case CUSTOM_SELCHANGE:
if (((LPNMHDR)lParam)-idFrom == IDC_CUSTOMLISTBOX1)
{
... // Respond to message.
return TRUE;
}
break;
... // More cases on WM_NOTIFY switch.
break;
}
... // More cases on message switch.
}
return FALSE;
}
Some notifications, chiefly those that have been in the API for a long time, are sent as WM_COMMAND messages. For more information, see Control Messages.
If the message handler is in a dialog box procedure, you must use the SetWindowLong function with DWL_MSGRESULT to set a return value.
For Microsoft Windows 2000 and later systems, the WM_NOTIFY message cannot be sent between processes.
Many notifications are available in both ANSI and Unicode formats. The window sending the WM_NOTIFY message uses the WM_NOTIFYFORMAT message to determine which format should be used. See WM_NOTIFYFORMAT for further discussion.
Message Information
Header winuser.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x55">
<name>WM_NOTIFYFORMAT</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
Returns one of the following values.
NFR_ANSI ANSI structures should be used in WM_NOTIFY messages sent by the control.
NFR_UNICODE Unicode structures should be used in WM_NOTIFY messages sent by the control.
0 An error occurred.
</returnmisc>
</return>
<wparam value="HWND">
<wname>hwndFrom</wname>
<wmisc>hwndFrom
A handle to the window that is sending the WM_NOTIFYFORMAT message. If Command is NF_QUERY, this parameter is the handle to a control. If Command is NF_REQUERY, this parameter is the handle to the parent window of a control.
</wmisc>
</wparam>
<lparam value="">
<lname>Command</lname>
<lmisc>Command
The command value that specifies the nature of the WM_NOTIFYFORMAT message. This will be one of the following values:
NF_QUERY
The message is a query to determine whether ANSI or Unicode structures should be used in WM_NOTIFY messages. This command is sent from a control to its parent window during the creation of a control and in response to an NF_REQUERY command.
NF_REQUERY
The message is a request for a control to send an NF_QUERY form of this message to its parent window. This command is sent from the parent window. The parent window is asking the control to requery it about the type of structures to use in WM_NOTIFY messages. If Command is NF_REQUERY, the return value is the result of the requery operation.
</lmisc>
</lparam>
<misc>WM_NOTIFYFORMAT Message
Determines if a window accepts ANSI or Unicode structures in the WM_NOTIFY notification message. WM_NOTIFYFORMAT messages are sent from a common control to its parent window and from the parent window to the common control.
To send this message, call the SendMessage function as follows.
Syntax
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) WM_NOTIFYFORMAT, // message ID
(WPARAM) wParam, // = (WPARAM) (HWND) hwndFrom
(LPARAM) lParam // = Command
);
Parameters
hwndFrom
A handle to the window that is sending the WM_NOTIFYFORMAT message. If Command is NF_QUERY, this parameter is the handle to a control. If Command is NF_REQUERY, this parameter is the handle to the parent window of a control.
Command
The command value that specifies the nature of the WM_NOTIFYFORMAT message. This will be one of the following values:
NF_QUERY
The message is a query to determine whether ANSI or Unicode structures should be used in WM_NOTIFY messages. This command is sent from a control to its parent window during the creation of a control and in response to an NF_REQUERY command.
NF_REQUERY
The message is a request for a control to send an NF_QUERY form of this message to its parent window. This command is sent from the parent window. The parent window is asking the control to requery it about the type of structures to use in WM_NOTIFY messages. If Command is NF_REQUERY, the return value is the result of the requery operation.
Return Value
Returns one of the following values.
NFR_ANSI ANSI structures should be used in WM_NOTIFY messages sent by the control.
NFR_UNICODE Unicode structures should be used in WM_NOTIFY messages sent by the control.
0 An error occurred.
Remarks
When a common control is created, the control sends a WM_NOTIFYFORMAT message to its parent window to determine the type of structures to use in WM_NOTIFY messages. If the parent window does not handle this message, the DefWindowProc function responds according to the type of the parent window. That is, if the parent window is a Unicode window, DefWindowProc returns NFR_UNICODE, and if the parent window is an ANSI window, DefWindowProc returns NFR_ANSI. If the parent window is a dialog box and does not handle this message, the DefDlgProc function similarly responds according to the type of the dialog box (Unicode or ANSI).
A parent window can change the type of structures a common control uses in WM_NOTIFY messages by setting lParam to NF_REQUERY and sending a WM_NOTIFYFORMAT message to the control. This causes the control to send an NF_QUERY form of the WM_NOTIFYFORMAT message to the parent window.
All common controls will send WM_NOTIFYFORMAT messages. However, the standard Windows controls (edit controls, combo boxes, list boxes, buttons, scroll bars, and static controls) do not.
Message Information
Header winuser.h
Minimum operating systems Windows NT 3.51, Windows 95</misc>
</message>
<message value="0x0">
<name>WM_NULL</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
An application returns zero if it processes this message. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used. </lmisc>
</lparam>
<misc>WM_NULL Notification
The WM_NULL message performs no operation. An application sends the WM_NULL message if it wants to post a message that the recipient window will ignore.
A window receives this message through its WindowProc function.
Syntax
WM_NULL
WPARAM wParam
LPARAM lParam;
Parameters
wParam
This parameter is not used.
lParam
This parameter is not used.
Return Value
An application returns zero if it processes this message.
Remarks
For example, if an application has installed a WH_GETMESSAGE hook and wants to prevent a message from being processed, the GetMsgProc callback function can change the message number to WM_NULL so the recipient will ignore it.
As another example, an application can check if a window is responding to messages by sending the WM_NULL message with the SendMessageTimeout function.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x42">
<name>WM_OTHERWINDOWCREATED</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x43">
<name>WM_OTHERWINDOWDESTROYED</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0xF">
<name>WM_PAINT</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
An application returns zero if it processes this message.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used.</lmisc>
</lparam>
<misc>WM_PAINT Message
The WM_PAINT message is sent when the system or another application makes a request to paint a portion of an application's window. The message is sent when the UpdateWindow or RedrawWindow function is called, or by the DispatchMessage function when the application obtains a WM_PAINT message by using the GetMessage or PeekMessage function.
A window receives this message through its WindowProc function.
LRESULT CALLBACK WindowProc(
HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
);
Parameters
wParam
This parameter is not used.
lParam
This parameter is not used.
Return Value
An application returns zero if it processes this message.
Remarks
The WM_PAINT message is generated by the system and should not be sent by an application. To force a window to draw into a specific device context, use the WM_PRINT or WM_PRINTCLIENT message. Note that this requires the target window to support the WM_PRINTCLIENT message. Most common controls support the WM_PRINTCLIENT message.
The DefWindowProc function validates the update region. The function may also send the WM_NCPAINT message to the window procedure if the window frame must be painted and send the WM_ERASEBKGND message if the window background must be erased.
The system sends this message when there are no other messages in the application's message queue. DispatchMessage determines where to send the message; GetMessage determines which message to dispatch. GetMessage returns the WM_PAINT message when there are no other messages in the application's message queue, and DispatchMessage sends the message to the appropriate window procedure.
A window may receive internal paint messages as a result of calling RedrawWindow with the RDW_INTERNALPAINT flag set. In this case, the window may not have an update region. An application should call the GetUpdateRect function to determine whether the window has an update region. If GetUpdateRect returns zero, the application should not call the BeginPaint and EndPaint functions.
An application must check for any necessary internal painting by looking at its internal data structures for each WM_PAINT message, because a WM_PAINT message may have been caused by both a non-NULL update region and a call to RedrawWindow with the RDW_INTERNALPAINT flag set.
The system sends an internal WM_PAINT message only once. After an internal WM_PAINT message is returned from GetMessage or PeekMessage or is sent to a window by UpdateWindow, the system does not post or send further WM_PAINT messages until the window is invalidated or until RedrawWindow is called again with the RDW_INTERNALPAINT flag set.
For some common controls, the default WM_PAINT message processing checks the wParam parameter. If wParam is non-NULL, the control assumes that the value is an HDC and paints using that device context.
Requirements
Client Requires Windows Vista, Windows XP, Windows 2000 Professional, Windows NT Workstation 3.1 and later, Windows Me, Windows 98, or Windows 95.
Header Declared in Winuser.h; include Windows.h.</misc>
</message>
<message value="0x309">
<name>WM_PAINTCLIPBOARD</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
If an application processes this message, it should return zero. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Handle to the clipboard viewer window.</wmisc>
</wparam>
<lparam value="LPPAINTSTRUCT">
<lname>lpPaint</lname>
<lmisc>lpPaint
Handle to a global memory object that contains a PAINTSTRUCT structure. The structure defines the part of the client area to paint.
</lmisc>
</lparam>
<misc>WM_PAINTCLIPBOARD Notification
The WM_PAINTCLIPBOARD message is sent to the clipboard owner by a clipboard viewer window when the clipboard contains data in the CF_OWNERDISPLAY format and the clipboard viewer's client area needs repainting.
Syntax
WM_PAINTCLIPBOARD
WPARAM wParam
lpPaint = (LPPAINTSTRUCT) lParam;
Parameters
wParam
Handle to the clipboard viewer window.
lpPaint
Handle to a global memory object that contains a PAINTSTRUCT structure. The structure defines the part of the client area to paint.
Return Value
If an application processes this message, it should return zero.
Remarks
To determine whether the entire client area or just a portion of it needs repainting, the clipboard owner must compare the dimensions of the drawing area given in the rcPaint member of PAINTSTRUCT to the dimensions given in the most recent WM_SIZECLIPBOARD message.
The clipboard owner must use the GlobalLock function to lock the memory that contains the PAINTSTRUCT structure. Before returning, the clipboard owner must unlock that memory by using the GlobalUnlock function.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x26">
<name>WM_PAINTICON</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used; must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used; must be zero.</lmisc>
</lparam>
<misc>WM_PAINTICON Notification
Windows NT 3.51 and earlier: The WM_PAINTICON message is sent to a minimized window when the icon is to be painted. This message is not sent by newer versions of Microsoft Windows, except in unusual circumstances explained in the Remarks.
Syntax
WM_PAINTICON
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
Remarks
Windows 95/98/Me, Windows NT 4.0 and later: This message is sent only to 16-bit windows (note that this is with a lowercase "W"), and only for compatibility reasons. Under such conditions, the value of wParam is TRUE (the value carries no significance).
On Microsoft Windows NT 3.51 and earlier, or on newer versions of Windows when the unusual circumstances above are met, the window receives this message only if a class icon is defined for the window; otherwise, WM_PAINT is sent instead.
Windows NT 3.51 and earlier: The DefWindowProc function draws the class icon. On newer versions of Windows, the DefWindowProc function ignores the message.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x311">
<name>WM_PALETTECHANGED</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
This message does not return a value.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Handle to the window that caused the system palette to change.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used.</lmisc>
</lparam>
<misc>WM_PALETTECHANGED Message
The WM_PALETTECHANGED message is sent to all top-level and overlapped windows after the window with the keyboard focus has realized its logical palette, thereby changing the system palette. This message enables a window that uses a color palette but does not have the keyboard focus to realize its logical palette and update its client area.
A window receives this message through its WindowProc function.
LRESULT CALLBACK WindowProc(
HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
);
Parameters
wParam
Handle to the window that caused the system palette to change.
lParam
This parameter is not used.
Return Value
This message does not return a value.
Remarks
This message must be sent to all top-level and overlapped windows, including the one that changed the system palette. If any child windows use a color palette, this message must be passed on to them as well.
To avoid creating an infinite loop, a window that receives this message must not realize its palette, unless it determines that wParam does not contain its own window handle.
Requirements
Client Requires Windows Vista, Windows XP, Windows 2000 Professional, Windows NT Workstation 3.1 and later, Windows Me, Windows 98, or Windows 95.
Header Declared in Winuser.h; include Windows.h.</misc>
</message>
<message value="0x310">
<name>WM_PALETTEISCHANGING</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
If an application processes this message, it should return zero.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Handle to the window that is going to realize its logical palette.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used.</lmisc>
</lparam>
<misc>WM_PALETTEISCHANGING Message
The WM_PALETTEISCHANGING message informs applications that an application is going to realize its logical palette.
A window receives this message through its WindowProc function.
LRESULT CALLBACK WindowProc(
HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
);
Parameters
wParam
Handle to the window that is going to realize its logical palette.
lParam
This parameter is not used.
Return Value
If an application processes this message, it should return zero.
Remarks
The application changing its palette does not wait for acknowledgment of this message before changing the palette and sending the WM_PALETTECHANGED message. As a result, the palette may already be changed by the time an application receives this message.
If the application either ignores or fails to process this message and a second application realizes its palette while the first is using palette indexes, there is a strong possibility that the user will see unexpected colors during subsequent drawing operations.
Requirements
Client Requires Windows Vista, Windows XP, Windows 2000 Professional, Windows NT Workstation 3.1 and later, Windows Me, Windows 98, or Windows 95.
Header Declared in Winuser.h; include Windows.h.</misc>
</message>
<message value="0x210">
<name>WM_PARENTNOTIFY</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
If an application processes this message, it should return zero. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
The low-order word of wParam specifies the event for which the parent is being notified. This parameter can be one of the following values.
WM_CREATE
The child window is being created.
WM_DESTROY
The child window is being destroyed.
WM_LBUTTONDOWN
The user has placed the cursor over the child window and has clicked the left mouse button.
WM_MBUTTONDOWN
The user has placed the cursor over the child window and has clicked the middle mouse button.
WM_RBUTTONDOWN
The user has placed the cursor over the child window and has clicked the right mouse button.
WM_XBUTTONDOWN
Windows 2000/XP: The user has placed the cursor over the child window and has clicked the first or second X button.
The following table shows values of the low-order word of wParam and the corresponding meanings of the high-order word of wParam.
LOWORD(wParam)
Meaning of HIWORD(wParam)
WM_CREATE
Identifier of the child window.
WM_DESTROY
Identifier of the child window.
WM_LBUTTONDOWN
Undefined.
WM_MBUTTONDOWN
Undefined.
WM_RBUTTONDOWN
Undefined.
WM_XBUTTONDOWN
Windows 2000/XP: Indicates which button was pressed. This parameter can be one of the following values: XBUTTON1
XBUTTON2</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
The following table shows values of the low-order word of wParam and the corresponding meanings of lParam.
WM_CREATE
Handle of the child window.
WM_DESTROY
Handle of the child window.
WM_LBUTTONDOWN
The x-coordinate of the cursor is the low-order word, and the y-coordinate of the cursor is the high-order word.
WM_MBUTTONDOWN
The x-coordinate of the cursor is the low-order word, and the y-coordinate of the cursor is the high-order word.
WM_RBUTTONDOWN
The x-coordinate of the cursor is the low-order word, and the y-coordinate of the cursor is the high-order word.
WM_XBUTTONDOWN
The x-coordinate of the cursor is the low-order word, and the y-coordinate of the cursor is the high-order word.
</lmisc>
</lparam>
<misc>WM_PARENTNOTIFY Notification
The WM_PARENTNOTIFY message is sent to the parent of a child window when the child window is created or destroyed, or when the user clicks a mouse button while the cursor is over the child window. When the child window is being created, the system sends WM_PARENTNOTIFY just before the CreateWindow or CreateWindowEx function that creates the window returns. When the child window is being destroyed, the system sends the message before any processing to destroy the window takes place.
A window receives this message through its WindowProc function.
Syntax
WM_PARENTNOTIFY
WPARAM wParam
LPARAM lParam;
Parameters
wParam
The low-order word of wParam specifies the event for which the parent is being notified. This parameter can be one of the following values.
WM_CREATE
The child window is being created.
WM_DESTROY
The child window is being destroyed.
WM_LBUTTONDOWN
The user has placed the cursor over the child window and has clicked the left mouse button.
WM_MBUTTONDOWN
The user has placed the cursor over the child window and has clicked the middle mouse button.
WM_RBUTTONDOWN
The user has placed the cursor over the child window and has clicked the right mouse button.
WM_XBUTTONDOWN
Windows 2000/XP: The user has placed the cursor over the child window and has clicked the first or second X button.
The following table shows values of the low-order word of wParam and the corresponding meanings of the high-order word of wParam.
LOWORD(wParam)
Meaning of HIWORD(wParam)
WM_CREATE
Identifier of the child window.
WM_DESTROY
Identifier of the child window.
WM_LBUTTONDOWN
Undefined.
WM_MBUTTONDOWN
Undefined.
WM_RBUTTONDOWN
Undefined.
WM_XBUTTONDOWN
Windows 2000/XP: Indicates which button was pressed. This parameter can be one of the following values: XBUTTON1
XBUTTON2
lParam
The following table shows values of the low-order word of wParam and the corresponding meanings of lParam.
WM_CREATE
Handle of the child window.
WM_DESTROY
Handle of the child window.
WM_LBUTTONDOWN
The x-coordinate of the cursor is the low-order word, and the y-coordinate of the cursor is the high-order word.
WM_MBUTTONDOWN
The x-coordinate of the cursor is the low-order word, and the y-coordinate of the cursor is the high-order word.
WM_RBUTTONDOWN
The x-coordinate of the cursor is the low-order word, and the y-coordinate of the cursor is the high-order word.
WM_XBUTTONDOWN
The x-coordinate of the cursor is the low-order word, and the y-coordinate of the cursor is the high-order word.
Return Value
If an application processes this message, it should return zero.
Remarks
This message is also sent to all ancestor windows of the child window, including the top-level window.
All child windows, except those that have the WS_EX_NOPARENTNOTIFY extended window style, send this message to their parent windows. By default, child windows in a dialog box have the WS_EX_NOPARENTNOTIFY style, unless the CreateWindowEx function is called to create the child window without this style.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x302">
<name>WM_PASTE</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
This message does not return a value. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used; must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used; must be zero. </lmisc>
</lparam>
<misc>WM_PASTE Message
An application sends a WM_PASTE message to an edit control or combo box to copy the current content of the clipboard to the edit control at the current caret position. Data is inserted only if the clipboard contains data in CF_TEXT format.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) WM_PASTE, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
This message does not return a value.
Remarks
When sent to a combo box, the WM_PASTE message is handled by its edit control. This message has no effect when sent to a combo box with the CBS_DROPDOWNLIST style.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x380">
<name>WM_PENWINFIRST</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x38F">
<name>WM_PENWINLAST</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x48">
<name>WM_POWER</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
The value an application returns depends on the value of the wParam parameter. If wParam is PWR_SUSPENDREQUEST, the return value is PWR_FAIL to prevent the system from entering the suspended state; otherwise, it is PWR_OK. If wParam is PWR_SUSPENDRESUME or PWR_CRITICALRESUME, the return value is zero.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
The power-event notification. This parameter can be one of the following values.
Value Meaning
PWR_CRITICALRESUME
Indicates that the system is resuming operation after entering suspended mode without first broadcasting a PWR_SUSPENDREQUEST notification message to the application. An application should perform any necessary recovery actions.
PWR_SUSPENDREQUEST
Indicates that the system is about to enter suspended mode.
PWR_SUSPENDRESUME
Indicates that the system is resuming operation after having entered suspended mode normally that is, the system broadcast a PWR_SUSPENDREQUEST notification message to the application before the system was suspended. An application should perform any necessary recovery actions.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used.</lmisc>
</lparam>
<misc>WM_POWER Message
Notifies applications that the system, typically a battery-powered personal computer, is about to enter a suspended mode.
Note The WM_POWER message is obsolete. It is provided only for compatibility with 16-bit Windows-based applications. Applications should use the WM_POWERBROADCAST message.
A window receives this message through its WindowProc function.
LRESULT CALLBACK WindowProc
HWND hwnd, // handle to window
UINT uMsg, // WM_POWER
WPARAM wParam, // power-event notification
LPARAM lParam // not used
);
Parameters
hwnd
A handle to window.
uMsg
The WM_POWER message identifier.
wParam
The power-event notification. This parameter can be one of the following values.
Value Meaning
PWR_CRITICALRESUME
Indicates that the system is resuming operation after entering suspended mode without first broadcasting a PWR_SUSPENDREQUEST notification message to the application. An application should perform any necessary recovery actions.
PWR_SUSPENDREQUEST
Indicates that the system is about to enter suspended mode.
PWR_SUSPENDRESUME
Indicates that the system is resuming operation after having entered suspended mode normally that is, the system broadcast a PWR_SUSPENDREQUEST notification message to the application before the system was suspended. An application should perform any necessary recovery actions.
lParam
This parameter is not used.
Return Value
The value an application returns depends on the value of the wParam parameter. If wParam is PWR_SUSPENDREQUEST, the return value is PWR_FAIL to prevent the system from entering the suspended state; otherwise, it is PWR_OK. If wParam is PWR_SUSPENDRESUME or PWR_CRITICALRESUME, the return value is zero.
Remarks
This message is broadcast only to an application that is running on a system that conforms to the Advanced Power Management (APM) basic input/output system (BIOS) specification. The message is broadcast by the power-management driver to each window returned by the EnumWindows function.
The suspended mode is the state in which the greatest amount of power savings occurs, but all operational data and parameters are preserved. Random-access memory (RAM) contents are preserved, but many devices are likely to be turned off.
Requirements
Minimum supported client Windows 2000 Professional
Minimum supported server Windows 2000 Server
Header WinUser.h (include Windows.h)</misc>
</message>
<message value="0x218">
<name>WM_POWERBROADCAST</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
An application should return TRUE if it processes this message.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
The power-management event. This parameter can be one of the following event identifiers.
Event Meaning
PBT_APMPOWERSTATUSCHANGE
10
0xA
Power status has changed.
PBT_APMRESUMEAUTOMATIC
18
0x12
Operation is resuming automatically from a low-power state. This message is sent every time the system resumes.
PBT_APMRESUMESUSPEND
7
0x7
Operation is resuming from a low-power state. This message is sent after PBT_APMRESUMEAUTOMATIC if the resume is triggered by user input, such as pressing a key.
PBT_APMSUSPEND
4
0x4
System is suspending operation.
PBT_POWERSETTINGCHANGE
32787
0x8013
A power setting change event has been received.
Windows Server 2003, Windows XP, and Windows 2000: The following event identifiers are also supported.
Event Meaning
PBT_APMBATTERYLOW
9
0x9
Battery power is low. In Windows Server 2008 and Windows Vista, use PBT_APMPOWERSTATUSCHANGE instead.
PBT_APMOEMEVENT
11
0xB
OEM-defined event occurred. In Windows Server 2008 and Windows Vista, this event is not available because these operating systems support only ACPI; APM BIOS events are not supported.
PBT_APMQUERYSUSPEND
0
0x0
Request for permission to suspend. In Windows Server 2008 and Windows Vista, use the SetThreadExecutionState function instead.
PBT_APMQUERYSUSPENDFAILED
2
0x2
Suspension request denied. In Windows Server 2008 and Windows Vista, use SetThreadExecutionState instead.
PBT_APMRESUMECRITICAL
6
0x6
Operation resuming after critical suspension. In Windows Server 2008 and Windows Vista, use PBT_APMRESUMEAUTOMATIC instead.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
The event-specific data. For most events, this parameter is reserved and not used.
If the wParam parameter is PBT_POWERSETTINGCHANGE, the lParam parameter is a pointer to a POWERBROADCAST_SETTING structure.
</lmisc>
</lparam>
<misc>WM_POWERBROADCAST Message
Notifies applications that a power-management event has occurred.
A window receives this message through its WindowProc function.
LRESULT CALLBACK WindowProc(
HWND hwnd, // handle to window
UINT uMsg, // WM_POWERBROADCAST
WPARAM wParam, // power-management event
LPARAM lParam // function-specific data
);
Parameters
hwnd
A handle to window.
uMsg
Value Meaning
WM_POWERBROADCAST
536
0x218
Message identifier.
wParam
The power-management event. This parameter can be one of the following event identifiers.
Event Meaning
PBT_APMPOWERSTATUSCHANGE
10
0xA
Power status has changed.
PBT_APMRESUMEAUTOMATIC
18
0x12
Operation is resuming automatically from a low-power state. This message is sent every time the system resumes.
PBT_APMRESUMESUSPEND
7
0x7
Operation is resuming from a low-power state. This message is sent after PBT_APMRESUMEAUTOMATIC if the resume is triggered by user input, such as pressing a key.
PBT_APMSUSPEND
4
0x4
System is suspending operation.
PBT_POWERSETTINGCHANGE
32787
0x8013
A power setting change event has been received.
Windows Server 2003, Windows XP, and Windows 2000: The following event identifiers are also supported.
Event Meaning
PBT_APMBATTERYLOW
9
0x9
Battery power is low. In Windows Server 2008 and Windows Vista, use PBT_APMPOWERSTATUSCHANGE instead.
PBT_APMOEMEVENT
11
0xB
OEM-defined event occurred. In Windows Server 2008 and Windows Vista, this event is not available because these operating systems support only ACPI; APM BIOS events are not supported.
PBT_APMQUERYSUSPEND
0
0x0
Request for permission to suspend. In Windows Server 2008 and Windows Vista, use the SetThreadExecutionState function instead.
PBT_APMQUERYSUSPENDFAILED
2
0x2
Suspension request denied. In Windows Server 2008 and Windows Vista, use SetThreadExecutionState instead.
PBT_APMRESUMECRITICAL
6
0x6
Operation resuming after critical suspension. In Windows Server 2008 and Windows Vista, use PBT_APMRESUMEAUTOMATIC instead.
lParam
The event-specific data. For most events, this parameter is reserved and not used.
If the wParam parameter is PBT_POWERSETTINGCHANGE, the lParam parameter is a pointer to a POWERBROADCAST_SETTING structure.
Return Value
An application should return TRUE if it processes this message.
Windows Server 2003, Windows XP, and Windows 2000: An application can return BROADCAST_QUERY_DENY to deny a PBT_APMQUERYSUSPEND or PBT_APMQUERYSUSPENDFAILED request.
Remarks
The system always sends a PBT_APMRESUMEAUTOMATIC message whenever the system resumes. If the system resumes in response to user input such as pressing a key, the system also sends a PBT_APMRESUMESUSPEND message after sending PBT_APMRESUMEAUTOMATIC.
WM_POWERBROADCAST messages do not distinguish between different low-power states. An application can determine only that the system is entering or has resumed from a low-power state; it cannot determine the specific power state. The system records details about power state transitions in the Windows System event log.
To prevent the system from transitioning to a low-power state in Windows Vista, an application must call SetThreadExecutionState to inform the system that it is in use.
The following messages are not supported on any of the operating systems specified in the Requirements section:
PBT_APMQUERYSTANDBY
PBT_APMQUERYSTANDBYFAILED
PBT_APMSTANDBY
PBT_APMRESUMESTANDBY
Requirements
Minimum supported client Windows 2000 Professional
Minimum supported server Windows 2000 Server
Header WinUser.h (include Windows.h)</misc>
</message>
<message value="0x317">
<name>WM_PRINT</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
This message does not return a value.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Handle to the device context to draw in.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Specifies the drawing options. This parameter can be one or more of the following values.
Value Meaning
PRF_CHECKVISIBLE
Draws the window only if it is visible.
PRF_CHILDREN
Draws all visible children windows.
PRF_CLIENT
Draws the client area of the window.
PRF_ERASEBKGND
Erases the background before drawing the window.
PRF_NONCLIENT
Draws the nonclient area of the window.
PRF_OWNED
Draws all owned windows.</lmisc>
</lparam>
<misc>WM_PRINT Message
The WM_PRINT message is sent to a window to request that it draw itself in the specified device context, most commonly in a printer device context.
A window receives this message through its WindowProc function.
LRESULT CALLBACK WindowProc(
HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
);
Parameters
wParam
Handle to the device context to draw in.
lParam
Specifies the drawing options. This parameter can be one or more of the following values.
Value Meaning
PRF_CHECKVISIBLE
Draws the window only if it is visible.
PRF_CHILDREN
Draws all visible children windows.
PRF_CLIENT
Draws the client area of the window.
PRF_ERASEBKGND
Erases the background before drawing the window.
PRF_NONCLIENT
Draws the nonclient area of the window.
PRF_OWNED
Draws all owned windows.
Return Value
This message does not return a value.
Remarks
The DefWindowProc function processes this message based on which drawing option is specified: if PRF_CHECKVISIBLE is specified and the window is not visible, do nothing, if PRF_NONCLIENT is specified, draw the nonclient area in the specified device context, if PRF_ERASEBKGND is specified, send the window a WM_ERASEBKGND message, if PRF_CLIENT is specified, send the window a WM_PRINTCLIENT message, if PRF_CHILDREN is set, send each visible child window a WM_PRINT message, if PRF_OWNED is set, send each visible owned window a WM_PRINT message.
Requirements
Client Requires Windows Vista, Windows XP, Windows 2000 Professional, Windows NT Workstation, Windows Me, Windows 98, or Windows 95.
Header Declared in Winuser.h; include Windows.h.</misc>
</message>
<message value="0x318">
<name>WM_PRINTCLIENT</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
This message does not return a value.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Handle to the device context to draw in.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Specifies drawing options. This parameter can be one or more of the following values.
Value Meaning
PRF_CHECKVISIBLE
Draws the window only if it is visible.
PRF_CHILDREN
Draws all visible children windows.
PRF_CLIENT
Draws the client area of the window.
PRF_ERASEBKGND
Erases the background before drawing the window.
PRF_NONCLIENT
Draws the nonclient area of the window.
PRF_OWNED
Draws all owned windows.</lmisc>
</lparam>
<misc>WM_PRINTCLIENT Message
The WM_PRINTCLIENT message is sent to a window to request that it draw its client area in the specified device context, most commonly in a printer device context.
Unlike WM_PRINT, WM_PRINTCLIENT is not processed by DefWindowProc. A window should process the WM_PRINTCLIENT message through an application-defined WindowProc function for it to be used properly.
LRESULT CALLBACK WindowProc(
HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
);
Parameters
wParam
Handle to the device context to draw in.
lParam
Specifies drawing options. This parameter can be one or more of the following values.
Value Meaning
PRF_CHECKVISIBLE
Draws the window only if it is visible.
PRF_CHILDREN
Draws all visible children windows.
PRF_CLIENT
Draws the client area of the window.
PRF_ERASEBKGND
Erases the background before drawing the window.
PRF_NONCLIENT
Draws the nonclient area of the window.
PRF_OWNED
Draws all owned windows.
Return Value
This message does not return a value.
Remarks
A window can process this message in much the same manner as WM_PAINT, except that BeginPaint and EndPaint need not be called (a device context is provided), and the window should draw its entire client area rather than just the invalid region.
Windows that can be used anywhere in the system, such as controls, should process this message. It is probably worthwhile for other windows to process this message as well because it is relatively easy to implement.
The AnimateWindow function requires that the window being animated implements the WM_PRINTCLIENT message.
Requirements
Client Requires Windows Vista, Windows XP, Windows 2000 Professional, Windows NT Workstation, Windows Me, Windows 98, or Windows 95.
Header Declared in Winuser.h; include Windows.h.</misc>
</message>
<message value="0x405">
<name>WM_PSD_ENVSTAMPRECT</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Value
If the hook procedure returns TRUE, the dialog box does not draw the envelope-stamp portion of the sample page.
If the hook procedure returns FALSE, the dialog box draws the envelope-stamp portion of the sample page.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Handle to the device context for the sample page. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Pointer to a structure that contains the coordinates, in pixels, of the envelope-stamp rectangle.
</lmisc>
</lparam>
<misc>WM_PSD_ENVSTAMPRECT Notification
The WM_PSD_ENVSTAMPRECT message notifies the hook procedure of a Page Setup dialog box, PagePaintHook, that the dialog box is about to draw the envelope-stamp rectangle of the sample page.
Syntax
WM_PSD_ENVSTAMPRECT
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Handle to the device context for the sample page.
lParam
Pointer to a structure that contains the coordinates, in pixels, of the envelope-stamp rectangle.
Return Value
If the hook procedure returns TRUE, the dialog box does not draw the envelope-stamp portion of the sample page.
If the hook procedure returns FALSE, the dialog box draws the envelope-stamp portion of the sample page.
Remarks
The Page Setup dialog box includes an image of a sample page that shows how the user's selections affect the appearance of the printed output. When you call the PageSetupDlg function, you can provide a PagePaintHook hook procedure to customize the appearance of the sample page. Whenever the dialog box is about to draw the contents of the sample page, the dialog box sends a sequence of messages to the hook procedure.
A hook procedure receives this message only if the selected paper type is an envelope.
Notification Requirements
Minimum DLL Version None
Header Declared in Commdlg.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.51</misc>
</message>
<message value="0x401">
<name>WM_PSD_FULLPAGERECT</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Value
If the hook procedure returns TRUE, the dialog box sends no more messages and does not draw in the sample page until the next time the system needs to redraw the sample page.
If the hook procedure returns FALSE, the dialog box sends the remaining messages of the drawing sequence.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Handle to the device context for the sample page. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Pointer to a structure that contains the coordinates, in pixels, of the sample page.
</lmisc>
</lparam>
<misc>WM_PSD_FULLPAGERECT Notification
The WM_PSD_FULLPAGERECT message informs a PagePaintHook hook procedure of the coordinates of the sample page rectangle in the Page Setup dialog box. The dialog box sends this message when it is about to draw the contents of the sample page.
Syntax
WM_PSD_FULLPAGERECT
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Handle to the device context for the sample page.
lParam
Pointer to a structure that contains the coordinates, in pixels, of the sample page.
Return Value
If the hook procedure returns TRUE, the dialog box sends no more messages and does not draw in the sample page until the next time the system needs to redraw the sample page.
If the hook procedure returns FALSE, the dialog box sends the remaining messages of the drawing sequence.
Remarks
The Page Setup dialog box includes an image of a sample page that shows how the user's selections affect the appearance of the printed output. When you call the PageSetupDlg function, you can provide a PagePaintHook hook procedure to customize the appearance of the sample page. Whenever the dialog box is about to draw the contents of the sample page, the dialog box sends a sequence of messages to the hook procedure.
Notification Requirements
Minimum DLL Version None
Header Declared in Commdlg.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.51</misc>
</message>
<message value="0x404">
<name>WM_PSD_GREEKTEXTRECT</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Value
If the hook procedure returns TRUE, the dialog box does not draw the Greek text portion of the sample page.
If the hook procedure returns FALSE, the dialog box draws the Greek text portion of the sample page.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Handle to the device context for the sample page. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Pointer to a structure that contains the coordinates, in pixels, of the Greek text rectangle. </lmisc>
</lparam>
<misc>WM_PSD_GREEKTEXTRECT Notification
The WM_PSD_GREEKTEXTRECT message notifies the hook procedure of a Page Setup dialog box, PagePaintHook, that the dialog box is about to draw Greek text inside the margin rectangle of the sample page.
Syntax
WM_PSD_GREEKTEXTRECT
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Handle to the device context for the sample page.
lParam
Pointer to a structure that contains the coordinates, in pixels, of the Greek text rectangle.
Return Value
If the hook procedure returns TRUE, the dialog box does not draw the Greek text portion of the sample page.
If the hook procedure returns FALSE, the dialog box draws the Greek text portion of the sample page.
Remarks
The Page Setup dialog box includes an image of a sample page that shows how the user's selections affect the appearance of the printed output. When you call the PageSetupDlg function, you can provide a PagePaintHook hook procedure to customize the appearance of the sample page. Whenever the dialog box is about to draw the contents of the sample page, the dialog box sends a sequence of messages to the hook procedure.
Notification Requirements
Minimum DLL Version None
Header Declared in Commdlg.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.51</misc>
</message>
<message value="0x403">
<name>WM_PSD_MARGINRECT</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Value
If the hook procedure returns TRUE, the dialog box does not draw the margin rectangle in the sample page.
If the hook procedure returns FALSE, the dialog box draws the margin rectangle in the sample page.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Handle to the device context for the sample page. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Pointer to a structure that contains the coordinates, in pixels, of the margin rectangle. </lmisc>
</lparam>
<misc>WM_PSD_MARGINRECT Notification
The WM_PSD_MARGINRECT message notifies the hook procedure of a Page Setup dialog box, PagePaintHook, that the dialog box is about to draw the margin rectangle of the sample page.
Syntax
WM_PSD_MARGINRECT
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Handle to the device context for the sample page.
lParam
Pointer to a structure that contains the coordinates, in pixels, of the margin rectangle.
Return Value
If the hook procedure returns TRUE, the dialog box does not draw the margin rectangle in the sample page.
If the hook procedure returns FALSE, the dialog box draws the margin rectangle in the sample page.
Remarks
The Page Setup dialog box includes an image of a sample page that shows how the user's selections affect the appearance of the printed output. When you call the PageSetupDlg function, you can provide a PagePaintHook hook procedure to customize the appearance of the sample page. Whenever the dialog box is about to draw the contents of the sample page, the dialog box sends a sequence of messages to the hook procedure.
Notification Requirements
Minimum DLL Version None
Header Declared in Commdlg.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.51</misc>
</message>
<message value="0x402">
<name>WM_PSD_MINMARGINRECT</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Value
If the hook procedure returns TRUE, the dialog box sends no more messages and does not draw in the sample page until the next time the system needs to redraw the sample page.
If the hook procedure returns FALSE, the dialog box sends the remaining messages of the drawing sequence.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Handle to the device context for the sample page.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Pointer to a structure that contains the coordinates, in pixels, of the minimum margin rectangle. </lmisc>
</lparam>
<misc>WM_PSD_MINMARGINRECT Notification
The WM_PSD_MINMARGINRECT message informs a PagePaintHook hook procedure of the coordinates of the margin rectangle in the sample page. A Page Setup dialog box sends this message when it is about to draw the contents of the sample page.
Syntax
WM_PSD_MINMARGINRECT
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Handle to the device context for the sample page.
lParam
Pointer to a structure that contains the coordinates, in pixels, of the minimum margin rectangle.
Return Value
If the hook procedure returns TRUE, the dialog box sends no more messages and does not draw in the sample page until the next time the system needs to redraw the sample page.
If the hook procedure returns FALSE, the dialog box sends the remaining messages of the drawing sequence.
Remarks
The Page Setup dialog box includes an image of a sample page that shows how the user's selections affect the appearance of the printed output. When you call the PageSetupDlg function, you can provide a PagePaintHook hook procedure to customize the appearance of the sample page. Whenever the dialog box is about to draw the contents of the sample page, the dialog box sends a sequence of messages to the hook procedure.
Notification Requirements
Minimum DLL Version None
Header Declared in Commdlg.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.51</misc>
</message>
<message value="0x400">
<name>WM_PSD_PAGESETUPDLG</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Value
If the hook procedure returns TRUE, the dialog box sends no more messages and does not draw in the sample page until the next time the system needs to redraw the sample page.
If the hook procedure returns FALSE, the dialog box sends the remaining messages of the drawing sequence.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
The low-order word specifies a value that indicates the paper size. This value can be one of the DMPAPER_ values listed in the description of the structure. The high-order word specifies the orientation of the paper or envelope, and whether the printer is a dot matrix or HPPCL (Hewlett Packard Printer Control Language) device. This parameter can be one of the following values.
0x0001
Paper in landscape mode (dot matrix)
0x0003
Paper in landscape mode (HPPCL)
0x0005
Paper in portrait mode (dot matrix)
0x0007
Paper in portrait mode (HPPCL)
0x000b
Envelope in landscape mode (HPPCL)
0x000d
Envelope in portrait mode (dot matrix)
0x0019
Envelope in landscape mode (dot matrix)
0x001f
Envelope in portrait mode (HPPCL)</wmisc>
</wparam>
<lparam value="LPPAGESETUPDLG">
<lname>lpPageSetupDlg</lname>
<lmisc>lpPageSetupDlg
Pointer to a PAGESETUPDLG structure that contains information used to initialize the Page Setup dialog box.
</lmisc>
</lparam>
<misc>WM_PSD_PAGESETUPDLG Notification
The WM_PSD_PAGESETUPDLG message notifies a PagePaintHook hook procedure that the Page Setup dialog box is about to draw the contents of the sample page. The hook procedure can use this message to carry out initialization tasks related to drawing the contents of the sample page.
Syntax
WM_PSD_PAGESETUPDLG
WPARAM wParam
lpPageSetupDlg = (LPPAGESETUPDLG) lParam;
Parameters
wParam
The low-order word specifies a value that indicates the paper size. This value can be one of the DMPAPER_ values listed in the description of the structure. The high-order word specifies the orientation of the paper or envelope, and whether the printer is a dot matrix or HPPCL (Hewlett Packard Printer Control Language) device. This parameter can be one of the following values.
0x0001
Paper in landscape mode (dot matrix)
0x0003
Paper in landscape mode (HPPCL)
0x0005
Paper in portrait mode (dot matrix)
0x0007
Paper in portrait mode (HPPCL)
0x000b
Envelope in landscape mode (HPPCL)
0x000d
Envelope in portrait mode (dot matrix)
0x0019
Envelope in landscape mode (dot matrix)
0x001f
Envelope in portrait mode (HPPCL)
lpPageSetupDlg
Pointer to a PAGESETUPDLG structure that contains information used to initialize the Page Setup dialog box.
Return Value
If the hook procedure returns TRUE, the dialog box sends no more messages and does not draw in the sample page until the next time the system needs to redraw the sample page.
If the hook procedure returns FALSE, the dialog box sends the remaining messages of the drawing sequence.
Remarks
The Page Setup dialog box includes an image of a sample page that shows how the user's selections affect the appearance of the printed output. When you call the PageSetupDlg function, you can provide a PagePaintHook hook procedure to customize the appearance of the sample page. Whenever the dialog box is about to draw the contents of the sample page, the dialog box sends a sequence of messages to the hook procedure.
The first three messages of a drawing sequence (WM_PSD_PAGESETUPDLG, WM_PSD_FULLPAGERECT, or WM_PSD_MINMARGINRECT) provide information that the hook procedure can use to draw the contents of the sample page. The remaining messages (WM_PSD_MARGINRECT, WM_PSD_GREEKTEXTRECT, WM_PSD_ENVSTAMPRECT, WM_PSD_YAFULLPAGERECT) notify the hook procedure that the dialog box is about to draw a specific portion of the sample page. This allows the hook procedure to selectively draw portions of the sample page.
Notification Requirements
Minimum DLL Version None
Header Declared in Commdlg.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.51</misc>
</message>
<message value="0x406">
<name>WM_PSD_YAFULLPAGERECT</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
If the hook procedure returns TRUE, the dialog box does not draw the return address portion of an envelope sample page.
If the hook procedure returns FALSE, the dialog box draws the return address portion of an envelope sample page.
If the paper type is not an envelope, the return value has no effect.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Handle to the device context for the sample page. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Pointer to a structure that contains the coordinates, in pixels, of the sample page.
</lmisc>
</lparam>
<misc>WM_PSD_YAFULLPAGERECT Notification
The WM_PSD_YAFULLPAGERECT message notifies the hook procedure of a Page Setup dialog box, PagePaintHook, that the dialog box is about to draw the return address portion of an envelope sample page.
Syntax
WM_PSD_YAFULLPAGERECT
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Handle to the device context for the sample page.
lParam
Pointer to a structure that contains the coordinates, in pixels, of the sample page.
Return Value
If the hook procedure returns TRUE, the dialog box does not draw the return address portion of an envelope sample page.
If the hook procedure returns FALSE, the dialog box draws the return address portion of an envelope sample page.
If the paper type is not an envelope, the return value has no effect.
Remarks
The Page Setup dialog box includes an image of a sample page that shows how the user's selections affect the appearance of the printed output. When you call the PageSetupDlg function, you can provide a PagePaintHook hook procedure to customize the appearance of the sample page. Whenever the dialog box is about to draw the contents of the sample page, the dialog box sends a sequence of messages to the hook procedure.
Notification Requirements
Minimum DLL Version None
Header Declared in Commdlg.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.51</misc>
</message>
<message value="0x37">
<name>WM_QUERYDRAGICON</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used.</lmisc>
</lparam>
<misc>WM_QUERYDRAGICON Notification
The WM_QUERYDRAGICON message is sent to a minimized (iconic) window. The window is about to be dragged by the user but does not have an icon defined for its class. An application can return a handle to an icon or cursor. The system displays this cursor or icon while the user drags the icon.
A window receives this message through its WindowProc function.
Syntax
WM_QUERYDRAGICON
WPARAM wParam
LPARAM lParam;
Parameters
wParam
This parameter is not used.
lParam
This parameter is not used.
Return Value
Remarks
When the user drags the icon of a window without a class icon, the system replaces the icon with a default cursor. If the application requires a different cursor to be displayed during dragging, it must return a handle to the cursor or icon compatible with the display driver's resolution. If an application returns a handle to a color cursor or icon, the system converts the cursor or icon to black and white. The application can call the LoadCursor or LoadIcon function to load a cursor or icon from the resources in its executable (.exe) file and to retrieve this handle.
If a dialog box procedure handles this message, it should cast the desired return value to a BOOL and return the value directly. The DWL_MSGRESULT value set by the SetWindowLong function is ignored.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x11">
<name>WM_QUERYENDSESSION</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
Applications should respect the user's intentions and return TRUE. By default, the DefWindowProc function returns TRUE for this message.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is reserved for future use.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter can be one or more of the following values. If this parameter is 0, the system is shutting down or restarting (it is not possible to determine which event is occurring).
Value Meaning
ENDSESSION_CLOSEAPP
0x00000001
The application is using a file that must be replaced, the system is being serviced, or system resources are exhausted. For more information, see Guidelines for Applications.
ENDSESSION_CRITICAL
0x40000000
The application is forced to shut down.
ENDSESSION_LOGOFF
0x80000000
The user is logging off. For more information, see Logging Off.
Note that this parameter is a bit mask. To test for this value, use a bit-wise operation; do not test for equality.
lParam
If this parameter is zero, the system is shutting down or restarting (it is not possible to determine which event is occurring).
</lmisc>
</lparam>
<misc>WM_QUERYENDSESSION Message
The WM_QUERYENDSESSION message is sent when the user chooses to end the session or when an application calls one of the system shutdown functions. If any application returns zero, the session is not ended. The system stops sending WM_QUERYENDSESSION messages as soon as one application returns zero.
After processing this message, the system sends the WM_ENDSESSION message with the wParam parameter set to the results of the WM_QUERYENDSESSION message.
A window receives this message through its WindowProc function.
LRESULT CALLBACK WindowProc(
HWND hwnd, // handle to window
UINT uMsg, // message identifier
WPARAM wParam, // not used
LPARAM lParam // logoff option
);
Parameters
hwnd
A handle to the window.
uMsg
The WM_QUERYENDSESSION identifier.
wParam
This parameter is reserved for future use.
lParam
This parameter can be one or more of the following values. If this parameter is 0, the system is shutting down or restarting (it is not possible to determine which event is occurring).
Value Meaning
ENDSESSION_CLOSEAPP
0x00000001
The application is using a file that must be replaced, the system is being serviced, or system resources are exhausted. For more information, see Guidelines for Applications.
ENDSESSION_CRITICAL
0x40000000
The application is forced to shut down.
ENDSESSION_LOGOFF
0x80000000
The user is logging off. For more information, see Logging Off.
Note that this parameter is a bit mask. To test for this value, use a bit-wise operation; do not test for equality.
lParam
If this parameter is zero, the system is shutting down or restarting (it is not possible to determine which event is occurring).
Return Value
Applications should respect the user's intentions and return TRUE. By default, the DefWindowProc function returns TRUE for this message.
If shutting down would corrupt the system or media that is being burned, the application can return FALSE. However, it is good practice to respect the user's actions.
Remarks
When an application returns TRUE for this message, it receives the WM_ENDSESSION message, regardless of how the other applications respond to the WM_QUERYENDSESSION message. Each application should return TRUE or FALSE immediately upon receiving this message, and defer any cleanup operations until it receives the WM_ENDSESSION message.
Applications can display a user interface prompting the user for information at shutdown, however it is not recommended. After five seconds, the system displays information about the applications that are preventing shutdown and allows the user to terminate them. For example, Windows XP displays a dialog box, while Windows Vista displays a full screen with additional information about the applications blocking shutdown. If your application must block or postpone system shutdown, use the ShutdownBlockReasonCreate function. For more information, see Shutdown Changes for Windows Vista.
Console applications can use the SetConsoleCtrlHandler function to receive shutdown notification.
Service applications can use the RegisterServiceCtrlHandlerEx function to receive shutdown notifications in a handler routine.
Examples
For an example, see Logging Off.
Requirements
Minimum supported client Windows 2000 Professional
Minimum supported server Windows 2000 Server
Header WinUser.h (include Windows.h)</misc>
</message>
<message value="0x30F">
<name>WM_QUERYNEWPALETTE</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Values
If the window realizes its logical palette, it must return TRUE; otherwise, it must return FALSE.</returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc>This message has no parameters.</wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc>This message has no parameters.</lmisc>
</lparam>
<misc>WM_QUERYNEWPALETTE
The WM_QUERYNEWPALETTE message informs a window that it is about to receive the keyboard focus, giving the window the opportunity to realize its logical palette when it receives the focus.
A window receives this message through its WindowProc function.
LRESULT CALLBACK WindowProc(
HWND hwnd, // handle to window
UINT uMsg, // WM_QUERYNEWPALETTE
WPARAM wParam, // not used
LPARAM lParam // not used
);
Parameters
This message has no parameters.
Return Values
If the window realizes its logical palette, it must return TRUE; otherwise, it must return FALSE.
Requirements
Windows NT/2000/XP/Vista: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Winuser.h; include Windows.h.</misc>
</message>
<message value="0x13">
<name>WM_QUERYOPEN</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used.</lmisc>
</lparam>
<misc>WM_QUERYOPEN Notification
The WM_QUERYOPEN message is sent to an icon when the user requests that the window be restored to its previous size and position.
A window receives this message through its WindowProc function.
Syntax
WM_QUERYOPEN
WPARAM wParam
LPARAM lParam;
Parameters
wParam
This parameter is not used.
lParam
This parameter is not used.
Return Value
Remarks
By default, the DefWindowProc function returns TRUE.
While processing this message, the application should not perform any action that would cause an activation or focus change (for example, creating a dialog box).
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x129">
<name>WM_QUERYUISTATE</name>
<return value="">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
The return value is NULL if the focus indicators and the keyboard accelerators are visible. Otherwise, the return value can be one or more of the following values.
UISF_HIDEFOCUS Focus indicators are hidden.
UISF_HIDEACCEL Keyboard accelerators are hidden.
UISF_ACTIVE Windows XP: A control should be drawn in the style used for active controls.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used; must be zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used; must be zero.</lmisc>
</lparam>
<misc>WM_QUERYUISTATE Message
An application sends the WM_QUERYUISTATE message to retrieve the user interface (UI) state for a window.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) WM_QUERYUISTATE, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
The return value is NULL if the focus indicators and the keyboard accelerators are visible. Otherwise, the return value can be one or more of the following values.
UISF_HIDEFOCUS Focus indicators are hidden.
UISF_HIDEACCEL Keyboard accelerators are hidden.
UISF_ACTIVE Windows XP: A control should be drawn in the style used for active controls.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 2000</misc>
</message>
<message value="0x23">
<name>WM_QUEUESYNC</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
A CBT application should return zero if it processes this message. </returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc>WM_QUEUESYNC Notification
The WM_QUEUESYNC message is sent by a computer-based training (CBT) application to separate user-input messages from other messages sent through the WH_JOURNALPLAYBACK Hook procedure.
Syntax
WM_QUEUESYNC
Return Value
A CBT application should return zero if it processes this message.
Remarks
Whenever a CBT application uses the WH_JOURNALPLAYBACK Hook procedure, the first and last messages are WM_QUEUESYNC. This allows the CBT application to intercept and examine user-initiated messages without doing so for events that it sends.
If an application specifies a NULL window handle, the message is posted to the message queue of the active window.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x12">
<name>WM_QUIT</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
This message does not have a return value because it causes the message loop to terminate before the message is sent to the application's window procedure.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the exit code given in the PostQuitMessage function. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used. </lmisc>
</lparam>
<misc>WM_QUIT Notification
The WM_QUIT message indicates a request to terminate an application and is generated when the application calls the PostQuitMessage function. It causes the GetMessage function to return zero.
Syntax
WM_QUIT
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Specifies the exit code given in the PostQuitMessage function.
lParam
This parameter is not used.
Return Value
This message does not have a return value because it causes the message loop to terminate before the message is sent to the application's window procedure.
Remarks
The WM_QUIT message is not associated with a window and therefore will never be received through a window's window procedure. It is retrieved only by the GetMessage or PeekMessage functions.
Do not post the WM_QUIT message using the PostMessage function; use PostQuitMessage.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0xCCCD">
<name>WM_RASDIALEVENT</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
If an application processes this message, it should return TRUE.</returnmisc>
</return>
<wparam value="RASCONNSTATE">
<wname>rasconnstate</wname>
<wmisc>rasconnstate
Value of wParam. Equivalent to the rasconnstate parameter of the RasDialFunc and RasDialFunc1 callback functions. Specifies a RASCONNSTATE enumerator value that indicates the state the RasDial remote access connection process is about to enter.
</wmisc>
</wparam>
<lparam value="DWORD">
<lname>dwError</lname>
<lmisc>dwError
Value of lParam. Equivalent to the dwError parameter of the RasDialFunc and RasDialFunc1 callback functions. A nonzero value indicates the error that has occurred, or zero if no error has occurred.
RasDial sends this message with dwError set to zero upon entry to each connection state. If an error occurs within a state, the message is sent again for the state, this time with a nonzero dwError value.
</lmisc>
</lparam>
<misc>WM_RASDIALEVENT Message
The operating system sends a WM_RASDIALEVENT message to a window procedure when a change of state event occurs during a RAS connection process. This happens when a window has been specified to handle notifications of such events by using the notifier parameter of RasDial.
The two message parameters are equivalent to the parameters of the same names that are used with RasDialFunc and RasDialFunc1 callback functions.
WM_RASDIALEVENT
rasconnstate = (RASCONNSTATE) wParam;
dwError = (DWORD) lParam;
Parameters
rasconnstate
Value of wParam. Equivalent to the rasconnstate parameter of the RasDialFunc and RasDialFunc1 callback functions. Specifies a RASCONNSTATE enumerator value that indicates the state the RasDial remote access connection process is about to enter.
dwError
Value of lParam. Equivalent to the dwError parameter of the RasDialFunc and RasDialFunc1 callback functions. A nonzero value indicates the error that has occurred, or zero if no error has occurred.
RasDial sends this message with dwError set to zero upon entry to each connection state. If an error occurs within a state, the message is sent again for the state, this time with a nonzero dwError value.
Return Value
If an application processes this message, it should return TRUE.
Requirements
Minimum supported client Windows 2000 Professional
Minimum supported server Windows 2000 Server
Header Ras.h</misc>
</message>
<message value="0x206">
<name>WM_RBUTTONDBLCLK</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Indicates whether various virtual keys are down. This parameter can be one or more of the following values.
MK_CONTROL
The CTRL key is down.
MK_LBUTTON
The left mouse button is down.
MK_MBUTTON
The middle mouse button is down.
MK_RBUTTON
The right mouse button is down.
MK_SHIFT
The SHIFT key is down.
MK_XBUTTON1
Windows 2000/XP: The first X button is down.
MK_XBUTTON2
Windows 2000/XP: The second X button is down.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
The low-order word specifies the x-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
The high-order word specifies the y-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
</lmisc>
</lparam>
<misc>WM_RBUTTONDBLCLK Notification
The WM_RBUTTONDBLCLK message is posted when the user double-clicks the right mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
A window receives this message through its WindowProc function.
Syntax
WM_RBUTTONDBLCLK
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Indicates whether various virtual keys are down. This parameter can be one or more of the following values.
MK_CONTROL
The CTRL key is down.
MK_LBUTTON
The left mouse button is down.
MK_MBUTTON
The middle mouse button is down.
MK_RBUTTON
The right mouse button is down.
MK_SHIFT
The SHIFT key is down.
MK_XBUTTON1
Windows 2000/XP: The first X button is down.
MK_XBUTTON2
Windows 2000/XP: The second X button is down.
lParam
The low-order word specifies the x-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
The high-order word specifies the y-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
Return Value
Remarks
Only windows that have the CS_DBLCLKS style can receive WM_RBUTTONDBLCLK messages, which the system generates whenever the user presses, releases, and again presses the right mouse button within the system's double-click time limit. Double-clicking the right mouse button actually generates four messages: WM_RBUTTONDOWN, WM_RBUTTONUP, WM_RBUTTONDBLCLK, and WM_RBUTTONUP again.
Use the following code to obtain the horizontal and vertical position:
Copy Code
xPos = GET_X_LPARAM(lParam);
yPos = GET_Y_LPARAM(lParam);
You can also use the MAKEPOINTS macro to convert the lParam parameter to a POINTS structure.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x204">
<name>WM_RBUTTONDOWN</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Indicates whether various virtual keys are down. This parameter can be one or more of the following values.
MK_CONTROL
The CTRL key is down.
MK_LBUTTON
The left mouse button is down.
MK_MBUTTON
The middle mouse button is down.
MK_RBUTTON
The right mouse button is down.
MK_SHIFT
The SHIFT key is down.
MK_XBUTTON1
Windows 2000/XP: The first X button is down.
MK_XBUTTON2
Windows 2000/XP: The second X button is down.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
The low-order word specifies the x-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
The high-order word specifies the y-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
</lmisc>
</lparam>
<misc>WM_RBUTTONDOWN Notification
The WM_RBUTTONDOWN message is posted when the user presses the right mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
A window receives this message through its WindowProc function.
Syntax
WM_RBUTTONDOWN
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Indicates whether various virtual keys are down. This parameter can be one or more of the following values.
MK_CONTROL
The CTRL key is down.
MK_LBUTTON
The left mouse button is down.
MK_MBUTTON
The middle mouse button is down.
MK_RBUTTON
The right mouse button is down.
MK_SHIFT
The SHIFT key is down.
MK_XBUTTON1
Windows 2000/XP: The first X button is down.
MK_XBUTTON2
Windows 2000/XP: The second X button is down.
lParam
The low-order word specifies the x-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
The high-order word specifies the y-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
Return Value
Remarks
Use the following code to obtain the horizontal and vertical position:
Copy Code
xPos = GET_X_LPARAM(lParam);
yPos = GET_Y_LPARAM(lParam);
You can also use the MAKEPOINTS macro to convert the lParam parameter to a POINTS structure.
To detect that the ALT key was pressed, check whether GetKeyState(VK_MENU) 0. Note, this must not be GetAsyncKeyState.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x205">
<name>WM_RBUTTONUP</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Indicates whether various virtual keys are down. This parameter can be one or more of the following values.
MK_CONTROL
The CTRL key is down.
MK_LBUTTON
The left mouse button is down.
MK_MBUTTON
The middle mouse button is down.
MK_RBUTTON
The SHIFT key is down.
MK_XBUTTON1
Windows 2000/XP: The first X button is down.
MK_XBUTTON2
Windows 2000/XP: The second X button is down.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
The low-order word specifies the x-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
The high-order word specifies the y-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
</lmisc>
</lparam>
<misc>WM_RBUTTONUP Notification
The WM_RBUTTONUP message is posted when the user releases the right mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
A window receives this message through its WindowProc function.
Syntax
WM_RBUTTONUP
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Indicates whether various virtual keys are down. This parameter can be one or more of the following values.
MK_CONTROL
The CTRL key is down.
MK_LBUTTON
The left mouse button is down.
MK_MBUTTON
The middle mouse button is down.
MK_RBUTTON
The SHIFT key is down.
MK_XBUTTON1
Windows 2000/XP: The first X button is down.
MK_XBUTTON2
Windows 2000/XP: The second X button is down.
lParam
The low-order word specifies the x-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
The high-order word specifies the y-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
Return Value
Remarks
Use the following code to obtain the horizontal and vertical position:
Copy Code
xPos = GET_X_LPARAM(lParam);
yPos = GET_Y_LPARAM(lParam);
You can also use the MAKEPOINTS macro to convert the lParam parameter to a POINTS structure.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x306">
<name>WM_RENDERALLFORMATS</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used; must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used; must be zero.</lmisc>
</lparam>
<misc>WM_RENDERALLFORMATS Notification
The WM_RENDERALLFORMATS message is sent to the clipboard owner before it is destroyed, if the clipboard owner has delayed rendering one or more clipboard formats. For the content of the clipboard to remain available to other applications, the clipboard owner must render data in all the formats it is capable of generating, and place the data on the clipboard by calling the SetClipboardData function.
A window receives this message through its WindowProc function.
Syntax
WM_RENDERALLFORMATS
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
Remarks
When responding to a WM_RENDERALLFORMATS message, the clipboard owner must call the OpenClipboard and EmptyClipboard functions before calling SetClipboardData.
When the application returns, the system removes any unrendered formats from the list of available clipboard formats. For information about delayed rendering, see SetClipboardData.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x305">
<name>WM_RENDERFORMAT</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
If an application processes this message, it should return zero. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the clipboard format to be rendered.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used. </lmisc>
</lparam>
<misc>WM_RENDERFORMAT Notification
The WM_RENDERFORMAT message is sent to the clipboard owner if it has delayed rendering a specific clipboard format and if an application has requested data in that format. The clipboard owner must render data in the specified format and place it on the clipboard by calling the SetClipboardData function.
Syntax
WM_RENDERFORMAT
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Specifies the clipboard format to be rendered.
lParam
This parameter is not used.
Return Value
If an application processes this message, it should return zero.
Remarks
When responding to a WM_RENDERFORMAT message, the clipboard owner must not open the clipboard before calling SetClipboardData.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x20">
<name>WM_SETCURSOR</name>
<return value="BOOL">
<returninfo></returninfo>
<returnmisc>Return Value
If an application processes this message, it should return TRUE to halt further processing or FALSE to continue. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Handle to the window that contains the cursor. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
The low-order word of lParam specifies the hit-test code.
The high-order word of lParam specifies the identifier of the mouse message. </lmisc>
</lparam>
<misc>WM_SETCURSOR Notification
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.
Syntax
WM_SETCURSOR
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Handle to the window that contains the cursor.
lParam
The low-order word of lParam specifies the hit-test code.
The high-order word of lParam specifies the identifier of the mouse message.
Return Value
If an application processes this message, it should return TRUE to halt further processing or FALSE to continue.
Remarks
The high-order word of lParam is zero when the window enters menu mode.
The DefWindowProc function passes the WM_SETCURSOR message to a parent window before processing. If the parent window returns TRUE, further processing is halted. Passing the message to a window's parent window gives the parent window control over the cursor's setting in a child window. The DefWindowProc function also uses this message to set the cursor to an arrow if it is not in the client area, or to the registered class cursor if it is in the client area. If the low-order word of the lParam parameter is HTERROR and the high-order word of lParam specifies that one of the mouse buttons is pressed, DefWindowProc calls the MessageBeep function.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x7">
<name>WM_SETFOCUS</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
An application should return zero if it processes this message. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Handle to the window that has lost the keyboard focus. This parameter can be NULL. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used. </lmisc>
</lparam>
<misc>WM_SETFOCUS Notification
The WM_SETFOCUS message is sent to a window after it has gained the keyboard focus.
Syntax
WM_SETFOCUS
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Handle to the window that has lost the keyboard focus. This parameter can be NULL.
lParam
This parameter is not used.
Return Value
An application should return zero if it processes this message.
Remarks
To display a caret, an application should call the appropriate caret functions when it receives the WM_SETFOCUS message.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x30">
<name>WM_SETFONT</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
This message does not return a value.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Handle to the font (HFONT). If this parameter is NULL, the control uses the default system font to draw text.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
The low-order word of lParam specifies whether the control should be redrawn immediately upon setting the font. If this parameter is TRUE, the control redraws itself.
</lmisc>
</lparam>
<misc>WM_SETFONT Message
An application sends a WM_SETFONT message to specify the font that a control is to use when drawing text.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) WM_SETFONT, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Handle to the font (HFONT). If this parameter is NULL, the control uses the default system font to draw text.
lParam
The low-order word of lParam specifies whether the control should be redrawn immediately upon setting the font. If this parameter is TRUE, the control redraws itself.
Return Value
This message does not return a value.
Remarks
The WM_SETFONT message applies to all controls, not just those in dialog boxes.
The best time for the owner of a dialog box control to set the font of the control is when it receives the WM_INITDIALOG message. The application should call the DeleteObject function to delete the font when it is no longer needed; for example, after it destroys the control.
The size of the control does not change as a result of receiving this message. To avoid clipping text that does not fit within the boundaries of the control, the application should correct the size of the control window before it sets the font.
When a dialog box uses the DS_SETFONT style to set the text in its controls, the system sends the WM_SETFONT message to the dialog box procedure before it creates the controls. An application can create a dialog box that contains the DS_SETFONT style by calling any of the following functions:
* CreateDialogIndirect
* CreateDialogIndirectParam
* DialogBoxIndirect
* DialogBoxIndirectParam
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x32">
<name>WM_SETHOTKEY</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
The return value is one of the following.
-1 The function is unsuccessful the hot key is invalid.
0 The function is unsuccessful the window is invalid.
1 The function is successful, and no other window has the same hot key.
2 The function is successful, but another window already has the same hot key.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
The low-order word specifies the virtual-key code to associate with the window.
The high-order word can be one or more of the following values.
Setting wParam to NULL removes the hot key associated with a window.
HOTKEYF_ALT
ALT key
HOTKEYF_CONTROL
CTRL key
HOTKEYF_EXT
Extended key
HOTKEYF_SHIFT
SHIFT key
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used. </lmisc>
</lparam>
<misc>WM_SETHOTKEY Message
An application sends a WM_SETHOTKEY message to a window to associate a hot key with the window. When the user presses the hot key, the system activates the window.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) WM_SETHOTKEY, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
The low-order word specifies the virtual-key code to associate with the window.
The high-order word can be one or more of the following values.
Setting wParam to NULL removes the hot key associated with a window.
HOTKEYF_ALT
ALT key
HOTKEYF_CONTROL
CTRL key
HOTKEYF_EXT
Extended key
HOTKEYF_SHIFT
SHIFT key
lParam
This parameter is not used.
Return Value
The return value is one of the following.
-1 The function is unsuccessful the hot key is invalid.
0 The function is unsuccessful the window is invalid.
1 The function is successful, and no other window has the same hot key.
2 The function is successful, but another window already has the same hot key.
Remarks
A hot key cannot be associated with a child window.
VK_ESCAPE, VK_SPACE, and VK_TAB are invalid hot keys.
When the user presses the hot key, the system generates a WM_SYSCOMMAND message with wParam equal to SC_HOTKEY and lParam equal to the window's handle. If this message is passed on to DefWindowProc, the system will bring the window's last active popup (if it exists) or the window itself (if there is no popup window) to the foreground.
A window can only have one hot key. If the window already has a hot key associated with it, the new hot key replaces the old one. If more than one window has the same hot key, the window that is activated by the hot key is random.
These hot keys are unrelated to the hot keys set by RegisterHotKey.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x80">
<name>WM_SETICON</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
The return value is a handle to the previous large or small icon, depending on the value of wParam. It is NULL if the window previously had no icon of the type indicated by wParam.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the type of icon to be set. This parameter can be one of the following values.
ICON_BIG
Set the large icon for the window.
ICON_SMALL
Set the small icon for the window.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Handle to the new large or small icon. If this parameter is NULL, the icon indicated by wParamis removed.
</lmisc>
</lparam>
<misc>WM_SETICON Message
An application sends the WM_SETICON message to associate a new large or small icon with a window. The system displays the large icon in the ALT+TAB dialog box, and the small icon in the window caption.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) WM_SETICON, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
Specifies the type of icon to be set. This parameter can be one of the following values.
ICON_BIG
Set the large icon for the window.
ICON_SMALL
Set the small icon for the window.
lParam
Handle to the new large or small icon. If this parameter is NULL, the icon indicated by wParamis removed.
Return Value
The return value is a handle to the previous large or small icon, depending on the value of wParam. It is NULL if the window previously had no icon of the type indicated by wParam.
Remarks
The DefWindowProc function returns a handle to the previous large or small icon associated with the window, depending on the value of wParam.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0xB">
<name>WM_SETREDRAW</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
An application returns zero if it processes this message.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the redraw state. If this parameter is TRUE, the content can be redrawn after a change. If this parameter is FALSE, the content cannot be redrawn after a change.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used.</lmisc>
</lparam>
<misc>WM_SETREDRAW Message
An application sends the WM_SETREDRAW message to a window to allow changes in that window to be redrawn or to prevent changes in that window from being redrawn.
To send this message, call the SendMessage function with the following parameters.
SendMessage(
(HWND) hWnd,
WM_SETREDRAW,
(WPARAM) wParam,
(LPARAM) lParam
);
Parameters
wParam
Specifies the redraw state. If this parameter is TRUE, the content can be redrawn after a change. If this parameter is FALSE, the content cannot be redrawn after a change.
lParam
This parameter is not used.
Return Value
An application returns zero if it processes this message.
Remarks
This message can be useful if an application must add several items to a list box. The application can call this message with wParam set to FALSE, add the items, and then call the message again with wParam set to TRUE. Finally, the application can call the InvalidateRect function to cause the list box to be repainted.
Requirements
Client Requires Windows Vista, Windows XP, Windows 2000 Professional, Windows NT Workstation 3.1 and later, Windows Me, Windows 98, or Windows 95.
Header Declared in Winuser.h; include Windows.h.</misc>
</message>
<message value="0xC">
<name>WM_SETTEXT</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
The return value is TRUE if the text is set. It is FALSE (for an edit control), LB_ERRSPACE (for a list box), or CB_ERRSPACE (for a combo box) if insufficient space is available to set the text in the edit control. It is CB_ERR if this message is sent to a combo box without an edit control.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Pointer to a null-terminated string that is the window text.
</lmisc>
</lparam>
<misc>WM_SETTEXT Message
An application sends a WM_SETTEXT message to set the text of a window.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) WM_SETTEXT, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
This parameter is not used.
lParam
Pointer to a null-terminated string that is the window text.
Return Value
The return value is TRUE if the text is set. It is FALSE (for an edit control), LB_ERRSPACE (for a list box), or CB_ERRSPACE (for a combo box) if insufficient space is available to set the text in the edit control. It is CB_ERR if this message is sent to a combo box without an edit control.
Remarks
The DefWindowProc function sets and displays the window text. For an edit control, the text is the contents of the edit control. For a combo box, the text is the contents of the edit-control portion of the combo box. For a button, the text is the button name. For other windows, the text is the window title.
This message does not change the current selection in the list box of a combo box. An application should use the CB_SELECTSTRING message to select the item in a list box that matches the text in the edit control.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x1A">
<name>WM_SETTINGCHANGE</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
If you process this message, return zero.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
When the system sends this message as a result of a SystemParametersInfo call, wParam is a flag that indicates the system parameter that was changed. For a list of values, see SystemParametersInfo.
When the system sends this message as a result of a change in policy settings, this parameter indicates the type of policy that was applied. This value is 1 if computer policy was applied or zero if user policy was applied.
When the system sends this message as a result of a change in locale settings, this parameter is zero.
When an application sends this message, this parameter must be NULL.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
When the system sends this message as a result of a SystemParametersInfo call, lParam is a pointer to a string that indicates the area containing the system parameter that was changed. This parameter does not usually indicate which specific system parameter changed. (Note that some applications send this message with lParam set to NULL.) In general, when you receive this message, you should check and reload any system parameter settings that are used by your application.
This string can be the name of a registry key or the name of a section in the Win.ini file. When the string is a registry name, it typically indicates only the leaf node in the registry, not the full path.
When the system sends this message as a result of a change in policy settings, this parameter points to the string "Policy".
When the system sends this message as a result of a change in locale settings, this parameter points to the string "intl".
To effect a change in the environment variables for the system or the user, broadcast this message with lParam set to the string "Environment".
</lmisc>
</lparam>
<misc>WM_SETTINGCHANGE Message
A message that is sent to all top-level windows when the SystemParametersInfo function changes a system-wide setting or when policy settings have changed.
Applications should send WM_SETTINGCHANGE to all top-level windows when they make changes to system parameters. (This message cannot be sent directly to a window.) To send the WM_SETTINGCHANGE message to all top-level windows, use the SendMessageTimeout function with the hwnd parameter set to HWND_BROADCAST.
A window receives this message through its WindowProc function.
LRESULT CALLBACK WindowProc(
HWND hwnd, // handle to window
UINT uMsg, // message identifier
WPARAM wParam, // system parameter indicator
LPARAM lParam // system parameter area (LPCTSTR)
);
Parameters
hwnd
A handle to window.
uMsg
The WM_SETTINGCHANGE identifier.
wParam
When the system sends this message as a result of a SystemParametersInfo call, wParam is a flag that indicates the system parameter that was changed. For a list of values, see SystemParametersInfo.
When the system sends this message as a result of a change in policy settings, this parameter indicates the type of policy that was applied. This value is 1 if computer policy was applied or zero if user policy was applied.
When the system sends this message as a result of a change in locale settings, this parameter is zero.
When an application sends this message, this parameter must be NULL.
lParam
When the system sends this message as a result of a SystemParametersInfo call, lParam is a pointer to a string that indicates the area containing the system parameter that was changed. This parameter does not usually indicate which specific system parameter changed. (Note that some applications send this message with lParam set to NULL.) In general, when you receive this message, you should check and reload any system parameter settings that are used by your application.
This string can be the name of a registry key or the name of a section in the Win.ini file. When the string is a registry name, it typically indicates only the leaf node in the registry, not the full path.
When the system sends this message as a result of a change in policy settings, this parameter points to the string "Policy".
When the system sends this message as a result of a change in locale settings, this parameter points to the string "intl".
To effect a change in the environment variables for the system or the user, broadcast this message with lParam set to the string "Environment".
Return Value
If you process this message, return zero.
Requirements
Minimum supported client Windows 2000 Professional
Minimum supported server Windows 2000 Server
Header Winuser.h (include Windows.h)</misc>
</message>
<message value="0x18">
<name>WM_SHOWWINDOW</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
If an application processes this message, it should return zero. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies whether a window is being shown. If wParam is TRUE, the window is being shown. If wParam is FALSE, the window is being hidden.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Specifies the status of the window being shown. If lParam is zero, the message was sent because of a call to the ShowWindow function; otherwise, lParam is one of the following values.
SW_OTHERUNZOOM
The window is being uncovered because a maximize window was restored or minimized.
SW_OTHERZOOM
The window is being covered by another window that has been maximized.
SW_PARENTCLOSING
The window's owner window is being minimized.
SW_PARENTOPENING
The window's owner window is being restored.</lmisc>
</lparam>
<misc>WM_SHOWWINDOW Notification
The WM_SHOWWINDOW message is sent to a window when the window is about to be hidden or shown.
A window receives this message through its WindowProc function.
Syntax
WM_SHOWWINDOW
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Specifies whether a window is being shown. If wParam is TRUE, the window is being shown. If wParam is FALSE, the window is being hidden.
lParam
Specifies the status of the window being shown. If lParam is zero, the message was sent because of a call to the ShowWindow function; otherwise, lParam is one of the following values.
SW_OTHERUNZOOM
The window is being uncovered because a maximize window was restored or minimized.
SW_OTHERZOOM
The window is being covered by another window that has been maximized.
SW_PARENTCLOSING
The window's owner window is being minimized.
SW_PARENTOPENING
The window's owner window is being restored.
Return Value
If an application processes this message, it should return zero.
Remarks
The DefWindowProc function hides or shows the window, as specified by the message. If a window has the WS_VISIBLE style when it is created, the window receives this message after it is created, but before it is displayed. A window also receives this message when its visibility state is changed by the ShowWindow or ShowOwnedPopups function.
The WM_SHOWWINDOW message is not sent under the following circumstances:
* When a top-level, overlapped window is created with the WS_MAXIMIZE or WS_MINIMIZE style.
* When the SW_SHOWNORMAL flag is specified in the call to the ShowWindow function.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x5">
<name>WM_SIZE</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
If an application processes this message, it should return zero.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the type of resizing requested. This parameter can be one of the following values.
SIZE_MAXHIDE
Message is sent to all pop-up windows when some other window is maximized.
SIZE_MAXIMIZED
The window has been maximized.
SIZE_MAXSHOW
Message is sent to all pop-up windows when some other window has been restored to its former size.
SIZE_MINIMIZED
The window has been minimized.
SIZE_RESTORED
The window has been resized, but neither the SIZE_MINIMIZED nor SIZE_MAXIMIZED value applies.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
The low-order word of lParam specifies the new width of the client area.
The high-order word of lParam specifies the new height of the client area. </lmisc>
</lparam>
<misc>WM_SIZE Notification
The WM_SIZE message is sent to a window after its size has changed.
A window receives this message through its WindowProc function.
Syntax
WM_SIZE
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Specifies the type of resizing requested. This parameter can be one of the following values.
SIZE_MAXHIDE
Message is sent to all pop-up windows when some other window is maximized.
SIZE_MAXIMIZED
The window has been maximized.
SIZE_MAXSHOW
Message is sent to all pop-up windows when some other window has been restored to its former size.
SIZE_MINIMIZED
The window has been minimized.
SIZE_RESTORED
The window has been resized, but neither the SIZE_MINIMIZED nor SIZE_MAXIMIZED value applies.
lParam
The low-order word of lParam specifies the new width of the client area.
The high-order word of lParam specifies the new height of the client area.
Return Value
If an application processes this message, it should return zero.
Remarks
If the SetScrollPos or MoveWindow function is called for a child window as a result of the WM_SIZE message, the bRedraw or bRepaint parameter should be nonzero to cause the window to be repainted.
Although the width and height of a window are 32-bit values, the lParam parameter contains only the low-order 16 bits of each.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x30B">
<name>WM_SIZECLIPBOARD</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
If an application processes this message, it should return zero. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Handle to the clipboard viewer window. </wmisc>
</wparam>
<lparam value="RECT">
<lname>lpRect</lname>
<lmisc>lpRect
Handle to a global memory object that contains a RECT structure. The structure specifies the new dimensions of the clipboard viewer's client area.
</lmisc>
</lparam>
<misc>WM_SIZECLIPBOARD Notification
The WM_SIZECLIPBOARD message is sent to the clipboard owner by a clipboard viewer window when the clipboard contains data in the CF_OWNERDISPLAY format and the clipboard viewer's client area has changed size.
Syntax
WM_SIZECLIPBOARD
WPARAM wParam
lpRect = (RECT) lParam;
Parameters
wParam
Handle to the clipboard viewer window.
lpRect
Handle to a global memory object that contains a RECT structure. The structure specifies the new dimensions of the clipboard viewer's client area.
Return Value
If an application processes this message, it should return zero.
Remarks
When the clipboard viewer window is about to be destroyed or resized, a WM_SIZECLIPBOARD message is sent with a null rectangle (0, 0, 0, 0) as the new size. This permits the clipboard owner to free its display resources.
The clipboard owner must use the GlobalLock function to lock the memory object that contains RECT. Before returning, the clipboard owner must unlock the object by using the GlobalUnlock function.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x214">
<name>WM_SIZING</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
An application should return TRUE if it processes this message.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies which edge of the window is being sized. This parameter can be one of the following values.
WMSZ_BOTTOM
Bottom edge
WMSZ_BOTTOMLEFT
Bottom-left corner
WMSZ_BOTTOMRIGHT
Bottom-right corner
WMSZ_LEFT
Left edge
WMSZ_RIGHT
Right edge
WMSZ_TOP
Top edge
WMSZ_TOPLEFT
Top-left corner
WMSZ_TOPRIGHT
Top-right corner</wmisc>
</wparam>
<lparam value="RECT">
<lname>lParam</lname>
<lmisc>lParam
Pointer to a RECT structure with the screen coordinates of the drag rectangle. To change the size or position of the drag rectangle, an application must change the members of this structure.
</lmisc>
</lparam>
<misc>WM_SIZING Notification
The WM_SIZING message is sent to a window that the user is resizing. By processing this message, an application can monitor the size and position of the drag rectangle and, if needed, change its size or position.
A window receives this message through its WindowProc function.
Syntax
WM_SIZING
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Specifies which edge of the window is being sized. This parameter can be one of the following values.
WMSZ_BOTTOM
Bottom edge
WMSZ_BOTTOMLEFT
Bottom-left corner
WMSZ_BOTTOMRIGHT
Bottom-right corner
WMSZ_LEFT
Left edge
WMSZ_RIGHT
Right edge
WMSZ_TOP
Top edge
WMSZ_TOPLEFT
Top-left corner
WMSZ_TOPRIGHT
Top-right corner
lParam
Pointer to a RECT structure with the screen coordinates of the drag rectangle. To change the size or position of the drag rectangle, an application must change the members of this structure.
Return Value
An application should return TRUE if it processes this message.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 4.0</misc>
</message>
<message value="0x2A">
<name>WM_SPOOLERSTATUS</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
An application should return zero if it processes this message.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the PR_JOBSTATUS flag.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
The low-order word specifies the number of jobs remaining in the Print Manager queue.</lmisc>
</lparam>
<misc>WM_SPOOLERSTATUS Message
The WM_SPOOLERSTATUS message is sent from Print Manager whenever a job is added to or removed from the Print Manager queue.
A window receives this message through its WindowProc function.
LRESULT CALLBACK WindowProc(
HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
);
Parameters
wParam
Specifies the PR_JOBSTATUS flag.
lParam
The low-order word specifies the number of jobs remaining in the Print Manager queue.
Return Value
An application should return zero if it processes this message.
Remarks
This message is for informational purposes only. This message is advisory and does not have guaranteed delivery semantics. Applications should not assume that they will receive a WM_SPOOLERSTATUS message for every change in spooler status.
Note The WM_SPOOLERSTATUS message is not supported after Windows XP. To be notified of changes to the print queue status in Windows NT 3.5 and later versions of Windows, you can use FindFirstPrinterChangeNotification and FindNextPrinterChangeNotification.
Requirements
Client Requires Windows Vista, Windows XP, Windows 2000 Professional, Windows NT Workstation 3.1 and later, Windows Me, Windows 98, or Windows 95.
Header Declared in Winuser.h; include Windows.h.</misc>
</message>
<message value="0x7D">
<name>WM_STYLECHANGED</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies whether the window's styles or extended window styles have changed. This parameter can be one or more of the following values.
GWL_EXSTYLE
The extended window styles have changed.
GWL_STYLE
The window styles have changed.</wmisc>
</wparam>
<lparam value="STYLESTRUCT">
<lname>lParam</lname>
<lmisc>lParam
Pointer to a STYLESTRUCT structure that contains the new styles for the window. An application can examine the styles, but cannot change them.
</lmisc>
</lparam>
<misc>WM_STYLECHANGED Notification
The WM_STYLECHANGED message is sent to a window after the SetWindowLong function has changed one or more of the window's styles.
A window receives this message through its WindowProc function.
Syntax
WM_STYLECHANGED
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Specifies whether the window's styles or extended window styles have changed. This parameter can be one or more of the following values.
GWL_EXSTYLE
The extended window styles have changed.
GWL_STYLE
The window styles have changed.
lParam
Pointer to a STYLESTRUCT structure that contains the new styles for the window. An application can examine the styles, but cannot change them.
Return Value
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.51</misc>
</message>
<message value="0x7C">
<name>WM_STYLECHANGING</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies whether the window's styles or extended window styles are changing. This parameter can be one or more of the following values.
GWL_EXSTYLE
The extended window styles are changing.
GWL_STYLE
The window styles are changing.</wmisc>
</wparam>
<lparam value="STYLESTRUCT">
<lname>lParam</lname>
<lmisc>lParam
Pointer to a STYLESTRUCT structure that contains the proposed new styles for the window. An application can examine the styles and, if necessary, change them.
</lmisc>
</lparam>
<misc>WM_STYLECHANGING Notification
The WM_STYLECHANGING message is sent to a window when the SetWindowLong function is about to change one or more of the window's styles.
A window receives this message through its WindowProc function.
Syntax
WM_STYLECHANGING
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Specifies whether the window's styles or extended window styles are changing. This parameter can be one or more of the following values.
GWL_EXSTYLE
The extended window styles are changing.
GWL_STYLE
The window styles are changing.
lParam
Pointer to a STYLESTRUCT structure that contains the proposed new styles for the window. An application can examine the styles and, if necessary, change them.
Return Value
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.51</misc>
</message>
<message value="0x88">
<name>WM_SYNCPAINT</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
An application returns zero if it processes this message.</returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc>This message has no parameters.</wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc>This message has no parameters.</lmisc>
</lparam>
<misc>WM_SYNCPAINT Message
The WM_SYNCPAINT message is used to synchronize painting while avoiding linking independent GUI threads.
A window receives this message through its WindowProc function.
LRESULT CALLBACK WindowProc(
HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
);
Parameters
This message has no parameters.
Return Value
An application returns zero if it processes this message.
Remarks
When a window has been hidden, shown, moved, or sized, the system may determine that it is necessary to send a WM_SYNCPAINT message to the top-level windows of other threads. Applications must pass WM_SYNCPAINT to DefWindowProc for processing. The DefWindowProc function will send a WM_NCPAINT message to the window procedure if the window frame must be painted and send a WM_ERASEBKGND message if the window background must be erased.
Requirements
Client Requires Windows Vista, Windows XP, Windows 2000 Professional, Windows NT Workstation, Windows Me, Windows 98, or Windows 95.
Header Declared in Winuser.h; include Windows.h.</misc>
</message>
<message value="0x106">
<name>WM_SYSCHAR</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
An application should return zero if it processes this message. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the character code of the window menu key.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Specifies the repeat count, scan code, extended-key flag, context code, previous key-state flag, and transition-state flag, as shown in the following table.
0-15
Specifies the repeat count for the current message. The value is the number of times the keystroke was auto-repeated as a result of the user holding down the key. If the keystroke is held long enough, multiple messages are sent. However, the repeat count is not cumulative.
16-23
Specifies the scan code. The value depends on the original equipment manufacturer (OEM).
24
Specifies whether the key is an extended key, such as the right-hand ALT and CTRL keys that appear on an enhanced 101- or 102-key keyboard. The value is 1 if it is an extended key; otherwise, it is 0.
25-28
Reserved; do not use.
29
Specifies the context code. The value is 1 if the ALT key is held down while the key is pressed; otherwise, the value is 0.
30
Specifies the previous key state. The value is 1 if the key is down before the message is sent, or it is 0 if the key is up.
31
Specifies the transition state. The value is 1 if the key is being released, or it is 0 if the key is being pressed.
</lmisc>
</lparam>
<misc>WM_SYSCHAR Notification
The WM_SYSCHAR message is posted to the window with the keyboard focus when a WM_SYSKEYDOWN message is translated by the TranslateMessage function. It specifies the character code of a system character key that is, a character key that is pressed while the ALT key is down.
Syntax
WM_SYSCHAR
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Specifies the character code of the window menu key.
lParam
Specifies the repeat count, scan code, extended-key flag, context code, previous key-state flag, and transition-state flag, as shown in the following table.
0-15
Specifies the repeat count for the current message. The value is the number of times the keystroke was auto-repeated as a result of the user holding down the key. If the keystroke is held long enough, multiple messages are sent. However, the repeat count is not cumulative.
16-23
Specifies the scan code. The value depends on the original equipment manufacturer (OEM).
24
Specifies whether the key is an extended key, such as the right-hand ALT and CTRL keys that appear on an enhanced 101- or 102-key keyboard. The value is 1 if it is an extended key; otherwise, it is 0.
25-28
Reserved; do not use.
29
Specifies the context code. The value is 1 if the ALT key is held down while the key is pressed; otherwise, the value is 0.
30
Specifies the previous key state. The value is 1 if the key is down before the message is sent, or it is 0 if the key is up.
31
Specifies the transition state. The value is 1 if the key is being released, or it is 0 if the key is being pressed.
Return Value
An application should return zero if it processes this message.
Remarks
When the context code is zero, the message can be passed to the TranslateAccelerator function, which will handle it as though it were a standard key message instead of a system character-key message. This allows accelerator keys to be used with the active window even if the active window does not have the keyboard focus.
For enhanced 101- and 102-key keyboards, extended keys are the right ALT and CTRL keys on the main section of the keyboard; the INS, DEL, HOME, END, PAGE UP, PAGE DOWN and arrow keys in the clusters to the left of the numeric keypad; the PRINT SCRN key; the BREAK key; the NUMLOCK key; and the divide (/) and ENTER keys in the numeric keypad. Other keyboards may support the extended-key bit in the lParam parameter.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x15">
<name>WM_SYSCOLORCHANGE</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc>WM_SYSCOLORCHANGE Message
The WM_SYSCOLORCHANGE message is sent to all top-level windows when a change is made to a system color setting.
A window receives this message through its WindowProc function.
LRESULT CALLBACK WindowProc(
HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
);
Remarks
The system sends a WM_PAINT message to any window that is affected by a system color change.
Applications that have brushes using the existing system colors should delete those brushes and re-create them using the new system colors.
Top level windows that use common controls must forward the WM_SYSCOLORCHANGE message to the controls; otherwise, the controls will not be notified of the color change. This ensures that the colors used by your common controls are consistent with those used by other user interface objects. For example, a toolbar control uses the "3D Objects" color to draw its buttons. If the user changes the 3D Objects color but the WM_SYSCOLORCHANGE message is not forwarded to the toolbar, the toolbar buttons will remain in their original color while the color of other buttons in the system changes.
Requirements
Client Requires Windows Vista, Windows XP, Windows 2000 Professional, Windows NT Workstation 3.1 and later, Windows Me, Windows 98, or Windows 95.
Header Declared in Winuser.h; include Windows.h.</misc>
</message>
<message value="0x112">
<name>WM_SYSCOMMAND</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
An application should return zero if it processes this message.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>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 powering on
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.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>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.
</lmisc>
</lparam>
<misc>WM_SYSCOMMAND Notification
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.
Syntax
WM_SYSCOMMAND
WPARAM wParam
LPARAM lParam;
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 powering on
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.
Return Value
An application should return zero if it processes this message.
Remarks
To obtain the position coordinates in screen coordinates, use the following code:
Copy Code
xPos = GET_X_LPARAM(lParam); // horizontal position
yPos = GET_Y_LPARAM(lParam); // vertical position
The DefWindowProc function carries out the window menu request for the predefined actions specified in the previous table.
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.
An application can carry out any system command at any time by passing a WM_SYSCOMMAND message to DefWindowProc. Any WM_SYSCOMMAND messages not handled by the application must be passed to DefWindowProc. Any command values added by an application must be processed by the application and cannot be passed to DefWindowProc.
Microsoft Windows Vista and later: If password protection is enabled by policy, the screen saver is started regardless of what an application does with the SC_SCREENSAVE notification even if fails to pass it to DefWindowProc.
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'.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x107">
<name>WM_SYSDEADCHAR</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
An application should return zero if it processes this message. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the character code generated by the system dead key that is, a dead key that is pressed while holding down the ALT key.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Specifies the repeat count, scan code, extended-key flag, context code, previous key-state flag, and transition-state flag, as shown in the following table.
0-15
Specifies the repeat count for the current message. The value is the number of times the keystroke is autorepeated as a result of the user holding down the key. If the keystroke is held long enough, multiple messages are sent. However, the repeat count is not cumulative.
16-23
Specifies the scan code. The value depends on the OEM.
24
Specifies whether the key is an extended key, such as the right-hand ALT and CTRL keys that appear on an enhanced 101- or 102-key keyboard. The value is 1 if it is an extended key; otherwise, it is 0.
25-28
Reserved; do not use.
29
Specifies the context code. The value is 1 if the ALT key is held down while the key is pressed; otherwise, the value is 0.
30
Specifies the previous key state. The value is 1 if the key is down before the message is sent, or it is 0 if the key is up.
31
Specifies the transition state. The value is 1 if the key is being released, or it is 0 if the key is being pressed.
</lmisc>
</lparam>
<misc>WM_SYSDEADCHAR Notification
The WM_SYSDEADCHAR message is sent to the window with the keyboard focus when a WM_SYSKEYDOWN message is translated by the TranslateMessage function. WM_SYSDEADCHAR specifies the character code of a system dead key that is, a dead key that is pressed while holding down the ALT key.
Syntax
WM_SYSDEADCHAR
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Specifies the character code generated by the system dead key that is, a dead key that is pressed while holding down the ALT key.
lParam
Specifies the repeat count, scan code, extended-key flag, context code, previous key-state flag, and transition-state flag, as shown in the following table.
0-15
Specifies the repeat count for the current message. The value is the number of times the keystroke is autorepeated as a result of the user holding down the key. If the keystroke is held long enough, multiple messages are sent. However, the repeat count is not cumulative.
16-23
Specifies the scan code. The value depends on the OEM.
24
Specifies whether the key is an extended key, such as the right-hand ALT and CTRL keys that appear on an enhanced 101- or 102-key keyboard. The value is 1 if it is an extended key; otherwise, it is 0.
25-28
Reserved; do not use.
29
Specifies the context code. The value is 1 if the ALT key is held down while the key is pressed; otherwise, the value is 0.
30
Specifies the previous key state. The value is 1 if the key is down before the message is sent, or it is 0 if the key is up.
31
Specifies the transition state. The value is 1 if the key is being released, or it is 0 if the key is being pressed.
Return Value
An application should return zero if it processes this message.
Remarks
For enhanced 101- and 102-key keyboards, extended keys are the right ALT and CTRL keys on the main section of the keyboard; the INS, DEL, HOME, END, PAGE UP, PAGE DOWN, and arrow keys in the clusters to the left of the numeric keypad; and the divide (/) and ENTER keys in the numeric keypad. Other keyboards may support the extended-key bit in the lParam parameter.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x104">
<name>WM_SYSKEYDOWN</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
An application should return zero if it processes this message. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the virtual-key code of the key being pressed. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Specifies the repeat count, scan code, extended-key flag, context code, previous key-state flag, and transition-state flag, as shown in the following table.
0-15
Specifies the repeat count for the current message. The value is the number of times the keystroke is autorepeated as a result of the user holding down the key. If the keystroke is held long enough, multiple messages are sent. However, the repeat count is not cumulative.
16-23
Specifies the scan code. The value depends on the OEM.
24
Specifies whether the key is an extended key, such as the right-hand ALT and CTRL keys that appear on an enhanced 101- or 102-key keyboard. The value is 1 if it is an extended key; otherwise, it is 0.
25-28
Reserved; do not use.
29
Specifies the context code. The value is 1 if the ALT key is down while the key is pressed; it is 0 if the WM_SYSKEYDOWN message is posted to the active window because no window has the keyboard focus.
30
Specifies the previous key state. The value is 1 if the key is down before the message is sent, or it is 0 if the key is up.
31
Specifies the transition state. The value is always 0 for a WM_SYSKEYDOWN message.</lmisc>
</lparam>
<misc>WM_SYSKEYDOWN Notification
The WM_SYSKEYDOWN message is posted to the window with the keyboard focus when the user presses the F10 key (which activates the menu bar) or holds down the ALT key and then presses another key. It also occurs when no window currently has the keyboard focus; in this case, the WM_SYSKEYDOWN message is sent to the active window. The window that receives the message can distinguish between these two contexts by checking the context code in the lParam parameter.
Syntax
WM_SYSKEYDOWN
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Specifies the virtual-key code of the key being pressed.
lParam
Specifies the repeat count, scan code, extended-key flag, context code, previous key-state flag, and transition-state flag, as shown in the following table.
0-15
Specifies the repeat count for the current message. The value is the number of times the keystroke is autorepeated as a result of the user holding down the key. If the keystroke is held long enough, multiple messages are sent. However, the repeat count is not cumulative.
16-23
Specifies the scan code. The value depends on the OEM.
24
Specifies whether the key is an extended key, such as the right-hand ALT and CTRL keys that appear on an enhanced 101- or 102-key keyboard. The value is 1 if it is an extended key; otherwise, it is 0.
25-28
Reserved; do not use.
29
Specifies the context code. The value is 1 if the ALT key is down while the key is pressed; it is 0 if the WM_SYSKEYDOWN message is posted to the active window because no window has the keyboard focus.
30
Specifies the previous key state. The value is 1 if the key is down before the message is sent, or it is 0 if the key is up.
31
Specifies the transition state. The value is always 0 for a WM_SYSKEYDOWN message.
Return Value
An application should return zero if it processes this message.
Remarks
The DefWindowProc function examines the specified key and generates a WM_SYSCOMMAND message if the key is either TAB or ENTER.
When the context code is zero, the message can be passed to the TranslateAccelerator function, which will handle it as though it were a normal key message instead of a character-key message. This allows accelerator keys to be used with the active window even if the active window does not have the keyboard focus.
Because of automatic repeat, more than one WM_SYSKEYDOWN message may occur before a WM_SYSKEYUP message is sent. The previous key state (bit 30) can be used to determine whether the WM_SYSKEYDOWN message indicates the first down transition or a repeated down transition.
For enhanced 101- and 102-key keyboards, enhanced keys are the right ALT and CTRL keys on the main section of the keyboard; the INS, DEL, HOME, END, PAGE UP, PAGE DOWN, and arrow keys in the clusters to the left of the numeric keypad; and the divide (/) and ENTER keys in the numeric keypad. Other keyboards may support the extended-key bit in the lParam parameter.
This message is also sent whenever the user presses the F10 key without the ALT key.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x105">
<name>WM_SYSKEYUP</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
An application should return zero if it processes this message. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Specifies the virtual-key code of the key being released. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Specifies the repeat count, scan code, extended-key flag, context code, previous key-state flag, and transition-state flag, as shown in the following list of values.
0-15
Specifies the repeat count for the current message. The value is the number of times the keystroke is autorepeated as a result of the user holding down the key. The repeat count is always one for a WM_SYSKEYUP message.
16-23
Specifies the scan code. The value depends on the OEM.
24
Specifies whether the key is an extended key, such as the right-hand ALT and CTRL keys that appear on an enhanced 101- or 102-key keyboard. The value is 1 if it is an extended key; otherwise, it is zero.
25-28
Reserved; do not use.
29
Specifies the context code. The value is 1 if the ALT key is down while the key is released; it is zero if the WM_SYSKEYDOWN message is posted to the active window because no window has the keyboard focus.
30
Specifies the previous key state. The value is always 1 for a WM_SYSKEYUP message.
31
Specifies the transition state. The value is always 1 for a WM_SYSKEYUP message.
</lmisc>
</lparam>
<misc>WM_SYSKEYUP Notification
The WM_SYSKEYUP message is posted to the window with the keyboard focus when the user releases a key that was pressed while the ALT key was held down. It also occurs when no window currently has the keyboard focus; in this case, the WM_SYSKEYUP message is sent to the active window. The window that receives the message can distinguish between these two contexts by checking the context code in the lParam parameter.
A window receives this message through its WindowProc function.
Syntax
WM_SYSKEYUP
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Specifies the virtual-key code of the key being released.
lParam
Specifies the repeat count, scan code, extended-key flag, context code, previous key-state flag, and transition-state flag, as shown in the following list of values.
0-15
Specifies the repeat count for the current message. The value is the number of times the keystroke is autorepeated as a result of the user holding down the key. The repeat count is always one for a WM_SYSKEYUP message.
16-23
Specifies the scan code. The value depends on the OEM.
24
Specifies whether the key is an extended key, such as the right-hand ALT and CTRL keys that appear on an enhanced 101- or 102-key keyboard. The value is 1 if it is an extended key; otherwise, it is zero.
25-28
Reserved; do not use.
29
Specifies the context code. The value is 1 if the ALT key is down while the key is released; it is zero if the WM_SYSKEYDOWN message is posted to the active window because no window has the keyboard focus.
30
Specifies the previous key state. The value is always 1 for a WM_SYSKEYUP message.
31
Specifies the transition state. The value is always 1 for a WM_SYSKEYUP message.
Return Value
An application should return zero if it processes this message.
Remarks
The DefWindowProc function sends a WM_SYSCOMMAND message to the top-level window if the F10 key or the ALT key was released. The wParam parameter of the message is set to SC_KEYMENU.
When the context code is zero, the message can be passed to the TranslateAccelerator function, which will handle it as though it were a normal key message instead of a character-key message. This allows accelerator keys to be used with the active window even if the active window does not have the keyboard focus.
For enhanced 101- and 102-key keyboards, extended keys are the right ALT and CTRL keys on the main section of the keyboard; the INS, DEL, HOME, END, PAGE UP, PAGE DOWN, and arrow keys in the clusters to the left of the numeric keypad; and the divide (/) and ENTER keys in the numeric keypad. Other keyboards may support the extended-key bit in the lParam parameter.
For non-U.S. enhanced 102-key keyboards, the right ALT key is handled as a CTRL+ALT key. The following table shows the sequence of messages that result when the user presses and releases this key.
Message Virtual-key code
WM_KEYDOWN VK_CONTROL
WM_KEYDOWN VK_MENU
WM_KEYUP VK_CONTROL
WM_SYSKEYUP VK_MENU
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x52">
<name>WM_TCARD</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="DWORD">
<wname>idAction</wname>
<wmisc>idAction
A value that indicates the action the user has taken. This can be one of the following values.
IDABORT
The user clicked an authorable Abort button.
IDCANCEL
The user clicked an authorable Cancel button.
IDCLOSE
The user closed the training card.
IDHELP
The user clicked an authorable Windows Help button.
IDIGNORE
The user clicked an authorable Ignore button.
IDOK
The user clicked an authorable OK button.
IDNO
The user clicked an authorable No button.
IDRETRY
The user clicked an authorable Retry button.
HELP_TCARD_DATA
The user clicked an authorable button. The dwActionData parameter contains a long integer specified by the Help author.
HELP_TCARD_OTHER_CALLER
Another application has requested training cards.
IDYES
The user clicked an authorable Yes button.</wmisc>
</wparam>
<lparam value="DWORD">
<lname>dwActionData</lname>
<lmisc>dwActionData
If idAction specifies HELP_TCARD_DATA, this parameter is a long specified by the Help author. Otherwise, this parameter is zero.
</lmisc>
</lparam>
<misc>WM_TCARD Message
Sent to an application that has initiated a training card with Microsoft Windows Help. The message informs the application when the user clicks an authorable button. An application initiates a training card by specifying the HELP_TCARD command in a call to the WinHelp function.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) WM_TCARD, // message ID
(WPARAM) wParam, // = (WPARAM) (DWORD) idAction;
(LPARAM) lParam // = (LPARAM) (DWORD) dwActionData;
);
Parameters
idAction
A value that indicates the action the user has taken. This can be one of the following values.
IDABORT
The user clicked an authorable Abort button.
IDCANCEL
The user clicked an authorable Cancel button.
IDCLOSE
The user closed the training card.
IDHELP
The user clicked an authorable Windows Help button.
IDIGNORE
The user clicked an authorable Ignore button.
IDOK
The user clicked an authorable OK button.
IDNO
The user clicked an authorable No button.
IDRETRY
The user clicked an authorable Retry button.
HELP_TCARD_DATA
The user clicked an authorable button. The dwActionData parameter contains a long integer specified by the Help author.
HELP_TCARD_OTHER_CALLER
Another application has requested training cards.
IDYES
The user clicked an authorable Yes button.
dwActionData
If idAction specifies HELP_TCARD_DATA, this parameter is a long specified by the Help author. Otherwise, this parameter is zero.
Return Value
Message Information
Minimum DLL Version shell32.dll version 4.0 or later
Custom Implementation No
Header winuser.h
Minimum operating systems Windows NT 4.0, Windows 95</misc>
</message>
<message value="0x1E">
<name>WM_TIMECHANGE</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
An application should return zero if it processes this message.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used; must be zero.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used; must be zero.</lmisc>
</lparam>
<misc>WM_TIMECHANGE Message
A message that is sent whenever there is a change in the system time.
A window receives this message through its WindowProc function.
LRESULT CALLBACK WindowProc(
HWND hwnd, // handle to window
UINT uMsg, // message identifier
WPARAM wParam, // not used; must be zero
LPARAM lParam // not used; must be zero
);
Parameters
hwnd
A handle to window.
uMsg
WM_TIMECHANGE identifier.
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
An application should return zero if it processes this message.
Remarks
An application should not broadcast this message, because the system will broadcast this message when the application changes the system time.
Requirements
Minimum supported client Windows 2000 Professional
Minimum supported server Windows 2000 Server
Header Winuser.h (include Windows.h)</misc>
</message>
<message value="0x113">
<name>WM_TIMER</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
[in] Specifies the timer identifier. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
[in] Pointer to an application-defined callback function that was passed to the SetTimer function when the timer was installed.
</lmisc>
</lparam>
<misc>WM_TIMER Notification
The WM_TIMER message is posted to the installing thread's message queue when a timer expires. The message is posted by the GetMessage or PeekMessage function.
Syntax
WM_TIMER
WPARAM wParam
LPARAM lParam;
Parameters
wParam
[in] Specifies the timer identifier.
lParam
[in] Pointer to an application-defined callback function that was passed to the SetTimer function when the timer was installed.
Return Value
Remarks
You can process the message by providing a WM_TIMER case in the window procedure. Otherwise, DispatchMessage will call the TimerProc callback function specified in the call to the SetTimer function used to install the timer.
The WM_TIMER message is a low-priority message. The GetMessage and PeekMessage functions post this message only when no other higher-priority messages are in the thread's message queue.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x304">
<name>WM_UNDO</name>
<return value="BOOL">
<returninfo>returns LRESULT in lResult</returninfo>
<returnmisc>Return Value
If the message succeeds, the return value is TRUE.
If the message fails, the return value is FALSE.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Not used; must be zero. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Not used; must be zero. </lmisc>
</lparam>
<misc>WM_UNDO Message
An application sends a WM_UNDO message to an edit control to undo the last operation. When this message is sent to an edit control, the previously deleted text is restored or the previously added text is deleted.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) WM_UNDO, // message ID
(WPARAM) wParam, // = 0; not used, must be zero
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
wParam
Not used; must be zero.
lParam
Not used; must be zero.
Return Value
If the message succeeds, the return value is TRUE.
If the message fails, the return value is FALSE.
Remarks
Rich Edit: It is recommended that EM_UNDO be used instead of WM_UNDO.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x125">
<name>WM_UNINITMENUPOPUP</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
No return value.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Handle to the menu </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
The high-order word identifies the menu that was destroyed. Currently, it can only be MF_SYSMENU (the window menu).
</lmisc>
</lparam>
<misc>WM_UNINITMENUPOPUP Notification
The WM_UNINITMENUPOPUP message is sent when a drop-down menu or submenu has been destroyed.
Syntax
WM_UNINITMENUPOPUP
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Handle to the menu
lParam
The high-order word identifies the menu that was destroyed. Currently, it can only be MF_SYSMENU (the window menu).
Return Value
No return value.
Remarks
If an application receives a WM_INITMENUPOPUP message, it will receive a WM_UNINITMENUPOPUP message.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 98, Windows 2000</misc>
</message>
<message value="0x128">
<name>WM_UPDATEUISTATE</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
No return value.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
The low-order word specifies the action to be performed. This parameter can be one of the following values.
UIS_CLEAR
The UI state element specified by the high-order word should be hidden.
UIS_INITIALIZE
The UI state element specified by the high-order word should be changed based on the last input event. For more information, see Remarks.
UIS_SET
The UI state element specified by the high-order word should be visible.
The high-order word specifies which UI state elements are affected or the style of the control. This parameter can be one or more of the following values.
UISF_HIDEACCEL
Keyboard accelerators.
UISF_HIDEFOCUS
Focus indicators.
UISF_ACTIVE
Windows XP: A control should be drawn in the style used for active controls.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used. </lmisc>
</lparam>
<misc>WM_UPDATEUISTATE Message
An application sends the WM_UPDATEUISTATE message to change the user interface (UI) state for the specified window and all its child windows.
Syntax
To send this message, call the SendMessage function as follows.
Copy Code
lResult = SendMessage(
(HWND) hWndControl, // handle to destination control
(UINT) WM_UPDATEUISTATE, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;
);
Parameters
wParam
The low-order word specifies the action to be performed. This parameter can be one of the following values.
UIS_CLEAR
The UI state element specified by the high-order word should be hidden.
UIS_INITIALIZE
The UI state element specified by the high-order word should be changed based on the last input event. For more information, see Remarks.
UIS_SET
The UI state element specified by the high-order word should be visible.
The high-order word specifies which UI state elements are affected or the style of the control. This parameter can be one or more of the following values.
UISF_HIDEACCEL
Keyboard accelerators.
UISF_HIDEFOCUS
Focus indicators.
UISF_ACTIVE
Windows XP: A control should be drawn in the style used for active controls.
lParam
This parameter is not used.
Return Value
No return value.
Remarks
A window should send this message to change the UI state of all its child windows. In contrast to the WM_CHANGEUISTATE message, which is a notification, when DefWindowProc processes the WM_UPDATEUISTATE message it changes the UI state and propagates the changes to all child windows.
The DefWindowProc function updates the UI state according to the wParam value. If the UI state is modified, the function sends the message to all the immediate child windows. DefWindowProc also sends this message when it receives a WM_CHANGEUISTATE message notifying the system that a child window intends to modify the UI state.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 2000</misc>
</message>
<message value="0x400">
<name>WM_USER</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
No return value.</returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc>WM_USER Notification
The WM_USER constant is used by applications to help define private messages for use by private window classes, usually of the form WM_USER+X, where X is an integer value.
Syntax
#define WM_USER 0x0400
Return Value
No return value.
Remarks
The following are the ranges of message numbers.
Range Meaning
0 through WM_USER 1 Messages reserved for use by the system.
WM_USER through 0x7FFF Integer messages for use by private window classes.
WM_APP through 0xBFFF Messages available for use by applications.
0xC000 through 0xFFFF String messages for use by applications.
Greater than 0xFFFF Reserved by the system.
Message numbers in the first range (0 through WM_USER 1) are defined by the system. Values in this range that are not explicitly defined are reserved by the system.
Message numbers in the second range (WM_USER through 0x7FFF) can be defined and used by an application to send messages within a private window class. These values cannot be used to define messages that are meaningful throughout an application, because some predefined window classes already define values in this range. For example, predefined control classes such as BUTTON, EDIT, LISTBOX, and COMBOBOX may use these values. Messages in this range should not be sent to other applications unless the applications have been designed to exchange messages and to attach the same meaning to the message numbers.
Message numbers in the third range (0x8000 through 0xBFFF) are available for application to use as private messages. Message in this range do not conflict with system messages.
Message numbers in the fourth range (0xC000 through 0xFFFF) are defined at run time when an application calls the RegisterWindowMessage function to retrieve a message number for a string. All applications that register the same string can use the associated message number for exchanging messages. The actual message number, however, is not a constant and cannot be assumed to be the same between different sessions.
Message numbers in the fifth range (greater than 0xFFFF) are reserved by the system.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x54">
<name>WM_USERCHANGED</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
This parameter is not used.</lmisc>
</lparam>
<misc>WM_USERCHANGED Notification
The WM_USERCHANGED message is sent to all windows after the user has logged on or off. When the user logs on or off, the system updates the user-specific settings. The system sends this message immediately after updating the settings.
A window receives this message through its WindowProc function.
Syntax
WM_USERCHANGED
WPARAM wParam
LPARAM lParam;
Parameters
wParam
This parameter is not used.
lParam
This parameter is not used.
Return Value
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95</misc>
</message>
<message value="0x2E">
<name>WM_VKEYTOITEM</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
The return value specifies the action that the application performed in response to the message. A return value of 2 indicates that the application handled all aspects of selecting the item and requires no further action by the list box. (See Remarks.) A return value of 1 indicates that the list box should perform the default action in response to the keystroke. A return value of 0 or greater specifies the index of an item in the list box and indicates that the list box should perform the default action for the keystroke on the specified item.
</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
The low-order word specifies the virtual-key code of the key the user pressed. The high-order word specifies the current position of the caret.
</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Handle to the list box.
</lmisc>
</lparam>
<misc>WM_VKEYTOITEM Notification
Sent by a list box with the LBS_WANTKEYBOARDINPUT style to its owner in response to a WM_KEYDOWN message.
Syntax
WM_VKEYTOITEM
WPARAM wParam
LPARAM lParam;
Parameters
wParam
The low-order word specifies the virtual-key code of the key the user pressed. The high-order word specifies the current position of the caret.
lParam
Handle to the list box.
Return Value
The return value specifies the action that the application performed in response to the message. A return value of 2 indicates that the application handled all aspects of selecting the item and requires no further action by the list box. (See Remarks.) A return value of 1 indicates that the list box should perform the default action in response to the keystroke. A return value of 0 or greater specifies the index of an item in the list box and indicates that the list box should perform the default action for the keystroke on the specified item.
Remarks
A return value of 2 is valid only for keys that are not translated into characters by the list box control. If the WM_KEYDOWN message translates to a WM_CHAR message and the application processes the WM_VKEYTOITEM message generated as a result of the key press, the list box ignores the return value and does the default processing for that character). WM_KEYDOWN messages generated by keys such as VK_UP, VK_DOWN, VK_NEXT, and VK_PREVIOUS are not translated to WM_CHAR messages. In such cases, trapping the WM_VKEYTOITEM message and returning 2 prevents the list box from doing the default processing for that key.
To trap keys that generate a char message and do special processing, the application must subclass the list box, trap both the WM_KEYDOWN and WM_CHAR messages, and process the messages appropriately in the subclass procedure.
The preceding remarks apply to regular list boxes that are created with the LBS_WANTKEYBOARDINPUT style. If the list box is owner-drawn, the application must process the WM_CHARTOITEM message.
The DefWindowProc function returns 1.
If a dialog box procedure handles this message, it should cast the desired return value to a BOOL and return the value directly. The DWL_MSGRESULT value set by the SetWindowLong function is ignored.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x115">
<name>WM_VSCROLL</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
If an application processes this message, it should return zero. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
The high-order word specifies the current position of the scroll box if the low-order word is SB_THUMBPOSITION or SB_THUMBTRACK; otherwise, this word is not used.
The low-order word specifies a scroll bar value that indicates the user's scrolling request. This parameter can be one of the following values.
SB_BOTTOM
Scrolls to the lower right.
SB_ENDSCROLL
Ends scroll.
SB_LINEDOWN
Scrolls one line down.
SB_LINEUP
Scrolls one line up.
SB_PAGEDOWN
Scrolls one page down.
SB_PAGEUP
Scrolls one page up.
SB_THUMBPOSITION
The user has dragged the scroll box (thumb) and released the mouse button. The high-order word indicates the position of the scroll box at the end of the drag operation.
SB_THUMBTRACK
The user is dragging the scroll box. This message is sent repeatedly until the user releases the mouse button. The high-order word indicates the position that the scroll box has been dragged to.
SB_TOP
Scrolls to the upper left.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
If the message is sent by a scroll bar, this parameter is the handle to the scroll bar control. If the message is not sent by a scroll bar, this parameter is NULL.
</lmisc>
</lparam>
<misc>WM_VSCROLL Notification
The WM_VSCROLL message is sent to a window when a scroll event occurs in the window's standard vertical scroll bar. This message is also sent to the owner of a vertical scroll bar control when a scroll event occurs in the control.
A window receives this message through its WindowProc function.
Syntax
WM_VSCROLL
WPARAM wParam
LPARAM lParam;
Parameters
wParam
The high-order word specifies the current position of the scroll box if the low-order word is SB_THUMBPOSITION or SB_THUMBTRACK; otherwise, this word is not used.
The low-order word specifies a scroll bar value that indicates the user's scrolling request. This parameter can be one of the following values.
SB_BOTTOM
Scrolls to the lower right.
SB_ENDSCROLL
Ends scroll.
SB_LINEDOWN
Scrolls one line down.
SB_LINEUP
Scrolls one line up.
SB_PAGEDOWN
Scrolls one page down.
SB_PAGEUP
Scrolls one page up.
SB_THUMBPOSITION
The user has dragged the scroll box (thumb) and released the mouse button. The high-order word indicates the position of the scroll box at the end of the drag operation.
SB_THUMBTRACK
The user is dragging the scroll box. This message is sent repeatedly until the user releases the mouse button. The high-order word indicates the position that the scroll box has been dragged to.
SB_TOP
Scrolls to the upper left.
lParam
If the message is sent by a scroll bar, this parameter is the handle to the scroll bar control. If the message is not sent by a scroll bar, this parameter is NULL.
Return Value
If an application processes this message, it should return zero.
Remarks
The SB_THUMBTRACK request code is typically used by applications that provide feedback as the user drags the scroll box.
If an application scrolls the content of the window, it must also reset the position of the scroll box by using the SetScrollPos function.
Note that the WM_VSCROLL message carries only 16 bits of scroll box position data. Thus, applications that rely solely on WM_VSCROLL (and WM_HSCROLL) for scroll position data have a practical maximum position value of 65,535.
However, because the SetScrollInfo, SetScrollPos, SetScrollRange, GetScrollInfo, GetScrollPos, and GetScrollRange functions support 32-bit scroll bar position data, there is a way to circumvent the 16-bit barrier of the WM_HSCROLL and WM_VSCROLL messages. See GetScrollInfo for a description of the technique.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x30A">
<name>WM_VSCROLLCLIPBOARD</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
If an application processes this message, it should return zero. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
Handle to the clipboard viewer window. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
The low-order word of lParam specifies a scroll bar event. This parameter can be one of the following values. The high-order word of lParam specifies the current position of the scroll box if the low-order word of lParam is SB_THUMBPOSITION; otherwise, the high-order word of lParam is not used.
SB_BOTTOM
Scroll to lower right.
SB_ENDSCROLL
End scroll.
SB_LINEDOWN
Scroll one line down.
SB_LINEUP
Scroll one line up.
SB_PAGEDOWN
Scroll one page down.
SB_PAGEUP
Scroll one page up.
SB_THUMBPOSITION
Scroll to absolute position. The current position is specified by the high-order word.
SB_TOP
Scroll to upper left.</lmisc>
</lparam>
<misc>WM_VSCROLLCLIPBOARD Notification
The WM_VSCROLLCLIPBOARD message is sent to the clipboard owner by a clipboard viewer window when the clipboard contains data in the CF_OWNERDISPLAY format and an event occurs in the clipboard viewer's vertical scroll bar. The owner should scroll the clipboard image and update the scroll bar values.
Syntax
WM_VSCROLLCLIPBOARD
WPARAM wParam
LPARAM lParam;
Parameters
wParam
Handle to the clipboard viewer window.
lParam
The low-order word of lParam specifies a scroll bar event. This parameter can be one of the following values. The high-order word of lParam specifies the current position of the scroll box if the low-order word of lParam is SB_THUMBPOSITION; otherwise, the high-order word of lParam is not used.
SB_BOTTOM
Scroll to lower right.
SB_ENDSCROLL
End scroll.
SB_LINEDOWN
Scroll one line down.
SB_LINEUP
Scroll one line up.
SB_PAGEDOWN
Scroll one page down.
SB_PAGEUP
Scroll one page up.
SB_THUMBPOSITION
Scroll to absolute position. The current position is specified by the high-order word.
SB_TOP
Scroll to upper left.
Return Value
If an application processes this message, it should return zero.
Remarks
The clipboard owner can use the ScrollWindow function to scroll the image in the clipboard viewer window and invalidate the appropriate region.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x47">
<name>WM_WINDOWPOSCHANGED</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
If an application processes this message, it should return zero. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Pointer to a WINDOWPOS structure that contains information about the window's new size and position. </lmisc>
</lparam>
<misc>WM_WINDOWPOSCHANGED Notification
The WM_WINDOWPOSCHANGED message is sent to a window whose size, position, or place in the Z order has changed as a result of a call to the SetWindowPos function or another window-management function.
A window receives this message through its WindowProc function.
Syntax
WM_WINDOWPOSCHANGED
WPARAM wParam
LPARAM lParam;
Parameters
wParam
This parameter is not used.
lParam
Pointer to a WINDOWPOS structure that contains information about the window's new size and position.
Return Value
If an application processes this message, it should return zero.
Remarks
By default, the DefWindowProc function sends the WM_SIZE and WM_MOVE messages to the window. The WM_SIZE and WM_MOVE messages are not sent if an application handles the WM_WINDOWPOSCHANGED message without calling DefWindowProc. It is more efficient to perform any move or size change processing during the WM_WINDOWPOSCHANGED message without calling DefWindowProc.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x46">
<name>WM_WINDOWPOSCHANGING</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
If an application processes this message, it should return zero. </returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used. </wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
Pointer to a WINDOWPOS structure that contains information about the window's new size and position. </lmisc>
</lparam>
<misc>WM_WINDOWPOSCHANGING Notification
The WM_WINDOWPOSCHANGING message is sent to a window whose size, position, or place in the Z order is about to change as a result of a call to the SetWindowPos function or another window-management function.
A window receives this message through its WindowProc function.
Syntax
WM_WINDOWPOSCHANGING
WPARAM wParam
LPARAM lParam;
Parameters
wParam
This parameter is not used.
lParam
Pointer to a WINDOWPOS structure that contains information about the window's new size and position.
Return Value
If an application processes this message, it should return zero.
Remarks
For a window with the WS_OVERLAPPED or WS_THICKFRAME style, the DefWindowProc function sends the WM_GETMINMAXINFO message to the window. This is done to validate the new size and position of the window and to enforce the CS_BYTEALIGNCLIENT and CS_BYTEALIGNWINDOW client styles. By not passing the WM_WINDOWPOSCHANGING message to the DefWindowProc function, an application can override these defaults.
While this message is being processed, modifying any of the values in WINDOWPOS affects the window's new size, position, or place in the Z order. An application can prevent changes to the window by setting or clearing the appropriate bits in the flags member of WINDOWPOS.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1</misc>
</message>
<message value="0x1A">
<name>WM_WININICHANGE</name>
<return value="">
<returninfo></returninfo>
<returnmisc>Return Value
If you process this message, return zero.</returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
This parameter is not used.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
A pointer to a string containing the name of the system parameter that was changed. For example, this string can be the name of a registry key or the name of a section in the Win.ini file. This parameter is not particularly useful in determining which system parameter changed. For example, when the string is a registry name, it typically indicates only the leaf node in the registry, not the whole path. In addition, some applications send this message with lParam set to NULL. In general, when you receive this message, you should check and reload any system parameter settings that are used by your application.
</lmisc>
</lparam>
<misc>WM_WININICHANGE Message
An application sends the WM_WININICHANGE message to all top-level windows after making a change to the WIN.INI file. The SystemParametersInfo function sends this message after an application uses the function to change a setting in WIN.INI.
Note The WM_WININICHANGE message is provided only for compatibility with earlier versions of the system. Applications should use the WM_SETTINGCHANGE message.
A window receives this message through its WindowProc function.
LRESULT CALLBACK WindowProc(
HWND hwnd, // handle to window
UINT uMsg, // message identifier
WPARAM wParam, // not used; must be zero
LPARAM lParam // system parameter area
);
Parameters
hwnd
A handle to window.
uMsg
The WM_WININICHANGE identifier.
wParam
This parameter is not used.
lParam
A pointer to a string containing the name of the system parameter that was changed. For example, this string can be the name of a registry key or the name of a section in the Win.ini file. This parameter is not particularly useful in determining which system parameter changed. For example, when the string is a registry name, it typically indicates only the leaf node in the registry, not the whole path. In addition, some applications send this message with lParam set to NULL. In general, when you receive this message, you should check and reload any system parameter settings that are used by your application.
Return Value
If you process this message, return zero.
Remarks
To send the WM_WININICHANGE message to all top-level windows, use the SendMessage function with the hWnd parameter set to HWND_BROADCAST.
Calls to functions that change WIN.INI may be mapped to the registry instead. This mapping occurs when WIN.INI and the section being changed are specified in the registry under the following key:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\IniFileMapping
The change in the storage location has no effect on the behavior of this message.
Requirements
Minimum supported client Windows 2000 Professional
Minimum supported server Windows 2000 Server
Header Winuser.h (include Windows.h)</misc>
</message>
<message value="0x109">
<name>WM_WNT_CONVERTREQUESTEX</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname></wname>
<wmisc></wmisc>
</wparam>
<lparam value="">
<lname></lname>
<lmisc></lmisc>
</lparam>
<misc></misc>
</message>
<message value="0x20D">
<name>WM_XBUTTONDBLCLK</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
The low-order word indicates whether various virtual keys are down. It can be one or more of the following values.
Value Meaning
MK_CONTROL The CTRL key is down.
MK_LBUTTON The left mouse button is down.
MK_MBUTTON The middle mouse button is down.
MK_RBUTTON The right mouse button is down.
MK_SHIFT The SHIFT key is down.
MK_XBUTTON1 The first X button is down.
MK_XBUTTON2 The second X button is down.
The high-order word indicates which button was double-clicked. It can be one of the following values.
Value Meaning
XBUTTON1 The first X button was double-clicked.
XBUTTON2 The second X button was double-clicked.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
The low-order word specifies the x-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
The high-order word specifies the y-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
</lmisc>
</lparam>
<misc>WM_XBUTTONDBLCLK Notification
The WM_XBUTTONDBLCLK message is posted when the user double-clicks the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
A window receives this message through its WindowProc function.
Syntax
WM_XBUTTONDBLCLK
WPARAM wParam
LPARAM lParam;
Parameters
wParam
The low-order word indicates whether various virtual keys are down. It can be one or more of the following values.
Value Meaning
MK_CONTROL The CTRL key is down.
MK_LBUTTON The left mouse button is down.
MK_MBUTTON The middle mouse button is down.
MK_RBUTTON The right mouse button is down.
MK_SHIFT The SHIFT key is down.
MK_XBUTTON1 The first X button is down.
MK_XBUTTON2 The second X button is down.
The high-order word indicates which button was double-clicked. It can be one of the following values.
Value Meaning
XBUTTON1 The first X button was double-clicked.
XBUTTON2 The second X button was double-clicked.
lParam
The low-order word specifies the x-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
The high-order word specifies the y-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
Return Value
Remarks
Use the following code to get the information in the wParam parameter:
Copy Code
fwKeys = GET_KEYSTATE_WPARAM (wParam);
fwButton = GET_XBUTTON_WPARAM (wParam);
Use the following code to obtain the horizontal and vertical position:
Copy Code
xPos = GET_X_LPARAM(lParam);
yPos = GET_Y_LPARAM(lParam);
You can also use the MAKEPOINTS macro to convert the lParamparameter to a POINTS structure.
Only windows that have the CS_DBLCLKS style can receive WM_XBUTTONDBLCLK messages, which the system generates whenever the user presses, releases, and again presses an X button within the system's double-click time limit. Double-clicking one of these buttons actually generates four messages: WM_XBUTTONDOWN, WM_XBUTTONUP, WM_XBUTTONDBLCLK, and WM_XBUTTONUP again.
Unlike the WM_LBUTTONDBLCLK, WM_MBUTTONDBLCLK, and WM_RBUTTONDBLCLK messages, an application should return TRUE from this message if it processes it. Doing so will allow software that simulates this message on Microsoft Windows systems earlier than Windows 2000 to determine whether the window procedure processed the message or called DefWindowProc to process it.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Millennium, Windows 2000</misc>
</message>
<message value="0x20B">
<name>WM_XBUTTONDOWN</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
The low-order word indicates whether various virtual keys are down. It can be one or more of the following values.
Value Meaning
MK_CONTROL The CTRL key is down.
MK_LBUTTON The left mouse button is down.
MK_MBUTTON The middle mouse button is down.
MK_RBUTTON The right mouse button is down.
MK_SHIFT The SHIFT key is down.
MK_XBUTTON1 The first X button is down.
MK_XBUTTON2 The second X button is down.
The high-order word indicates which button was clicked. It can be one of the following values.
Value Meaning
XBUTTON1 The first X button was clicked.
XBUTTON2 The second X button was clicked.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
The low-order word specifies the x-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
The high-order word specifies the y-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
</lmisc>
</lparam>
<misc>WM_XBUTTONDOWN Notification
The WM_XBUTTONDOWN message is posted when the user presses the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
A window receives this message through its WindowProc function.
Syntax
WM_XBUTTONDOWN
WPARAM wParam
LPARAM lParam;
Parameters
wParam
The low-order word indicates whether various virtual keys are down. It can be one or more of the following values.
Value Meaning
MK_CONTROL The CTRL key is down.
MK_LBUTTON The left mouse button is down.
MK_MBUTTON The middle mouse button is down.
MK_RBUTTON The right mouse button is down.
MK_SHIFT The SHIFT key is down.
MK_XBUTTON1 The first X button is down.
MK_XBUTTON2 The second X button is down.
The high-order word indicates which button was clicked. It can be one of the following values.
Value Meaning
XBUTTON1 The first X button was clicked.
XBUTTON2 The second X button was clicked.
lParam
The low-order word specifies the x-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
The high-order word specifies the y-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
Return Value
Remarks
Use the following code to get the information in the wParam parameter:
Copy Code
fwKeys = GET_KEYSTATE_WPARAM (wParam);
fwButton = GET_XBUTTON_WPARAM (wParam);
Use the following code to obtain the horizontal and vertical position:
Copy Code
xPos = GET_X_LPARAM(lParam);
yPos = GET_Y_LPARAM(lParam);
You can also use the MAKEPOINTS macro to convert the lParam parameter to a POINTS structure.
Unlike the WM_LBUTTONDOWN, WM_MBUTTONDOWN, and WM_RBUTTONDOWN messages, an application should return TRUE from this message if it processes it. Doing so allows software that simulates this message on Microsoft Windows systems earlier than Windows 2000 to determine whether the window procedure processed the message or called DefWindowProc to process it.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Millennium, Windows 2000</misc>
</message>
<message value="0x20C">
<name>WM_XBUTTONUP</name>
<return value="">
<returninfo></returninfo>
<returnmisc></returnmisc>
</return>
<wparam value="">
<wname>wParam</wname>
<wmisc>wParam
The low-order word indicates whether various virtual keys are down. It can be one or more of the following values.
Value Meaning
MK_CONTROL The CTRL key is down.
MK_LBUTTON The left mouse button is down.
MK_MBUTTON The middle mouse button is down.
MK_RBUTTON The right mouse button is down.
MK_SHIFT The SHIFT key is down.
MK_XBUTTON1 The first X button is down.
MK_XBUTTON2 The second X button is down.
The high-order word indicates which button was double-clicked. It can be one of the following values.
Value Meaning
XBUTTON1 The first X button was double-clicked.
XBUTTON2 The second X button was double-clicked.</wmisc>
</wparam>
<lparam value="">
<lname>lParam</lname>
<lmisc>lParam
The low-order word specifies the x-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
The high-order word specifies the y-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
</lmisc>
</lparam>
<misc>WM_XBUTTONUP Notification
The WM_XBUTTONUP message is posted when the user releases the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
A window receives this message through its WindowProc function.
Syntax
WM_XBUTTONUP
WPARAM wParam
LPARAM lParam;
Parameters
wParam
The low-order word indicates whether various virtual keys are down. It can be one or more of the following values.
Value Meaning
MK_CONTROL The CTRL key is down.
MK_LBUTTON The left mouse button is down.
MK_MBUTTON The middle mouse button is down.
MK_RBUTTON The right mouse button is down.
MK_SHIFT The SHIFT key is down.
MK_XBUTTON1 The first X button is down.
MK_XBUTTON2 The second X button is down.
The high-order word indicates which button was double-clicked. It can be one of the following values.
Value Meaning
XBUTTON1 The first X button was double-clicked.
XBUTTON2 The second X button was double-clicked.
lParam
The low-order word specifies the x-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
The high-order word specifies the y-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
Return Value
Remarks
Use the following code to get the information in the wParam parameter:
Copy Code
fwKeys = GET_KEYSTATE_WPARAM (wParam);
fwButton = GET_XBUTTON_WPARAM (wParam);
Use the following code to obtain the horizontal and vertical position:
Copy Code
xPos = GET_X_LPARAM(lParam);
yPos = GET_Y_LPARAM(lParam);
You can also use the MAKEPOINTS macro to convert the lParam parameter to a POINTS structure.
Unlike the WM_LBUTTONUP, WM_MBUTTONUP, and WM_RBUTTONUP messages, an application should return TRUE from this message if it processes it. Doing so will allow software that simulates this message on Microsoft Windows systems earlier than Windows 2000 to determine whether the window procedure processed the message or called DefWindowProc to process it.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Millennium, Windows 2000</misc>
</message>
</messages>