|
-
January 17th, 2007, 01:23 AM
#1
[RESOLVED] Getting the Combo Box selected item.
Hello All,
I am adding values 0,1,3 to a combo box in Initdialog
switch(Message)
{
case WM_INITDIALOG:
{
HWND hwndCombo = GetDlgItem(hwnd, IDC_CB);
SendMessage(hwndCombo , CB_ADDSTRING,0, (LPARAM) "0");
SendMessage(hwndCombo , CB_ADDSTRING,0, (LPARAM) "1");
SendMessage(hwndCombo , CB_ADDSTRING,0, (LPARAM) "2");
}
in other function I want to use the value of the combo box, (user selected item) for that I am using below code
int F;
HWND HCBF = GetDlgItem(hwnd, IDC_CB);
SendMessage(HCBF , CB_GETITEMDATA,(WPARAM)F, 0);
This code has no error but I am getting some junk value and i am not geting the values 0,1,2
Can u please tell me what is the error in the above code ???
Thanking you,
Suresh HC.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|