diff --git a/modules/juce_gui_basics/native/juce_win32_Windowing.cpp b/modules/juce_gui_basics/native/juce_win32_Windowing.cpp index abaac3e860..ccee54bc97 100644 --- a/modules/juce_gui_basics/native/juce_win32_Windowing.cpp +++ b/modules/juce_gui_basics/native/juce_win32_Windowing.cpp @@ -3245,17 +3245,10 @@ bool JUCE_CALLTYPE Process::isForegroundProcess() if (fg == 0) return true; - // when running as a plugin in IE8, the browser UI runs in a different process to the plugin, so - // process ID isn't a reliable way to check if the foreground window belongs to us - instead, we - // have to see if any of our windows are children of the foreground window - fg = GetAncestor (fg, GA_ROOT); - - for (int i = ComponentPeer::getNumPeers(); --i >= 0;) - if (HWNDComponentPeer* const wp = dynamic_cast (ComponentPeer::getPeer (i))) - if (wp->isInside (fg)) - return true; + DWORD processID = 0; + GetWindowThreadProcessId (fg, &processID); - return false; + return (processID == GetCurrentProcessId()); } // N/A on Windows as far as I know.