Click here to Skip to main content
13,044,935 members (40,819 online)
Rate this:
Please Sign up or sign in to vote.
See more:
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);

but with no success.
Posted 24-Nov-12 10:23am
amitnaik 7-Dec-12 6:16am
can u plz explain,is ur form is mdichild, is notepad application is called through ur application or separate or its embedded in any form or same form.
Also check while debugging try to get parent form in Watch and check its property parentform.TopMost = true ?
Without above answers it is difficult to get rid of issue.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170713.1 | Last Updated 25 Nov 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100