IE7 protected mode hWnd problem

hello,
i'm trying to get the hWnd of a IWebBrowser2 control.
if i'm working on xp, everything is ok.
but with Vista - things different. hWnd returned is not valid. (IsWindow - fails)
any ideas why?
How can i solve this?
[249 byte] By [infrared] at [2007-11-20 1:38:18]
# 1 Re: IE7 protected mode hWnd problem
Can you post the code you are using to get that handle, also have you tried using spy++ on vista to see if the class name of web browser window is same as XP ?
Krishnaa at 2007-11-10 23:17:44 >
# 2 Re: IE7 protected mode hWnd problem
the code is very simple:

CComPtr <IWebBrowser> web;

web->CoCreateInstance(...);
web->Navigate(...);
HWND hWnd = web->getHWND();

it's from my memory, so it may be unacurate, but that's the way.

this code has nothing to do with window class name, but i checked with spy++, and the result of getHwnd is not found (if protected mode is off, hWnd is found in spy++...)
infrared at 2007-11-10 23:18:51 >
# 3 Re: IE7 protected mode hWnd problem
Any one?
Help needed...
infrared at 2007-11-10 23:19:49 >
# 4 Re: IE7 protected mode hWnd problem
have a look on this article may be this one help you.

http://www.dev-archive.com/cpp/i-n/internet/browsercontrol/article.php/c6175/

Thanx
humptydumpty at 2007-11-10 23:20:49 >
# 5 Re: IE7 protected mode hWnd problem
Vista betas ship with IE7 , right ? Wondering if this is a IE7 thingy. Have you tried the same with IE7 on XP ?
kirants at 2007-11-10 23:21:48 >
# 6 Re: IE7 protected mode hWnd problem
Aparently there are changes with accessing window handle etc. in protected mode, here is more information.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ietechcol/dnwebgen/protectedmode.asp
Krishnaa at 2007-11-10 23:22:53 >
# 7 Re: IE7 protected mode hWnd problem
Vista betas ship with IE7 , right ? Wondering if this is a IE7 thingy. Have you tried the same with IE7 on XP ?
In XP there is no problem, because there is no Protected mode of IE7.

Aparently there are changes with accessing window handle etc. in protected mode, here is more information.

http://msdn.microsoft.com/library/d...otectedmode.asp

I already read it. nothing about my problem...

I can make a workaround if i'll be able to start the CoCreateInstance function as a Low Integrity (Protected Mode).. like the function CreateProcessAsUser. Does anybody knows something about it?

Thanks.
infrared at 2007-11-10 23:23:57 >