How can I detect a change in the ComboBox?
For example: so when the first option of the combobox (index=0) is selected, I could disable some other control.
I would like to do that in simple API, without any MFC.
Thank you.
How can I detect a change in the ComboBox?
For example: so when the first option of the combobox (index=0) is selected, I could disable some other control.
I would like to do that in simple API, without any MFC.
Thank you.
"I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe
http://www.Bloodware.net - Developing free software for the community.
The combobox will send you a notification message:
This is from a program I am currently working on. It will launch the function ChangeAvailableBitrates() when the combo box IDC_SAMPFREQ2 has been closed (i.e. the user made a new selection).Code:case WM_COMMAND: { switch(HIWORD(wParam)) { case CBN_CLOSEUP: switch(LOWORD(wParam)) { case IDC_SAMPFREQ2: ChangeAvailableBitrates(hBitrates, false); } }
Thor's self help tip:
Maybe a neighbor is tossing leaf clippings on your lawn, looking at your woman, or harboring desires regarding your longboat. You enslave his children, set his house on fire. He shall not bother you again.
OS: Windows XP
Compiler: MSVC
so when a user closed the combobox, he probably made a new selection, so then I will read the combobox, and know what to do...
But I could just do:
Thanks man.Code:if ((LOWORD(wParam)==ID_MY_COMBO)&&(HIWORD(wParam)==CBN_CLOSEUP)) /* do something */
Last edited by Devil Panther; 01-17-2004 at 08:04 AM.
"I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe
http://www.Bloodware.net - Developing free software for the community.
yeah just send the something like the CB_GETCURSEL message, which will return the zero-based index of the item currently selected, then do your thang.
Thor's self help tip:
Maybe a neighbor is tossing leaf clippings on your lawn, looking at your woman, or harboring desires regarding your longboat. You enslave his children, set his house on fire. He shall not bother you again.
OS: Windows XP
Compiler: MSVC
Thanks a million
"I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe
http://www.Bloodware.net - Developing free software for the community.
No probs.
Thor's self help tip:
Maybe a neighbor is tossing leaf clippings on your lawn, looking at your woman, or harboring desires regarding your longboat. You enslave his children, set his house on fire. He shall not bother you again.
OS: Windows XP
Compiler: MSVC
Just one more thing...
How did you know it's a HIWORD(wParam)...
Because I just looked up the CBN_CLOSEUP in the msdn, and it didn't say anything about hiword.
"I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe
http://www.Bloodware.net - Developing free software for the community.
butCode:CBN_CLOSEUP idComboBox = (int) LOWORD(wParam); // identifier of combo box hwndComboBox = (HWND) lParam; // handle of combo box
CBN_CLOSEUP is a notification message so it is in the high word of the wParam of WM_COMMAND.Code:WM_COMMAND wNotifyCode = HIWORD(wParam); // notification code wID = LOWORD(wParam); // item, control, or accelerator identifier hwndCtl = (HWND) lParam; // handle of control
Thor's self help tip:
Maybe a neighbor is tossing leaf clippings on your lawn, looking at your woman, or harboring desires regarding your longboat. You enslave his children, set his house on fire. He shall not bother you again.
OS: Windows XP
Compiler: MSVC
always the same structure... LOWORD is CONTROL ID
and HIWORD is notification.
Thanks for making it clear to me.
"I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe
http://www.Bloodware.net - Developing free software for the community.
Here is the entire reference for Combo Boxes (if you aren't already using it).
gg