I process WM_NOTIY in winproc to get what tab of a tab control the user choose
(display a message box when a user click tabpage number 2 of a tab control of 4 pages)
but the message box keeps poping up anoyingly :( and undeletable
Thank you
Printable View
I process WM_NOTIY in winproc to get what tab of a tab control the user choose
(display a message box when a user click tabpage number 2 of a tab control of 4 pages)
but the message box keeps poping up anoyingly :( and undeletable
Thank you
I am lost.
Can you just help me with what i lost ? that is my little happiness
this is my third post to inform the issue i am running into now
could someone please ?
We can't read your mind. How about posting, at least, the code for your WM_NOTIFY handler.
Thank you hoxsiew,
Here is the code in a winproc
Code:swith(message)
{
case WM_NOTIFY:
if(m_tab.GetCurSel()==5)
{
AfxMessageBox(_T("Alert ! you press tab 5!"));
}
break;
}
So if two conditions are met: your tab control has tab 5 selected, and ANYTHING sends a WM_NOTIFY message; you'll get a message box. Can you see the problem?
I don't know what you are talking about.
Hmmm, Ok, I wish to meet you somewhere, so you can state your helpful solution.
My tab control hasn't been solved so far :(
Edit: you don't need to continue posting anything in this thread. Let me be more stupid. I am already a fumb boy why do you need to help me know what I am wrong with :mad:
I'm talking about the WM_NOTIFY message. There could be any number of controls sending notifications for a wide variety of reasons. You aren't discriminating amongst them at all. Whenever your loop gets a WM_NOTIFY, the only thing you are checking is the status of the tab control selection. The tab can be in a selected state for an indefinite period of time (until you select another tab) so during the time that tab 5 is the current tab, any other control that sends a WM_NOTIFY to your loop for any number of reasons, will cause a message box to pop up.
Read up on the WM_NOTIFY message and pay close attention to the lParam; it is a NMHDR pointer in this case and it tells you a great deal of information on the control that sent it and why. If it is from the tab control and use that to determine if the message is of any interest to you. If it isn't sent from the tab control and if it isn't a TCN_SELCHANGE, then you probably don't want to pop up a message box.
WM_NOTIFY
Viggy
If I remember my messaging correctly (it's been a while since i played with this stuff), you recieve the WM_NOTIFY message *before* the tab actually changes. So, at the time you get the message, "GetCurSel()" will not return the tab you are switching to.
Why not just check that you are getting the TCN_SELCHANGE message?
Viggy
PS. You can also stick a conditional breakpoint on your "if" line, so that it only breaks if "p->idCode == TAB5_ID". Then you can see what the currently selected tab is, to verify my statement.