RE: [GD-Windows] Dialog doesn't move
Brought to you by:
vexxed72
From: Andrew G. <ag...@cl...> - 2006-04-28 08:23:52
|
> The documentation for IsDialogMessage() claims that a message should not > be further processed (translate/dispatch) if IsDialogMessage() returns TRUE. Just to be clear, I'm pretty sure you need to ignore all non-zero return values not just those that return TRUE. E.g. while (dlg->Running() && GetMessage(&msg,NULL,0,0)) { if (!IsDialogMessage(dlg->Handle(), &msg)) { TranslateMessage(&msg); DispatchMessage(&msg); } } Make sure it's the dialog handle you're passing in,not your main window. Obvious I know, but that sort of thing has bitten me before. My understanding is that the only use of IsDialogMessage() is to handle keyboard navigation between items so you should be safe to omit this call altogether if you don't need that functionality. And finally, as always make sure you're pumping the message queue from the correct thread, in this case the one that called CreateDialog. A. > -----Original Message----- > From: gam...@li... [mailto:gamedevlists- > win...@li...] On Behalf Of Jon Watte > Sent: Friday, April 28, 2006 12:17 AM > To: gam...@li... > Subject: [GD-Windows] Dialog doesn't move > > I'm creating a dialog using CreateDialog() and running it as a modeless > dialog. > > The documentation for IsDialogMessage() claims that a message should not > be further processed (translate/dispatch) if IsDialogMessage() returns TRUE. > > However, I have found that the dialog will lock up if you click in the > title bar of it, unless you actually let some kinds of messages through > to translate/dispatch even though IsDialogMessage() returns TRUE: > > case WM_NCLBUTTONDOWN: > case WM_NCMOUSEMOVE: > case WM_NCLBUTTONUP: > case WM_LBUTTONUP: > case WM_MOUSEMOVE: > > This doesn't appear to be documented behavior, but seems to work OK. > Does anyone know if this is the appropriate thing to do? Are there other > messages I should let through to translate/dispatch as well? > > (My dialog proc returns FALSE for pretty much everything except > WM_COMMAND, WM_INITDIALOG and WM_DESTROY). > > Cheers, > > / h+ > > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=555 |