internal AppInfo(IntPtr hwnd, string appId, string instanceId, string workspaceId = null)
        {
            _hwnd      = hwnd;
            BrowserPid = (int)Win32Api.GetWindowProcessId(_hwnd);
            WindowPropertyStore.SetAppId(hwnd, appId);

            AppInstanceId = instanceId;
            _workspaceId  = workspaceId;
            var props = new AppWindowProperties {
                AppInstanceId = instanceId, WorkspaceId = workspaceId
            };

            WindowPropertyStore.SetComment(hwnd, props.ToString());
        }
Esempio n. 2
0
        public static void RegisterAppWindow(IntPtr hwnd, string appId, string processGroup, string instanceId)
        {
            if (!WindowsVersion.IsWin7OrNewer)
            {
                return;
            }

            var props = new AppWindowProperties {
                AppInstanceId = instanceId
            };

            WindowPropertyStore.SetComment(hwnd, props.ToString());
            WindowPropertyStore.SetAppId(hwnd, string.IsNullOrEmpty(processGroup) ? appId : processGroup);
            WindowPropertyStore.PreventTaskbarPinning(hwnd);
        }