case CBN_SELCHANGE: { int idx_row; char strText[255] = { 0 }; idx_row = SendMessage(hComboBox, CB_GETCURSEL, 0, 0); SendMessage(hComboBox, CB_GETLBTEXT, idx_row, (LPARAM)strText);//парсим строку ΠΈΠ· комбобокса Ρ‚ΠΈΠΏΠ° ".exe" int index = SendMessage(hwndList1, LB_FINDSTRING, (WPARAM)(-1), (LPARAM)(strText));//индСкс строки с Π΄Π°Π½Π½Ρ‹ΠΌ Ρ€Π°ΡΡˆΠΈΡ€Π΅Π½ΠΈΠ΅ΠΌ do { SendMessage(hwndList1, LB_SETSEL, TRUE, (LPARAM)index);//выдСляСм строки листбокса } while (SendMessage(hwndList1, LB_SETSEL, TRUE, (LPARAM)index) != LB_ERR); break; } 

An extension of type β€œ.exe” is placed in strText, and in the list box there is a list of file names. I can’t select all the files with the selected extension ...

  • in the combobox type strings ".txt", and in the listbox may be a file "asd.exe" or "dasdasd.txt". - Alexander
  • What does "not work" mean? Why do ... while here do ... while ? - VTT
  • @VTT, well, I need to select all the lines where, for example, there is an ".exe" substring, so I set do while. - Alexander
  • So in the loop, SendMessage is called with the same parameters. - VTT
  • @VTT, oh, the index in the loop was, therefore, the index of the selected element was changed. - Alexander

0