Click here to Skip to main content
Rate this: bad
good
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);
 
BringWindowToTop(GetParentHandle(windowClicked));
but with no success.
Posted 24-Nov-12 11:23am
Edited 24-Nov-12 20:27pm
(no name)114.1K
v2
Comments
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 OriginalGriff 304
1 Sergey Alexandrovich Kryukov 255
2 Shweta N Mishra 216
3 Maciej Los 210
4 PIEBALDconsult 184
0 OriginalGriff 7,660
1 Sergey Alexandrovich Kryukov 7,072
2 DamithSL 5,586
3 Manas Bhardwaj 4,946
4 Maciej Los 4,665


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