internal WindowInfoEventArgs(WindowInfo window)
 {
     this.Window = window;
     this.State = window.CanShow ? WindowStates.Hidden : WindowStates.Normal;
     if (window.IsPasswordProtected)
         this.State |= WindowStates.Protected;
     if (window.IsPinned)
         this.State |= WindowStates.Pinned;
 }
        internal static void ShowWindow(WindowInfo window)
        {
            IntPtr style1 = GetWindowLongPtr(window.Handle, GwlStyle);

            ShowWindow(window.Handle, (int) ShowWindowCommands.ShowNA);

            // show the window for the new style to
            SetWindowLongPtr(window.Handle, GwlStyle,
                new IntPtr(window.OriginalState)); // set the style
            ShowWindow(window.Handle, (int) ShowWindowCommands.Hide);

            // show the window for the new style to
            ShowWindow(window.Handle, (int) ShowWindowCommands.ShowNA);

            // show the window for the new style to
            window.OriginalState = 0;
        }
        internal static bool HideWindow(WindowInfo window)
        {
            window.OriginalState =
                GetWindowLongPtr(window.Handle, GwlStyle).ToInt64();

            long style = window.GetOriginalStateStyle();

            ShowWindow(window.Handle, (int) ShowWindowCommands.Hide); // hide the window
            SetWindowLongPtr(window.Handle, GwlStyle, new IntPtr(style));
            ShowWindow(window.Handle, (int) ShowWindowCommands.ShowNA);

            // show the window for the new style to
            bool returnValue = ShowWindow(window.Handle, (int) ShowWindowCommands.Hide);
            if (!returnValue)
                ShowWindow(window);

            return returnValue;
        }
 public WindowListViewItem(WindowInfo window)
 {
     this.Text = window.Title;
     this.Name = window.Key;
     this.ImageKey = window.Key;
     this.SubItems.Add(new ListViewSubItem(this, window.IsPasswordProtected ? "Yes" : "No")
     {
         Tag = window.IsPasswordProtected,
         Name = "IsPasswordProtected"
     });
     this.SubItems.Add(new ListViewSubItem(this, window.IsPinned ? "Yes" : "No")
     {
         Tag = window.IsPinned,
         Name = "IsPinned"
     });
     this.SubItems.Add(new ListViewSubItem
     {
         Text = window.ApplicationPathName,
         Name = "ApplicationPathName"
     });
     this.windowHandle = window.Handle;
     this.Tag = window.Handle;
 }
Esempio n. 5
0
 private bool UnlockWindow(WindowInfo window)
 {
     using (UnlockForm password = new UnlockForm(window.Title))
         return (password.ShowDialog(this) == DialogResult.OK && password.PasswordMatched);
 }
Esempio n. 6
0
 private void SetWindowImageList(WindowInfo window, bool forceUpdate)
 {
     string key = window.Key;
     Bitmap image = window.ApplicationIcon.ToBitmap();
     if (forceUpdate)
     {
         if (this.imageListSmall.Images.ContainsKey(key))
             this.imageListSmall.Images.RemoveByKey(key);
         if (this.imageListBig.Images.ContainsKey(key))
             this.imageListBig.Images.RemoveByKey(key);
     }
     if (forceUpdate || !this.imageListSmall.Images.ContainsKey(key))
         this.imageListSmall.Images.Add(key, image);
     if (forceUpdate || !this.imageListBig.Images.ContainsKey(key))
         this.imageListBig.Images.Add(key, image);
 }
 public static void SetWindowIcon(this WindowInfo window, Icon icon)
 {
     NativeMethods.SendMessage(window.Handle, NativeMethods.WindowsMessageSetIcon, NativeMethods.WindowSmallIcon, icon.Handle);
     NativeMethods.SendMessage(window.Handle, NativeMethods.WindowsMessageSetIcon, NativeMethods.WindowLargeIcon, icon.Handle);
 }
 public static void SetWindowText(this WindowInfo window, string prefix, string suffix)
 {
     NativeMethods.SetWindowText(window.Handle,
                                 string.Format("{0}{2}{1}", prefix, suffix, window.OriginalTitle));
 }
 public static void SetWindowText(this WindowInfo window, string text)
 {
     NativeMethods.SetWindowText(window.Handle, text);
 }
 public static void RestoreWindowText(this WindowInfo window)
 {
     NativeMethods.SetWindowText(window.Handle, window.OriginalTitle);
 }
 internal static Process GetWindowProcess(WindowInfo window)
 {
     return(NativeMethods.GetWindowProcess(window.Handle));
 }
Esempio n. 12
0
 public WindowsStoreItem this[WindowInfo window]
 {
     get { return(this[window.Handle]); }
 }