Hello,
I have been learning the Windows API, I do not want to include ALT stuff yet and the stuff from Windows 10 System Programming, just GUI at this point. I have written this program where I am making a ListBox, but I can’t seem to get things working correct. I created a second Window Procedure from the ListBox, I don’t believe that is exactly necessary but if there is a reason that might happen in practice, I want to know how to do that. Some of the code is from MSDN example about baseball players I think, if you have seen that. Anyway one of the messages is WM_INITDIALOG which would have been already processed by the time I change the ListBox window window procedure with SetWindowLongPtr function. So again I don’t know if it is a “normal” thing to change a window’s procedure for normal control windows that are built in. In any case it will not work with the SendMessage for LB_ADDSTRING if I leave it enabled because I don’t know how to process it in the procedure case statement. I am also unsure how to process thing when a user selected an item? I know it would need to go under WM_COMMAND and I might have to do LOWORD, HIWORD things to wParam and lParam, but I don’t know exactly? I welcome any advice and this effort is not to create a working program with a practical propose, it is only to learn Windows API GUI concepts. Feel free to add other advice to import this or learn. At some point I might get into custom made windows controls. Thank you.
https://github.com/coffeeprogrammer/HelloWinApi1/blob/first/HelloListBox1/main.cpp
I have been learning the Windows API, I do not want to include ALT stuff yet and the stuff from Windows 10 System Programming, just GUI at this point. I have written this program where I am making a ListBox, but I can’t seem to get things working correct. I created a second Window Procedure from the ListBox, I don’t believe that is exactly necessary but if there is a reason that might happen in practice, I want to know how to do that. Some of the code is from MSDN example about baseball players I think, if you have seen that. Anyway one of the messages is WM_INITDIALOG which would have been already processed by the time I change the ListBox window window procedure with SetWindowLongPtr function. So again I don’t know if it is a “normal” thing to change a window’s procedure for normal control windows that are built in. In any case it will not work with the SendMessage for LB_ADDSTRING if I leave it enabled because I don’t know how to process it in the procedure case statement. I am also unsure how to process thing when a user selected an item? I know it would need to go under WM_COMMAND and I might have to do LOWORD, HIWORD things to wParam and lParam, but I don’t know exactly? I welcome any advice and this effort is not to create a working program with a practical propose, it is only to learn Windows API GUI concepts. Feel free to add other advice to import this or learn. At some point I might get into custom made windows controls. Thank you.
https://github.com/coffeeprogrammer/HelloWinApi1/blob/first/HelloListBox1/main.cpp