Let's write it down with your own understanding. After all, this parameter does not mean that the average person can do it in a very short time. On the one hand, you can forget to flip it back in the future, on the other hand, it is easier to understand.
Getdlgitem (), the former parameter is the handle of the dialog box, followed by the ID of the item to be obtained in this dialog box, and the return value is the handle of this control, which should be easy to remember, you can use it more easily.
Combobox_addstring (). The former parameter is the control handle, and the latter parameter is the string to be added. The return value is several strings before this string is added;
Combobox_insertstring (). The former parameter is the space handle, where the intermediate parameter is added, and the latter parameter is the string to be added. The return value is several strings before this string is added;
The difference between the two is not very big, but the order in which the add operation is irregular, while the insert operation can be controlled by you, just like in insert, if the intermediate parameter is-1, the added string is in positive order, while 0 is in reverse order;
Combobox_deletestring (). The former parameter is the control handle, and the latter parameter is the index number you want to delete (a bit like the total number of parentheses in the array, also starting from scratch ), the return value is the number of strings left after deletion;
Combobox_findstring (). The former parameter is the control handle, and the intermediate parameter is located from there (which will be searched back after finding the end). The latter parameter is the string to be searched, the returned value is the index number of the string. If no index is found,-1 is returned;
Combobox_getcount (), the only parameter is the control handle, and the return value is the number of items contained in the control;
Combobox_setcursel (). The former parameter is the control handle, and the latter parameter is the index number. After execution, the control displays the string of the corresponding index number;
Combobox_getcursel (), the only parameter is the control handle, and the return value is the index number of the string displayed on the handle ';
There are many others. If you are familiar with them, you should be able to quickly master them. The main thing is to remember such a function in the application.
There are many introductions for self-query.
Click link
Just found a problem:
Int findstr = combobox_findstring (hwnd1, 0, str1); // you can check whether this information exists.
If (-1! = Findstr)
// If the message already exists, an error message will pop up and return
{
Setdlgitemtext (hwnd, idc_edit1, text (""));
MessageBox (hwnd, text ("added"), null, mb_ OK | mb_iconerror );
Return;
}
Why is there a string DD during initialization,
When I select to add the string D (the return value of int findstr is the index number of DD !!!!) The system will remind you that you have already entered the message, but the system will not prompt you that you have already entered the message when you enter DDD.
Why are the combobox_selectstring functions the same ??
Then I accidentally saw a function called combobox_findstringexact (). I'm curious:
All of a sudden there will be no problems. Right, this function is killing people. I thought it was wrong. I didn't have a deep understanding of the practical significance of the function!
Also, it is worth noting that this function is case insensitive !! That is to say, if you have already input DD and then input DD, you will be reminded to "added"
However, combobox_selectstring does not seem to find a similar combobox_selectstringexact.