Browse Source

AddIn: Code cleanup.

pull/1317/head
Andreas Weizel 8 years ago
parent
commit
83759eed37
  1. 4
      ILSpy.AddIn/ILSpyInstance.cs
  2. 14
      ILSpy/NativeMethods.cs

4
ILSpy.AddIn/ILSpyInstance.cs

@ -66,9 +66,6 @@ namespace ICSharpCode.ILSpy.AddIn @@ -66,9 +66,6 @@ namespace ICSharpCode.ILSpy.AddIn
do {
NativeMethods.EnumWindows(
(hWnd, lParam) => {
uint processId = NativeMethods.GetProcessIdFromWindow(hWnd);
//if (processId == ilspyProcess.Id) {
Debug.WriteLine("Found {0:x4} for process {1}", hWnd, processId);
string windowTitle = NativeMethods.GetWindowText(hWnd, 100);
if (windowTitle.StartsWith("ILSpy", StringComparison.Ordinal)) {
Debug.WriteLine("Found {0:x4}: {1}", hWnd, windowTitle);
@ -81,7 +78,6 @@ namespace ICSharpCode.ILSpy.AddIn @@ -81,7 +78,6 @@ namespace ICSharpCode.ILSpy.AddIn
return false; // stop enumeration
}
}
//}
return true; // continue enumeration
}, IntPtr.Zero);

14
ILSpy/NativeMethods.cs

@ -50,20 +50,6 @@ namespace ICSharpCode.ILSpy @@ -50,20 +50,6 @@ namespace ICSharpCode.ILSpy
[DllImport("user32.dll", CharSet = CharSet.Auto)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static extern bool SetForegroundWindow(IntPtr hWnd);
//HANDLE WINAPI GetProcessHandleFromHwnd(
// _In_ HWND hwnd
//);
[DllImport("user32.dll", CharSet = CharSet.Auto)]
[return: MarshalAs(UnmanagedType.I4)]
internal static extern uint GetWindowThreadProcessId(IntPtr hWnd, [MarshalAs(UnmanagedType.I4)] out uint processId);
public static uint GetProcessIdFromWindow(IntPtr hWnd)
{
GetWindowThreadProcessId(hWnd, out uint processId);
return processId;
}
}
[return: MarshalAs(UnmanagedType.Bool)]

Loading…
Cancel
Save