Quantcast
Channel: CodeGuru Forums - Visual C++ Programming
Viewing all articles
Browse latest Browse all 3027

How to determine if a Metro app is currently displayed on the screen?

$
0
0
I'm trying to determine (from my Win32 process) if a Metro (or a Modern UI) app is currently displayed on the screen. I found the IAppVisibility::GetAppVisibilityOnMonitor method that can do just that, and I even found a C++ sample, but my issue is that I'm compiling it with the Visual Studio 2008 that does not have the definitions for the IAppVisibility interface, so the following:

Code:

#include <Shobjidl.h>  //Earlier version

IAppVisibility* pAppVis = NULL;
HRESULT hr = CoCreateInstance(CLSID_AppVisibility, NULL, CLSCTX_INPROC_SERVER,
                      IID_IAppVisibility, (void**) &pAppVis);

Results in a set of errors:

Code:

error C2065: 'IAppVisibility' : undeclared identifier
error C2065: 'IID_IAppVisibility' : undeclared identifier

Any idea how to define them?

Viewing all articles
Browse latest Browse all 3027

Latest Images

Trending Articles



Latest Images