I have a listbox that I just made, and I enumerated it with some values just to test it out. When the WM_COMMAND message occurs, I check if the listbox sent it, and then check if the LBN_SELCHANGE message has occured. Through testing, I have found that it does get whether the listbox sent the message, but it isn't detecting the LBN_SELCHANGE message has occured. Here is the portion of code that isn't working properly from within the WndProc.
Code:
case WM_CREATE:
{
HWND list = CreateWindowEx(0, "Listbox", "", WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL,
0, 0, 50, 100, hwnd, (HMENU)EXTENSION_LIST,
GetModuleHandle(NULL), NULL);
SendMessage(list,(UINT)WM_SETFONT,(WPARAM)GetStockObject(DEFAULT_GUI_FONT),(LPARAM)MAKELPARAM(FALSE,0));
for (int i=0;i<20;i++)
{
char buf[100];
itoa(i, buf, 10);
SendMessage(list,(UINT)LB_ADDSTRING,(WPARAM)0,(LPARAM)buf);
}
}
break;
case WM_COMMAND:
switch(LOWORD(wParam))
{
case UPDATE_REGISTRY:
updateRegistry();
break;
case EXTENSION_LIST:
switch(HIWORD(wParam))
{
case LBN_SELCHANGE:
MessageBox(NULL, "A Selection Was Chosen", "Chosen", MB_OK | MB_ICONEXCLAMATION);
break;
}
break;
}
break;
Any ideas why I'm not catching the LBN_SELCHANGE message??? Thanks in advance.