I require my MFC SDI application to start up inactive. It's an on-screen keyboard.
In straight Win32 it is trivial to do by simply calling ShowWindow( hWnd, SW_SHOWNA );
This does not work in MFC. I've tried various things:
Overriding OnActivate()
, OnActivateApp()
, OnCreate()
, PreCreateWindow()
of CMainFrame
.
I've also tried an override of LoadWindowPlacement()
in my app class.
Also tried things like:
AllowSetForegroundWindow( ASFW_ANY );
::SetForegroundWindow(::GetNextWindow(::GetDesktopWindow(), GW_HWNDPREV ));
No luck.