I am working on one project in win32 API. Here, I want the user to type a text in a search bar and the first corresponding words should pop-up. When the user is done with the typing or selects the word, clicking on the 'Process' button should display another message box.
I want each word to display a different message box when the user clicks on the 'Process' button. Implying that, the application must be able to store data such that it can be retrieved. So far, I have this code which can store data and be retrieved.
HWND hWndComboBox = CreateWindow (TEXT("COMBOBOX"), TEXT (""),
CBS_DROPDOWN| CBS_HASSTRINGS | WS_VSCROLL| WS_VISIBLE |WS_CHILD ,
100, 20, 200, 70,
hwnd ,(HMENU) NULL, NULL, NULL);
CreateWindow (TEXT("BUTTON"), TEXT ("Process "),
WS_VISIBLE | WS_CHILD ,
200, 100, 70, 20,
hwnd,(HMENU) NULL, NULL, NULL);
SendMessage (
hWndComboBox ,
(UINT) CB_ADDSTRING,
(WPARAM) 0, (LPARAM) TEXT ("Apple"));
SendMessage (
hWndComboBox ,
(UINT) CB_ADDSTRING,
(WPARAM) 0, (LPARAM) TEXT ("Apple juice"));
SendMessage (hWndComboBox , CB_GETCURSEL , (WPARAM) 0, (LPARAM) 0);
Here, what I cannot do is that there is no default word like "Search Fruits" which clears when the user begins to type. Moreover, when the user selects 'Apple' and clicks on the 'Process' button, no dialog box is displayed. I do not know how to call the message box to respond depending on the user inputs. And also, the small search icon on the right of the search box.
Please what should I do? I am using win32 API Code:Blocks. Any further question for clarification is welcome. Any link or answer is most welcome. Thank you all.
What I have tried:
I have searched Google for solutions but to no avail. I have setup some codes myself too.