Click here to Skip to main content
11,577,143 members (62,826 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C# .NET WinForm
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
Edited 24-Nov-12 19:27pm
(no name)136.8K
amitnaik at 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
0 DamithSL 155
1 Sergey Alexandrovich Kryukov 131
2 OriginalGriff 115
3 Afzaal Ahmad Zeeshan 95
4 Abhinav S 90
0 OriginalGriff 820
1 Sergey Alexandrovich Kryukov 631
2 Abhinav S 528
3 F-ES Sitecore 420
4 Suvendu Shekhar Giri 365

Advertise | Privacy | Mobile
Web04 | 2.8.150603.1 | Last Updated 25 Nov 2012
Copyright © CodeProject, 1999-2015
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