Use IAppVisibility instead of deprecated IMetroMode
Here is a sample code:
Type tIAppVisibility = Type.GetTypeFromCLSID(new Guid("7E5FE3D9-985F-4908-91F9-EE19F9FD1514")); IAppVisibility appVisibility = (IAppVisibility)Activator.CreateInstance(tIAppVisibility); bool launcherVisible; if(HRESULT.S_OK == appVisibility.IsLauncherVisible(out launcherVisible)) {
IAppVisibility Interface Definition:
[ComImport, Guid("2246EA2D-CAEA-4444-A3C4-6DE827E44313"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] public interface IAppVisibility { HRESULT GetAppVisibilityOnMonitor([In] IntPtr hMonitor, [Out] out MONITOR_APP_VISIBILITY pMode); HRESULT IsLauncherVisible([Out] out bool pfVisible); HRESULT Advise([In] IAppVisibilityEvents pCallback, [Out] out int pdwCookie); HRESULT Unadvise([In] int dwCookie); }
source share