Request for Question Clarification by
mmastrac-ga
on
15 Nov 2002 16:38 PST
Have you tried sending a minimize message (SC_MINIMIZE) as follows:
http://www.bcbdev.com/faqs/faq3.htm
::SendMessage(::GetForgroundWindow(), WM_SYSCOMMAND, SC_MINIMIZE, 0);
Create your window, then use this method to minimize the currently
running application.
Detecting if an app is running fullscreen is harder! You need to get
the current and registry video settings and compare them. If they are
equal, you are running on the desktop, if not, an app has changed the
video mode:
See this MSDN link:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/devcons_84oj.asp
DEVMODE dm1, dm2;
EnumDisplaySettings( NULL, ENUM_CURRENT_SETTINGS, &dm1 );
EnumDisplaySettings( NULL, ENUM_REGISTRY_SETTINGS, &dm2 );
if ( dm1.dmBitsPerPel != dm2.dmBitsPerPel
|| dm1.dmPelsWidth != dm2.dmPelsWidth
|| dm1.dmPelsHeight != dm2.dmPelsHeight
|| dm1.dmDisplayFlags != dm2.dmDisplayFlags
|| dm1.dmDisplayFrequency != dm2.dmDisplayFrequency )
{
::SendMessage(::GetForgroundWindow(), WM_SYSCOMMAND, SC_MINIMIZE,
0);
}
Please forgive my poor indentation - it's hard to paste code in here.
:)
Let me know if this works!