[comp.windows.ms.programmer] Trouble generating WM_PAINT

dsb@mbunix.mitre.org (06/21/91)

I have some code which does some graphics initialization to a dialog box.

IDM_TEST :
        hWndDlg = CreateDialog(hInst,"Test",hWnd,lpProcTest);
        SetFocus(hWnd);    /* access system menus */
        break;

WM_INITDIALOG :
...      /* move the window */
...      /* load some graphics here */
         return (TRUE);

This all works fine if use the mouse to generate IDM_TEST. If I use the
accelerator to generate IDM_TEST everything works fine except the graphics
aren't displayed. I used spy to figure out that WM_PAINT is not being generated
when I use the accelerator. I am guessing that the mouse shows and hides the
menu pop-up which generates the WM_PAINT. Using the accelerator bypassses this
mechanism. I have tried

   InvalidateRect(hWndDlg,NULL,TRUE);
   UpdateWindow(hWndDlg); 

These do not seem to generate anything. Does anyone have any clues ??

Thanks in advance.
Scott

Scott Blodgett			             The MITRE Corporation
dsb@mbunix.mitre.org 	        Communications Control Engineering
Burlington Road, M/S G220	    Bedford, MA 01730
(617) 271 - 8740       
RMake it in Massachusetts, Spend it in New HampshireS