I've taken a look at Dr. Voodoo's example, but that only shows how to use int, float, and/or double. I need to know how to use char (or strings). So, can somebody tell me what to put in WM_COMMAND to check for a button push, then dipslay the text of a combo box (using GetWindowText or something else). Thanks!
You want to get the text which is assined to a certain value well first we get the index, then we get the size we create an array for it and finaly we get our text:
| CODE |
HWND combo1=GetDlgItem(hwnd, Combo1); int Combo1_item = SendMessage(combo1,CB_GETCURSEL,0,0); int Combo1_item_length = SendMessage(combo1,CB_GETLBTEXTLEN,Combo1_item,0); char text[Combo1_item_length+1]; SendMessage(combo1, CB_GETLBTEXT ,Combo1_item,(LPARAM)(LPCSTR)&text); |
I hope that was what you were asking.
I don't think that's what I want. Can you take a look at my topic about radio buttons? It has a request for an example.