I have a modeless dialog box with a listbox control and a static control. When the dialog box is shown initially, I have a handler in place for the WM_SHOWWINDOW message to select the first item in the listbox, and then display the appropiate text corresponding to that item in the static control.
Because the text going to the static control is of variable length and I want it centered vertically, I went ahead and get a CClientDC object for the static box and use the DrawText function to draw the text in the client area.
The problem that I have is that when the modeless window is initially displayed, the first item in the listbox is selected correctly, but no text appears in the static control. After the window is drawn, when an item is selected in the listbox drawn the text is displayed correctly.
Does anyone know what I need to do to have the text appear when the window is initially displayed?
Thanks,
Jason
Because the text going to the static control is of variable length and I want it centered vertically, I went ahead and get a CClientDC object for the static box and use the DrawText function to draw the text in the client area.
The problem that I have is that when the modeless window is initially displayed, the first item in the listbox is selected correctly, but no text appears in the static control. After the window is drawn, when an item is selected in the listbox drawn the text is displayed correctly.
Does anyone know what I need to do to have the text appear when the window is initially displayed?
Thanks,
Jason