RE: [GD-Windows] WM_KILLFOCUS
Brought to you by:
vexxed72
From: Daniel V. <vo...@ep...> - 2001-12-11 18:42:42
|
Thanks! Shows how little I know about Windows programming :) -- Daniel, Epic Games Inc. > -----Original Message----- > From: Brian Sharon [mailto:bs...@mi...] > Sent: Tuesday, December 11, 2001 1:19 PM > To: Daniel Vogel > Subject: RE: [GD-Windows] WM_KILLFOCUS > > > Wouldn't WM_ACTIVATE or WM_ACTIVATEAPP be a more logical place to handle > restoring gamma settings? After all, you could get WM_KILLFOCUS from > destroying a text control while your app remains in the foreground. > Your code still handles that case correctly by checking to for the > current foreground window, but using WM_ACTIVATE(APP) would probably > make things clearer to the next person who visits your code :) > > Just a thought, > > --brian > > -----Original Message----- > From: Daniel Vogel [mailto:vo...@ep...] > Sent: Monday, December 10, 2001 9:11 PM > To: Daniel Vogel; Brian Sharon; Gamedevlists-Windows@Lists. Sourceforge. > Net > Subject: RE: [GD-Windows] WM_KILLFOCUS > > I should've elaborated more what I was trying to do. My goal was to > ensure > that our engine (most importantly the Editor) restores the gamma > settings > when loosing focus which the following codesnippet does. At first I > didn't > have the GetForegroundWindow line so that's why I was wondering in which > cases wParam were NULL. > > case WM_KILLFOCUS: > { > guard(WM_KILLFOCUS); > > DWORD ProcID; > HWND hWnd = wParam ? (HWND) wParam : ::GetForegroundWindow(); > > GetWindowThreadProcessId(hWnd, &ProcID); > if( ProcID != GetCurrentProcessId() ) > RenDev->RestoreGamma(); > > ... > > return 0; > unguard; > } > > -- Daniel, Epic Games Inc. > > > -----Original Message----- > > From: gam...@li... > > [mailto:gam...@li...]On Behalf Of > > Daniel Vogel > > Sent: Monday, December 10, 2001 8:50 PM > > To: Brian Sharon; Gamedevlists-Windows@Lists. Sourceforge. Net > > Subject: RE: [GD-Windows] WM_KILLFOCUS > > > > > > I was manually checking whether wParam was an owned window before > > restoring > > the gamma. Looks like I could simply use GetFocus. Thanks for the link > :) > > > > -- Daniel, Epic Games Inc. > > > > > -----Original Message----- > > > From: gam...@li... > > > [mailto:gam...@li...]On Behalf > Of > > > Brian Sharon > > > Sent: Monday, December 10, 2001 8:30 PM > > > To: Daniel Vogel; Gamedevlists-Windows@Lists. Sourceforge. Net > > > Subject: RE: [GD-Windows] WM_KILLFOCUS > > > > > > > > > See http://msdn.microsoft.com/library/en-us/winui/keybinpt_5z8u.asp > > > > > > Keyboard focus is a property that's passed between the windows in > the > > > foreground thread. And if something in your app calls > SetFocus(NULL) > > > then the HWND would be NULL and your app would be ignoring keyboard > > > messages. I'm not sure what you would want to retrieve in that > case? > > > > > > --brian > > > > > > -----Original Message----- > > > From: Daniel Vogel [mailto:vo...@ep...] > > > Sent: Monday, December 10, 2001 5:18 PM > > > To: Gamedevlists-Windows@Lists. Sourceforge. Net > > > Subject: [GD-Windows] WM_KILLFOCUS > > > > > > >From the MSDN docs: > > > > > > "wParam > > > Handle to the window that receives the keyboard focus. This > parameter > > > can be > > > NULL." > > > > > > In which cases is it NULL and is there a chance to retrieve the HWND > > > anyways? > > > > > > -- Daniel, Epic Games Inc. > > > > > > > > > > > > _______________________________________________ > > > Gamedevlists-windows mailing list > > > Gam...@li... > > > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > > > > > > > > > _______________________________________________ > > Gamedevlists-windows mailing list > > Gam...@li... > > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > > > |