Win32 ShowWindow

Started by
5 comments, last by flyorfall 15 years, 8 months ago
I have a window with several labels, which are all initially invisible. Performing some operations, I want to show one label per operation as a progress indicator. So each time I need I call: ShowWindow(GetDlgItem(hWndMyDlg, nIDLabel), SW_SHOW); But all I get is the window to get white. How can I refresh my window in a good way? Thanks
Advertisement
Did you call UpdateWindow?
I put it under the WM_INITDIALOG case within MyDlgProc, but when I put it under the default case I got my window white or not well refreshed. I don't remember if I tried to put it also under the WM_PAINT case. I'll try it. Anything else to suggest?
I put it under the WM_INITDIALOG case within MyDlgProc, but when I put it under the default case I got my window white or not well refreshed. I don't remember if I tried to put it also under the WM_PAINT case. I'll try it. Anything else to suggest?
Put it after the call to ShowWindow(). You dont have that call in the default case or WM_PAINT, right? (Hint: if you do then you're doing something you really shouldnt be doing)
To elaborate, UpdateWindow generates a WM_PAINT message for the target window. Ideally, you should simply send the message to the parent window (dialog box, main window, etc), not child control. Do not call UpdateWindow while handling WM_PAINT!
I called UpdateWindow after the ShowWindow and it worked fine.

Thanks to all.

This topic is closed to new replies.

Advertisement