2

I have a windows form with Tabs, in each tab i have IE browsers embedded in it using SetParent() api.

SetParent((IntPtr)explorer.HWND, parent);

There is another application say notepad is on top of my form and when I click on embeded IE browser, though IE get activated but it doesn't come on top and notepad remains on top in a deactivated state.

I also tried setting forground using SetForegroundWindow((IntPtr)explorer.HWND) in side a timer that keeps track of mouse clicks. The code was executed but with no success.

I also tried.

SetWindowPos((IntPtr)explorer.HWND, HWND_NOTOPMOST, 0, 0, 0, 0, SetWindowPosFlags.IgnoreResize | SetWindowPosFlags.IgnoreMove );

SwitchToThisWindow(GetParentHandle(windowClicked), false);

BringWindowToTop(GetParentHandle(windowClicked));

but with no success.

GSerg
  • 76,472
  • 17
  • 159
  • 346
NKRB
  • 45
  • 3
  • 2
    This is something that Windows had to support to provide compatibility with Windows 3.x programs. IE most certainly is not a 3.x program. Use the WebBrowser control. – Hans Passant Nov 24 '12 at 21:06
  • I can not use WebBrowser, i need an IE object as it runs in different process which is desirable for my application. – NKRB Nov 24 '12 at 21:14
  • Its not just IE, i also have third party windows application that i need to setParent in my form. – NKRB Nov 24 '12 at 22:14

0 Answers0