windows_programming_notes.nbk: Home | Index | Next Page: TCN_SELCHANGE | Previous Page: TCM_GETCURSEL


 TCM_SETCURSEL

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.

    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

Return Value

Returns the index of the previously selected tab if successful, or -1 otherwise.

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


windows_programming_notes.nbk: Home | Index | Next Page: TCN_SELCHANGE | Previous Page: TCM_GETCURSEL


Notebook exported on Monday, 7 July 2008, 18:56:50 PM Eastern Daylight Time