diff --git a/trunk/ProcessHacker/Forms/HackerWindow.cs b/trunk/ProcessHacker/Forms/HackerWindow.cs index bedfcb5f2..d8adbfc78 100644 --- a/trunk/ProcessHacker/Forms/HackerWindow.cs +++ b/trunk/ProcessHacker/Forms/HackerWindow.cs @@ -2000,6 +2000,11 @@ namespace ProcessHacker // Magic number - PH uses this to detect previous instances. if (m.Msg == 0x9991) { + this.Visible = true; + + if (this.WindowState == FormWindowState.Minimized) + this.WindowState = FormWindowState.Normal; + m.Result = new IntPtr(0x1119); return; @@ -2339,13 +2344,11 @@ namespace ProcessHacker catch { } - // If it's Vista and we're elevated, we should allow certain window message to allow + // If it's Vista and we're elevated, we should allow the magic window message to allow // Allow only one instance to work. if (Program.WindowsVersion == "Vista" && Program.ElevationType == Win32.TOKEN_ELEVATION_TYPE.TokenElevationTypeFull) { - Win32.ChangeWindowMessageFilter(Win32.WindowMessage.ShowWindow, Win32.UipiFilterFlag.Add); - Win32.ChangeWindowMessageFilter(Win32.WindowMessage.SysCommand, Win32.UipiFilterFlag.Add); Win32.ChangeWindowMessageFilter((Win32.WindowMessage)0x9991, Win32.UipiFilterFlag.Add); } } diff --git a/trunk/ProcessHacker/Program.cs b/trunk/ProcessHacker/Program.cs index 65dc2938d..5c70d7fd5 100644 --- a/trunk/ProcessHacker/Program.cs +++ b/trunk/ProcessHacker/Program.cs @@ -264,8 +264,6 @@ namespace ProcessHacker if (Win32.SendMessage(hWnd, (Win32.WindowMessage)0x9991, IntPtr.Zero, IntPtr.Zero).ToInt32() == 0x1119) { - Win32.SendMessage(hWnd, Win32.WindowMessage.SysCommand, new IntPtr(0xf120), IntPtr.Zero); - Win32.SendMessage(hWnd, Win32.WindowMessage.ShowWindow, IntPtr.Zero, IntPtr.Zero); Win32.SetForegroundWindow(hWnd); found = true; return false;