public void BeginHiding() { while (!Hide.exit) { for (int i = 0; i < titles.Count; ++i) { titles[i] = Tuple.Create(titles[i].Item1, 0); var results = WindowFuncs.TitleOccurences(titles[i].Item1); if (results.Count > 0) { foreach (IntPtr hWnd in results) { switch (traymgr.GetHideMode()) { case HideMode.VISIBLE: WindowFuncs.ShowWindow(hWnd); break; case HideMode.MINIMIZED: WindowFuncs.MinimizeWindow(hWnd); break; case HideMode.HIDDEN: WindowFuncs.HideWindow(hWnd); break; } } } } Thread.Sleep(500); } }
static void Main() { if (WindowFuncs.AlreadyOpen()) { return; } WindowFuncs.HideWindow(hWnd); tray = new TrayMgr(); var trayThread = new Thread(tray.StartTray); trayThread.Start(); hider = new WindowHider(tray); var windowThread = new Thread(hider.BeginHiding); windowThread.Start(); windowThread.Join(); trayThread.Join(); }
private void togglehide_click(System.Object sender, System.EventArgs e) { WindowFuncs.ToggleVisibility(Hide.hWnd); }