How to use ShellWindows class in IE's Protected Mode?
-
Wednesday, October 12, 2011 7:58 AM
shellWindows = new SHDocVw.ShellWindowsClass(); int handle = 0; handle = GetForegroundWindow(); foreach (SHDocVw.WebBrowser ie in shellWindows) { //find the instance if (ie.HWND == handle) { doc = ie.Document as mshtml.HTMLDocument; if (doc.hasFocus()) { break; } } }The code above (for getting current active tab/windows) works fine with IE's protected mode is OFF.
Please help me if I can bypass the Protected Mode or use an alternative class to deal with it.
Thanks in advandce.
All Replies
-
Tuesday, October 18, 2011 9:24 AMModerator
Hi Mai,
Based on this security features
User Interface Privilege Isolation (UIPI) prevents processes from sending selected window messages and other USER APIs to processes running with higher integrity.
In this Understanding and Working in Protected Mode Internet Explorer document, we can see that in the project mode, we cannot access the handle of other application in other processes. Therefore, I think you cannot bypass the protected mode.
I hope these information can help you to solve this problem.
Best regards,
Jesse
Jesse Jiang [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

- Proposed As Answer by Jesse JiangMicrosoft Contingent Staff, Moderator Wednesday, October 19, 2011 7:33 AM
- Marked As Answer by Jesse JiangMicrosoft Contingent Staff, Moderator Thursday, October 20, 2011 7:10 AM
-
Thursday, October 20, 2011 7:11 AMModerator
Hi Mail,
I marked my reply as answer, if your issue have not been solved please unmark it and update more information about this issue.
Best regards,
Jesse
Jesse Jiang [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

- Marked As Answer by Mai Khanh Friday, October 21, 2011 3:36 AM


