Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!think.com!linus!linus!news From: dsb@mbunix.mitre.org Newsgroups: comp.windows.ms.programmer Subject: Trouble generating WM_PAINT Message-ID: <1991Jun21.104750.29085@linus.mitre.org> Date: 21 Jun 91 10:47:50 GMT Sender: news@linus.mitre.org (News Service) Organization: MITRE Corporation Lines: 32 Nntp-Posting-Host: blodgett.mitre.org 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