Doesn't ListView_InsertColumn work while handling WM_INITDIALOG?
I called ListView_InsertColumn to insert some columns to a listview while handling the WM_INITDIALOG message, but I couldn't see any columns in the listview, though the return value of ListView_InsertColumn was not -1.
However, it did work if I called that function while handling a button-clicked message.
Why? If that's the case, how can I initialize the listview?
I'm using Visual Studio 2010
It turns out that it's my oversight. During WM_INITDIALOG, I tried to use the global handle variable gDlg to get the handle of the listview. But the value of gDlg was only assigned by the return value of CreateDialog. I didn't know that WM_INITDIALOG actually occurs before CreateDialog returns;