Skip to content

Commit f340f98

Browse files
authored
Revert "Changed ActivateWindow to send WM_MDIACTIVATE instead of simulated mo…"
1 parent fc9ca28 commit f340f98

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Rubberduck.VBEEditor/NativeMethods.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,11 @@ internal static string GetWindowTextByHwnd(IntPtr windowHandle)
8484
/// <param name="parentWindowHandle"> Handle of the parent window. </param>
8585
internal static void ActivateWindow(IntPtr windowHandle, IntPtr parentWindowHandle)
8686
{
87-
const int WM_MDIACTIVATE = 0x0222;
87+
const int WM_MOUSEACTIVATE = 0x21;
88+
const int HTCAPTION = 2;
89+
const int WM_LBUTTONDOWN = 0x201;
8890

89-
SendMessage(parentWindowHandle, WM_MDIACTIVATE, windowHandle, IntPtr.Zero);
91+
SendMessage(windowHandle, WM_MOUSEACTIVATE, parentWindowHandle, new IntPtr(HTCAPTION + WM_LBUTTONDOWN * 0x10000));
9092
}
9193

9294
internal static void EnumChildWindows(IntPtr parentWindowHandle, EnumChildWindowsDelegate callBackEnumWindows)

0 commit comments

Comments
 (0)