Click here to Skip to main content
15,886,724 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a windows form with Tabs, in each tab i have IE browsers embedded in it using `SetParent()` api.
C#
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.
C#
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.
Posted
v2
Comments
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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900