diff --git a/OnTopReplica/MainForm.Designer.cs b/OnTopReplica/MainForm.Designer.cs index 675c2c3..1c5b5fb 100644 --- a/OnTopReplica/MainForm.Designer.cs +++ b/OnTopReplica/MainForm.Designer.cs @@ -491,13 +491,13 @@ this.BackColor = System.Drawing.SystemColors.Control; this.ClientSize = new System.Drawing.Size(264, 204); this.ControlBox = false; - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Sizable; + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MaximizeBox = false; this.MinimizeBox = false; this.MinimumSize = new System.Drawing.Size(40, 40); this.Name = "MainForm"; - this.Text = "OnTopReplica"; + this.Text = Strings.ApplicationName; this.TopMost = true; this.ShowInTaskbar = true; this.menuContext.ResumeLayout(false); diff --git a/OnTopReplica/MainForm.cs b/OnTopReplica/MainForm.cs index 61750e2..adf3938 100644 --- a/OnTopReplica/MainForm.cs +++ b/OnTopReplica/MainForm.cs @@ -32,9 +32,6 @@ namespace OnTopReplica { //WinForms init pass InitializeComponent(); - KeepAspectRatio = false; - GlassEnabled = true; - GlassMargins = new Margins(-1); //Store default values DefaultNonClickTransparencyKey = this.TransparencyKey; @@ -53,9 +50,6 @@ namespace OnTopReplica { menuContext, menuWindows, menuOpacity, menuResize, menuFullscreenContext ); - //Init message pump extensions - _msgPumpManager.Initialize(this); - //Set to Key event preview this.KeyPreview = true; } @@ -78,7 +72,6 @@ namespace OnTopReplica { //Needed to hide caption, while keeping window title in task bar var parms = base.CreateParams; parms.Style &= ~0x00C00000; //WS_CAPTION - parms.Style &= 0x00040000; //WS_SIZEBOX return parms; } } @@ -86,7 +79,14 @@ namespace OnTopReplica { protected override void OnHandleCreated(EventArgs e){ base.OnHandleCreated(e); + //Window init + KeepAspectRatio = false; + GlassEnabled = true; + GlassMargins = new Margins(-1); + + //Window handlers _windowSeeker.OwnerHandle = this.Handle; + _msgPumpManager.Initialize(this); //Platform specific form initialization Program.Platform.PostHandleFormInit(this); diff --git a/OnTopReplica/Platforms/WindowsSeven.cs b/OnTopReplica/Platforms/WindowsSeven.cs index 076a7d8..be8aea5 100644 --- a/OnTopReplica/Platforms/WindowsSeven.cs +++ b/OnTopReplica/Platforms/WindowsSeven.cs @@ -16,8 +16,6 @@ namespace OnTopReplica.Platforms { DwmManager.SetWindowFlip3dPolicy(form, Flip3DPolicy.ExcludeAbove); DwmManager.SetExludeFromPeek(form, true); DwmManager.SetDisallowPeek(form, true); - - SetWindowStyle(form); } public override void HideForm(MainForm form) { @@ -33,14 +31,15 @@ namespace OnTopReplica.Platforms { form.Opacity = 1.0; form.Show(); - - SetWindowStyle(form); } - public override void OnFormStateChange(MainForm form) { - SetWindowStyle(form); - } + /*public override void OnFormStateChange(MainForm form) { + //SetWindowStyle(form); + }*/ + /// + /// Used to alter the window style. Not used anymore. + /// private void SetWindowStyle(MainForm form) { if (!form.IsFullscreen) { //This hides the app from ALT+TAB @@ -49,7 +48,7 @@ namespace OnTopReplica.Platforms { long exStyle = WindowMethods.GetWindowLong(form.Handle, WindowMethods.WindowLong.ExStyle).ToInt64(); exStyle |= (long)(WindowMethods.WindowExStyles.ToolWindow); - exStyle &= ~(long)(WindowMethods.WindowExStyles.AppWindow); + //exStyle &= ~(long)(WindowMethods.WindowExStyles.AppWindow); WindowMethods.SetWindowLong(form.Handle, WindowMethods.WindowLong.ExStyle, new IntPtr(exStyle));