RE: [GD-Windows] WM_KILLFOCUS
Brought to you by:
vexxed72
|
From: Daniel V. <vo...@ep...> - 2001-12-11 05:11:37
|
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
>
|