Add a call to InitCommonControlsEx at the start of your program.
: This message was edited by Psyko at 2002-11-1 9:15:43
: It is not a Listbox, it is a List Control. Also knows as List View, if you prefer.
:
: So, I make a simple Dialog in the ressource editor, there is only one button, and one List Control.
:
: Here is the code.
:
:
: #include <windows.h>
: #include "resource.h"
:
: LRESULT CALLBACK MainProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
: {
: switch(Msg)
: {
: case WM_COMMAND:
: switch(LOWORD(wParam))
: {
: case IDC_CLOSE:
: EndDialog(hWnd,0);
: return TRUE;
: default:
: return FALSE;
: }
:
: case WM_CLOSE:
: EndDialog(hWnd,0);
: return TRUE;
:
: default:
: return FALSE;
: }
: }
:
: int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
: {
: DialogBox(hInstance,(LPCTSTR)IDD_MAIN,NULL,(DLGPROC)MainProc);
: return 0;
: }
:
:
: If I run my program, it instantly closes. However, if I remove the List Control from the dialog, it does run.
:
:
:
:
:
:
: