Exemplo n.º 1
0
        public SprungForm()
        {
            InitializeComponent();
            this.settings                    = new Settings();
            this.tray                        = new SystemTray(settings);
            this.windowManager               = WindowManager.GetInstance();
            this.windowMatcher               = new WindowMatcher(this.windowManager);
            this.Visible                     = false;
            this.Opacity                     = 0;
            this.ControlBox                  = false;
            this.FormBorderStyle             = FormBorderStyle.None;
            this.ShowInTaskbar               = false;
            this.mainWindow                  = new Window(Handle);
            this.Deactivate                 += DeactivateCallback;
            this.KeyPreview                  = true;
            this.KeyDown                    += GlobalKeyDown;
            this.windowListBox.Sprung        = this;
            this.windowListBox.ShowScrollbar = false;
            this.windowLastUsageComparer     = new WindowLastUsageComparer();
            this.searchBox.TextChanged      += new System.EventHandler(this.InputChangedCallback);
            this.searchBox.KeyDown          += new System.Windows.Forms.KeyEventHandler(this.SearchBoxKeyDown);
            this.searchBox.KeyPress         += new System.Windows.Forms.KeyPressEventHandler(this.SearchBoxKeyPress);

            closedWindowHandles = new ConcurrentDictionary <IntPtr, bool>();

            windowMessageNotifyShellHook = RegisterWindowMessage("SHELLHOOK");
            RegisterShellHookWindow(Handle);

            handleActivatedWindowEventDelegate = new WinEventDelegate(HandleActivatedWindowEvent);
            IntPtr m_hhook = SetWinEventHook(EVENT_SYSTEM_FOREGROUND, EVENT_SYSTEM_FOREGROUND, IntPtr.Zero, handleActivatedWindowEventDelegate, 0, 0, WINEVENT_OUTOFCONTEXT);
        }
Exemplo n.º 2
0
 public Sprung()
 {
     InitializeComponent();
     this.settings = new Settings();
     this.tray = new SystemTray(settings);
     this.windowManager = new WindowManager(settings);
     this.windowMatcher = new WindowMatcher(this.windowManager);
     this.Visible = false;
     this.Opacity = 0;
     this.ControlBox = false;
     this.ShowInTaskbar = false;
     this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
     this.mainWindow = new Window(this.Handle);
     this.Deactivate += DeactivateCallback;
     this.KeyPreview = true;
     this.KeyDown += GlobalKeyDown;
 }
Exemplo n.º 3
0
 public Sprung()
 {
     InitializeComponent();
     this.settings        = new Settings();
     this.tray            = new SystemTray(settings);
     this.windowManager   = new WindowManager(settings);
     this.windowMatcher   = new WindowMatcher(this.windowManager);
     this.Visible         = false;
     this.Opacity         = 0;
     this.ControlBox      = false;
     this.ShowInTaskbar   = false;
     this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
     this.mainWindow      = new Window(this.Handle);
     this.Deactivate     += DeactivateCallback;
     this.KeyPreview      = true;
     this.KeyDown        += GlobalKeyDown;
 }