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.
Posted on 2005-06-17 00:07:21 by stoner[ifik]
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. ;)
Posted on 2005-06-17 00:43:50 by roticv
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.


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
Posted on 2005-06-18 13:14:19 by ti_mo_n
Platform SDK huh? where would I aquire that peice of material? Actually I'll just google it, thanks for your help.
Posted on 2005-06-18 13:30:31 by stoner[ifik]
Posted on 2005-06-18 13:55:53 by chep
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.
Posted on 2005-06-18 14:16:11 by stoner[ifik]
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).
Posted on 2005-06-18 14:26:32 by ti_mo_n
What methods are used to "track" WM_COMMAND and then "filter it"?
Posted on 2005-06-18 14:36:20 by stoner[ifik]
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:

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.
Posted on 2005-06-18 15:55:12 by ti_mo_n
How do I call CBN_SELCHANGE? I'm still rather confused after reading over and over again ?
Posted on 2005-06-18 18:22:10 by stoner[ifik]
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.
Posted on 2005-06-18 19:06:00 by ti_mo_n
I dont recall you stating DONT at all.  Thanks for your help though.
Posted on 2005-06-18 21:33:11 by stoner[ifik]

Windows will send you CBN_SELCHANGE as a part of WM_COMMAND.

:-)
Posted on 2005-06-19 07:03:19 by f0dder