views:

181

answers:

0

So far, my understanding on Protected mode Vista is:

  1. In vista ,by default any process runs in an Limited user Privileged (Protected mode).To run the exe in admin, we need run explicitely using "run as administrator".
  2. Any Process (exe) which is launched by other process should run in a same integritylevel or even lesser integrity level of the process which was used to launch the process.
  3. If you run the Appliction in Medium integrity level which launches the internet explorer, the IE will be launched in the same integrity level or even low interirty level of the application.
  4. The process running under higher integrity level can only able to communicate with the process which are running under the same integrity level or lesser level.

To work with IE which is running under protected mode in vista, we have two typical methods are :

  1. using CoCreateintance and IWebBowser.
  2. using CreateProcess and IELaunchURL.

See the MSDN link:
- http://msdn.microsoft.com/en-us/library/bb250462(VS.85).aspx

Issue:

Fundamentally Am implementing a HTML HELP for my application. what it does is When you press HELP key F1, it prepares a corresponding Help URL and Launches the internet explorer if the IE is not already in running state and then navigates to the given URL.

Have used the Method CoCreateinstance and IWebBrowser to implement the HTML Help.
The solution works fine in XP sp2, Win2003 server,.....etc but it is not working in Vista IE8.

Sample code used is:

hr = CoCreateInstance(CLSID_InternetExplorer, NULL, CLSCTX_LOCAL_SERVER, IID_IWebBrowser2, (void **)&m_pBrowser);
hr = m_pBrowser->Navigate(bstrURL, &vFlags,&vFrameName, &vPostData,&vHeaders);

/*bstrURL assigned with the URL:- [D:\Galorath\IT2-0-2\IT2-0-2\PROJECT\Help\seer-it.htm#reports_labor_detail.htm][1] ( it is local Help page) the remianing all arguments are NULL*/ hr = m_pBrowser->put_Visible(VARIANT_TRUE);

In Vista IE8, The above code gives problem in navigating to the URL.It is able to Launch the internet explorer and navigate to the URL to some extend till [D:\Galorath\IT2-0-2\IT2-0-2\PROJECT\Help\seer-it.htm] Home page of HTML Help,instead of navigating to the complete page as [D:\Galorath\IT2-0-2\IT2-0-2\PROJECT\Help\seer-it.htm#reports_labor_detail.htm].

Observations:

HTML help works fine in the following cases:

  1. When you run the Application in Admin mode , i can able to launch and navigate to the given URL succesfully.
  2. When you change the setting of internet explorer in such so the Protected mode goes off. it works fine.

Goto Tools --- security tab --- uncheck the check box "Enable protected mode" --- click Ok.

Also am checking hwnd of the browser before going the call navigation function as
long l_hIE=0; hr = pBrowser2->get_HWND(&l_hIE);
In vista, When you press Help key F1 first time, it launch the IE and navigate to URL till Home page not complete page as metioned Abouve. When you press F1 second time onward the Function pBrowser2->get_HWND() is failing by returning some error code as "Detached from server" or ...someting like this.
Finally i come to conclusion that, the Problem is related to some Vista Protected mode issue (as it is working fine with pretect mode off state).

Can any body Help on this...
Any body have the sample application whcih launches the IE and just navigates to the given URL in Vista IE8.

Thanks & Regards,
P.Chandrasekhar Reddy.
AppPoint Software Solutions Pvt Ltd.
Bangalore.India.