Skip to content

Commit 165e5bf

Browse files
committed
Removed WM_ACTIVATEAPP handler from RubberduckHooks
1 parent c534f26 commit 165e5bf

File tree

1 file changed

+2
-35
lines changed

1 file changed

+2
-35
lines changed

RetailCoder.VBE/Common/RubberduckHooks.cs

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -216,18 +216,9 @@ private IntPtr WindowProc(IntPtr hWnd, uint uMsg, IntPtr wParam, IntPtr lParam)
216216
try
217217
{
218218
var suppress = false;
219-
if (hWnd == _mainWindowHandle)
219+
if (hWnd == _mainWindowHandle && (WM)uMsg == WM.HOTKEY)
220220
{
221-
switch ((WM)uMsg)
222-
{
223-
case WM.HOTKEY:
224-
suppress = HandleHotkeyMessage(wParam);
225-
break;
226-
227-
case WM.ACTIVATEAPP:
228-
HandleActivateAppMessage(wParam);
229-
break;
230-
}
221+
suppress = HandleHotkeyMessage(wParam);
231222
}
232223

233224
return suppress
@@ -263,29 +254,5 @@ private bool HandleHotkeyMessage(IntPtr wParam)
263254
}
264255
return processed;
265256
}
266-
267-
private void HandleActivateAppMessage(IntPtr wParam)
268-
{
269-
const int WA_INACTIVE = 0;
270-
const int WA_ACTIVE = 1;
271-
const int WA_CLICKACTIVE = 2;
272-
273-
switch (LoWord(wParam))
274-
{
275-
case WA_ACTIVE:
276-
case WA_CLICKACTIVE:
277-
Attach();
278-
break;
279-
280-
case WA_INACTIVE:
281-
Detach();
282-
break;
283-
}
284-
}
285-
286-
private static int LoWord(IntPtr dw)
287-
{
288-
return unchecked((short)(uint)dw);
289-
}
290257
}
291258
}

0 commit comments

Comments
 (0)