Need help with my drop down list control. I got it all set up and the strings inserted, and what im confused on is how to make the string when selected from the drop down list perform a command such as invoke ExitProcess,0
any help would be appriciated. thanks in advance.
any help would be appriciated. thanks in advance.
That is interesting. I think you should use LoadLibrary and GetProcAddr to get the address to the function and manually push the correct number of parameters and call it. ;)
CBN_SELCHANGE Notification
The CBN_SELCHANGE notification message is sent when the user changes the current selection in the list box of a combo box. The user can change the selection by clicking in the list box or by using the arrow keys. The parent window of the combo box receives this notification in the form of a WM_COMMAND message with CBN_SELCHANGE in the high-order word of the wParam parameter.
The CBN_SELCHANGE notification message is sent when the user changes the current selection in the list box of a combo box. The user can change the selection by clicking in the list box or by using the arrow keys. The parent window of the combo box receives this notification in the form of a WM_COMMAND message with CBN_SELCHANGE in the high-order word of the wParam parameter.
Platform SDK is good. Read it sometimes :)
That is interesting. I think you should use LoadLibrary and GetProcAddr to get the address to the function and manually push the correct number of parameters and call it. ;)
LOL :P
Platform SDK huh? where would I aquire that peice of material? Actually I'll just google it, thanks for your help.
Yep, already downloaded it... thanks.
Hmm, Im not quite sure how I am supposed to layout the CBN_SELCHANGE in my code.
Should I use SendMessage ? or what, thanks for your help already guys.
Hmm, Im not quite sure how I am supposed to layout the CBN_SELCHANGE in my code.
Should I use SendMessage ? or what, thanks for your help already guys.
Windows will send you CBN_SELCHANGE as a part of WM_COMMAND.? track WM_COMMAND, filter it, and find out if it's CBN_SELCHANGE. if yes -> call CBM_GETCURSEL (or something like that. I'm writing from memory) to get current selection. When you get it - use it as you like. For example send WM_CLOSE to your own window (I think it's the most clean way for an application to terminate).
What methods are used to "track" WM_COMMAND and then "filter it"?
I Assume you _HAVE_ a window. Windows OS i event-driven - it send you notifications of events, that occur in the system (like the user selecting something different in your selection box).
Windiows will send WM_COMMAND to your WindowProcedure (simply called WindowProc or WinProc). filter it (examine the high-order word of wParam sent with WM_COMMAND). if the high-order word of wParam is equal to CBN_SELCHANGE, then it's CBN_SELCHANGE :]
it's in the PSDK:
Windiows will send WM_COMMAND to your WindowProcedure (simply called WindowProc or WinProc). filter it (examine the high-order word of wParam sent with WM_COMMAND). if the high-order word of wParam is equal to CBN_SELCHANGE, then it's CBN_SELCHANGE :]
it's in the PSDK:
CBN_SELCHANGE Notification
--------------------------------------------------------------------------------
The CBN_SELCHANGE notification message is sent when the user changes the current selection in the list box of a combo box. The user can change the selection by clicking in the list box or by using the arrow keys. The parent window of the combo box receives this notification in the form of a WM_COMMAND message with CBN_SELCHANGE in the high-order word of the wParam parameter.
Syntax
CBN_SELCHANGE
WPARAM wParam
LPARAM lParam;
Parameters
wParam
The low-order word specifies the control identifier of the combo box.
The high-order word specifies the notification message.
lParam
Handle to the combo box.
Return Value
No return value.
--------------------------------------------------------------------------------
The CBN_SELCHANGE notification message is sent when the user changes the current selection in the list box of a combo box. The user can change the selection by clicking in the list box or by using the arrow keys. The parent window of the combo box receives this notification in the form of a WM_COMMAND message with CBN_SELCHANGE in the high-order word of the wParam parameter.
Syntax
CBN_SELCHANGE
WPARAM wParam
LPARAM lParam;
Parameters
wParam
The low-order word specifies the control identifier of the combo box.
The high-order word specifies the notification message.
lParam
Handle to the combo box.
Return Value
No return value.
How do I call CBN_SELCHANGE? I'm still rather confused after reading over and over again ?
As I stated I 2 times already, you DON'T send any CBN_* as they are NOTIFICATION SENT BY WINDOWS OS to your window procedure. Read Iczelion's tutorials about window procedures, and notification messages.
I dont recall you stating DONT at all. Thanks for your help though.
Windows will send you CBN_SELCHANGE as a part of WM_COMMAND.
:-)