mirror of
https://github.com/mirror/processhacker
synced 2026-06-08 16:03:24 +00:00
fix for the unhandled exceptions resulting from the previous fix
git-svn-id: svn://svn.code.sf.net/p/processhacker/code@793 21ef857c-d57f-4fe0-8362-d861dc6d29cd
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user