我有一个CTabCtrl的控件,当它向父窗口发送TCN_SELCHANGE消息的时候,在父窗口的处理程序中我想判断该消息是否是由鼠标单击控件而发生的。因为如果直接调用控件的SetCurSel方法也会发送TCN_SELCHANGE消息,我想区分这种情况。
我想能不能在消息处理的函数中获得发送消息时鼠标的位置,然后调用HitTest函数去看看是否是单击了控件的某个Item. 或者还有什么别的方法,恳请帮助!
我想能不能在消息处理的函数中获得发送消息时鼠标的位置,然后调用HitTest函数去看看是否是单击了控件的某个Item. 或者还有什么别的方法,恳请帮助!
int SetCurSel(
int nItem
);
Parameters
nItem
The zero-based index of the item to be selected.Return Value
Zero-based index of the previously selected tab if successful, otherwise – 1.Res
A tab control does not send a TCN_SELCHANGING or TCN_SELCHANGE notification message when a tab is selected using this function. These notifications are sent, using WM_NOTIFY, when the user clicks or uses the keyboard to change tabs.
按照msdn上的说法 调用SetCurSel 没有发送TCN_SELCHANGE 消息啊