I have a desktop application (non metro). I need to get the user back to my application Desktop in some emergency situations (could mean life or death). How do I get focus back onto my application if the user is in a metro style application?
Found this great sample code on MSDN.
It checks to see if the windows 8 start screen is visible or not. Check it out.
PCWSTR const _GetMonitorAppVisibilityString(MONITOR_APP_VISIBILITY monitorAppVisibility)
{
PCWSTR pszAppVisibilityString = nullptr;
switch (monitorAppVisibility)
{
case MAV_NO_APP_VISIBLE:
pszAppVisibilityString = L"no apps visible";
break;
case MAV_APP_VISIBLE:
pszAppVisibilityString = L"a visible app";
break;
case MAV_UNKNOWN:
__fallthrough;
default:
pszAppVisibilityString = L"unknown";
break;
}
return pszAppVisibilityString;
}
Follow this link to download the full sample c++ code (Visual C++ 2012/13): http://code.msdn.microsoft.com/windowsdesktop/Start-screen-visibility-b1a72059
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With