Ejemplo n.º 1
0
        public static bool TryParse(string value, out AppWindowProperties props)
        {
            props = default(AppWindowProperties);
            if (string.IsNullOrEmpty(value) ||
                !value.StartsWith(Prefix))
            {
                return(false);
            }

            props = StructConverter.FromString <AppWindowProperties>(value.Substring(8));
            return(true);
        }
        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());
        }
Ejemplo n.º 3
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);
        }
Ejemplo n.º 4
0
        internal WindowInfo(IntPtr hwnd)
        {
            Hwnd = hwnd;

            string comment;

            if (WindowPropertyStore.GetComment(hwnd, out comment))
            {
                AppWindowProperties props;
                IsParagonWindow = AppWindowProperties.TryParse(comment, out props);
                if (IsParagonWindow)
                {
                    AppInstanceId = props.AppInstanceId;

                    string appId;
                    if (WindowPropertyStore.GetAppId(hwnd, out appId))
                    {
                        AppId = appId;
                    }
                }
            }
        }
        internal AppInfo(IntPtr hwnd)
        {
            _hwnd      = hwnd;
            BrowserPid = (int)Win32Api.GetWindowProcessId(_hwnd);

            string comment;

            if (WindowPropertyStore.GetComment(hwnd, out comment))
            {
                AppWindowProperties props;
                if (AppWindowProperties.TryParse(comment, out props))
                {
                    AppInstanceId = props.AppInstanceId;
                    _workspaceId  = props.WorkspaceId;

                    string appId;
                    if (WindowPropertyStore.GetAppId(_hwnd, out appId))
                    {
                        AppId = appId;
                    }
                }
            }
        }