From 35f5cb15cd4c2b558147e26cef2f73b9e26495e6 Mon Sep 17 00:00:00 2001 From: Lorenz Cuno Klopfenstein Date: Tue, 22 Mar 2011 11:56:28 +0100 Subject: [PATCH] Minor fixes here and there. --- OnTopReplica/MainForm_ChildForms.cs | 4 +- OnTopReplica/Native/HookMethods.cs | 2 +- OnTopReplica/Program.cs | 5 +- .../SidePanels/GroupSwitchPanel.Designer.cs | 91 +++++++++---------- OnTopReplica/SidePanels/GroupSwitchPanel.cs | 19 ++-- OnTopReplica/SidePanels/GroupSwitchPanel.resx | 2 +- 6 files changed, 63 insertions(+), 60 deletions(-) diff --git a/OnTopReplica/MainForm_ChildForms.cs b/OnTopReplica/MainForm_ChildForms.cs index 0e43ad9..15ea7f3 100644 --- a/OnTopReplica/MainForm_ChildForms.cs +++ b/OnTopReplica/MainForm_ChildForms.cs @@ -5,6 +5,7 @@ using System.Windows.Forms; using System.Drawing; namespace OnTopReplica { + partial class MainForm { EventHandler RequestClosingHandler; @@ -74,7 +75,7 @@ namespace OnTopReplica { if (_currentSidePanel == null) return; - //Unhook listener + //Unhook listener to make panel freeable _currentSidePanel.RequestClosing -= RequestClosingHandler; //Remove side panel @@ -102,4 +103,5 @@ namespace OnTopReplica { } } + } diff --git a/OnTopReplica/Native/HookMethods.cs b/OnTopReplica/Native/HookMethods.cs index 3b6f7fc..ea24f29 100644 --- a/OnTopReplica/Native/HookMethods.cs +++ b/OnTopReplica/Native/HookMethods.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -using System.Text; using System.Runtime.InteropServices; +using System.Text; namespace OnTopReplica.Native { diff --git a/OnTopReplica/Program.cs b/OnTopReplica/Program.cs index 63715ee..9d5b098 100644 --- a/OnTopReplica/Program.cs +++ b/OnTopReplica/Program.cs @@ -65,8 +65,8 @@ namespace OnTopReplica { static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { string dump = string.Format("OnTopReplica-dump-{0}{1}{2}{3}{4}.txt", - DateTime.UtcNow.Year, DateTime.UtcNow.Month, DateTime.UtcNow.Day, - DateTime.UtcNow.Hour, DateTime.UtcNow.Minute); + DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, + DateTime.Now.Hour, DateTime.Now.Minute); string path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory), dump); using (var s = new FileStream(path, FileMode.Create)) { @@ -83,6 +83,7 @@ namespace OnTopReplica { sw.WriteLine(".NET: {0}", Environment.Version.ToString()); sw.WriteLine("Aero DWM: {0}", VistaControls.OsSupport.IsCompositionEnabled); sw.WriteLine("Launch command: {0}", Environment.CommandLine); + sw.WriteLine("UTC time: {0} {1}", DateTime.UtcNow.ToShortDateString(), DateTime.UtcNow.ToShortTimeString()); } } } diff --git a/OnTopReplica/SidePanels/GroupSwitchPanel.Designer.cs b/OnTopReplica/SidePanels/GroupSwitchPanel.Designer.cs index 248924d..542ba27 100644 --- a/OnTopReplica/SidePanels/GroupSwitchPanel.Designer.cs +++ b/OnTopReplica/SidePanels/GroupSwitchPanel.Designer.cs @@ -1,34 +1,34 @@ namespace OnTopReplica.SidePanels { partial class GroupSwitchPanel { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) { - if (disposing && (components != null)) { - components.Dispose(); - } - base.Dispose(disposing); - } + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) { + if (disposing && (components != null)) { + components.Dispose(); + } + base.Dispose(disposing); + } - #region Component Designer generated code + #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() { + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() { this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.labelStatus = new System.Windows.Forms.Label(); this.buttonCancel = new System.Windows.Forms.Button(); this.buttonEnable = new System.Windows.Forms.Button(); this.listWindows = new System.Windows.Forms.ListView(); this.colName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.labelStatus = new System.Windows.Forms.Label(); this.groupBox1.SuspendLayout(); this.SuspendLayout(); // @@ -41,19 +41,29 @@ this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill; this.groupBox1.Location = new System.Drawing.Point(0, 0); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(228, 296); - this.groupBox1.TabIndex = 0; + this.groupBox1.Size = new System.Drawing.Size(961, 592); + this.groupBox1.TabIndex = 1; this.groupBox1.TabStop = false; - this.groupBox1.Text = Strings.GroupSwitchModeTitle; + this.groupBox1.Text = "Group switch mode:"; + // + // labelStatus + // + this.labelStatus.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.labelStatus.Location = new System.Drawing.Point(3, 543); + this.labelStatus.Name = "labelStatus"; + this.labelStatus.Size = new System.Drawing.Size(952, 17); + this.labelStatus.TabIndex = 3; + this.labelStatus.TextAlign = System.Drawing.ContentAlignment.BottomRight; // // buttonCancel // this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonCancel.Location = new System.Drawing.Point(152, 267); + this.buttonCancel.Location = new System.Drawing.Point(885, 563); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Size = new System.Drawing.Size(70, 23); this.buttonCancel.TabIndex = 2; - this.buttonCancel.Text = Strings.GroupSwitchModeDisableButton; + this.buttonCancel.Text = global::OnTopReplica.Strings.GroupSwitchModeDisableButton; this.buttonCancel.UseVisualStyleBackColor = true; this.buttonCancel.Click += new System.EventHandler(this.Cancel_click); // @@ -61,11 +71,11 @@ // this.buttonEnable.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonEnable.Image = global::OnTopReplica.Properties.Resources.xiao_ok; - this.buttonEnable.Location = new System.Drawing.Point(12, 267); + this.buttonEnable.Location = new System.Drawing.Point(745, 563); this.buttonEnable.Name = "buttonEnable"; this.buttonEnable.Size = new System.Drawing.Size(134, 23); this.buttonEnable.TabIndex = 1; - this.buttonEnable.Text = Strings.GroupSwitchModeEnableButton; + this.buttonEnable.Text = global::OnTopReplica.Strings.GroupSwitchModeEnableButton; this.buttonEnable.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; this.buttonEnable.UseVisualStyleBackColor = true; this.buttonEnable.Click += new System.EventHandler(this.Enable_click); @@ -83,27 +93,16 @@ this.listWindows.LabelWrap = false; this.listWindows.Location = new System.Drawing.Point(6, 19); this.listWindows.Name = "listWindows"; - this.listWindows.Size = new System.Drawing.Size(216, 225); + this.listWindows.Size = new System.Drawing.Size(949, 521); this.listWindows.TabIndex = 0; this.listWindows.UseCompatibleStateImageBehavior = false; this.listWindows.View = System.Windows.Forms.View.Details; // // colName // - this.colName.Text = Strings.GroupSwitchModeWindows; + this.colName.Text = global::OnTopReplica.Strings.GroupSwitchModeWindows; this.colName.Width = 220; // - // labelStatus - // - this.labelStatus.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.labelStatus.Location = new System.Drawing.Point(3, 247); - this.labelStatus.Name = "labelStatus"; - this.labelStatus.Size = new System.Drawing.Size(219, 17); - this.labelStatus.TabIndex = 3; - this.labelStatus.Text = ""; - this.labelStatus.TextAlign = System.Drawing.ContentAlignment.BottomRight; - // // GroupSwitchPanel // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -111,19 +110,19 @@ this.Controls.Add(this.groupBox1); this.MinimumSize = new System.Drawing.Size(220, 220); this.Name = "GroupSwitchPanel"; - this.Size = new System.Drawing.Size(228, 296); + this.Size = new System.Drawing.Size(961, 592); this.groupBox1.ResumeLayout(false); this.ResumeLayout(false); - } + } - #endregion + #endregion private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.Label labelStatus; private System.Windows.Forms.Button buttonCancel; private System.Windows.Forms.Button buttonEnable; private System.Windows.Forms.ListView listWindows; private System.Windows.Forms.ColumnHeader colName; - private System.Windows.Forms.Label labelStatus; - } + } } diff --git a/OnTopReplica/SidePanels/GroupSwitchPanel.cs b/OnTopReplica/SidePanels/GroupSwitchPanel.cs index be82b0f..8617981 100644 --- a/OnTopReplica/SidePanels/GroupSwitchPanel.cs +++ b/OnTopReplica/SidePanels/GroupSwitchPanel.cs @@ -1,17 +1,14 @@ using System; -using System.Drawing; -using System.Windows.Forms; -using OnTopReplica.Properties; using System.Collections.Generic; +using System.Windows.Forms; using OnTopReplica.MessagePumpProcessors; using OnTopReplica.WindowSeekers; namespace OnTopReplica.SidePanels { - partial class GroupSwitchPanel : SidePanel { - + partial class GroupSwitchPanel : SidePanel { public GroupSwitchPanel() { - InitializeComponent(); - } + InitializeComponent(); + } public override void OnFirstShown(MainForm form) { base.OnFirstShown(form); @@ -24,7 +21,9 @@ namespace OnTopReplica.SidePanels { } private void LoadWindowList() { - var manager = new TaskWindowSeeker(); + var manager = new TaskWindowSeeker { + SkipNotVisibleWindows = true + }; manager.Refresh(); var imageList = new ImageList(); @@ -52,6 +51,7 @@ namespace OnTopReplica.SidePanels { foreach (ListViewItem i in listWindows.SelectedItems) { ret.Add((WindowHandle)i.Tag); } + form.SetThumbnailGroup(ret); } else { @@ -70,5 +70,6 @@ namespace OnTopReplica.SidePanels { OnRequestClosing(); } - } + } + } diff --git a/OnTopReplica/SidePanels/GroupSwitchPanel.resx b/OnTopReplica/SidePanels/GroupSwitchPanel.resx index ff31a6d..5ea0895 100644 --- a/OnTopReplica/SidePanels/GroupSwitchPanel.resx +++ b/OnTopReplica/SidePanels/GroupSwitchPanel.resx @@ -1,4 +1,4 @@ - +