Bionicoder's Blog

Windows software development and business blog

Archive for June, 2009

IE7 Shell Window Registration in Vista

Posted by bionicoder on June 17, 2009

A Shell window is a window that has been registered by calling IShellWindows::Register or IShellWindows::RegisterPending.  Upon registration, the specified window is added to the collection of Shell windows.  The Shell windows collection includes file explorer windows and web browser windows Internet Explorer and 3rd-party web browsers.  The shell window collection can be retrieved through:

        IShellWindows *psw;
        HRESULT hr;
        hr = CoInitialize(NULL);
        if (SUCCEEDED(hr))
        {
             hr = CoCreateInstance(CLSID_ShellWindows, NULL, CLSCTX_ALL, IID_IShellWindows, (void**)&psw);

             if (SUCCEEDED(hr))
             {
                  // TODO: Use the IShellWindows instance...

                  psw->Release();
             }
         }

Before Windows Vista, all opened file explorers and Internet Explorers can be found through the above code. But this changed in Windows Vista because of UAC. The issue is when UAC is ON, sometimes the IE can not be enuermerated. This issue was also discussed in MSDN forum. Some developers thought IE can only be enumerated when UAC is OFF.

I spent a couple of hours to do some resarch and found:

  1. When UAC is ON, the IE run in Protected Mode: ON can still be enumerated through above method
  2. When UAC is ON, the IE run in Protected Mode: OFF can NOT be enumerated through above method.

This is very interesting.  I am not sure why Microsoft does not allow IE in protected off mode being enumerated when UAC is ON.  Maybe it is because of Microsoft own security consideration.  This inconsistent behavior has not been updated in Microsoft website yet.

So, in Vista (UAC on), developer needs to use two different ways to get IWebBrowser2 interface.

Posted in vista, windows development | Tagged: , , , , | 3 Comments »

Is this good? – IE free Windows 7

Posted by bionicoder on June 11, 2009

Consumers in Europe probably will see IE free Windows 7 sooner or later.  Reacting to antitrust concerns expressed by European regulators.  Microsoft plans to offer a version of Window 7 in Europe that has IE removed.  This is called Windows 7 E. Micrsoft  try to appease European Commission (EC) regulators who are mulling possible remedies in the ongoing Opera-Microsoft browser-bundling case in the European Union.

Is this good? For consumers, it is not a big deal. They will see other browsers installed when they purchase new PC with preinstalled Windows 7.  OEM manufactures won’t ship new PCs without any browser.

For browser software companies, it is a chance to get more market share. That is Opera has been struggling for.

For developers, it is hard to say at this point.  Starting from Windows 95, IE has been the “must have” browser in Windows.  So many desktop application is dependent on browser library – shDocVM.dll, which is the core component of IE browser. If this were removed in Windows 7 E, then the software dependent on WebBrowser control will not work properly. That would be a nightmare for developers.

Posted in Microsoft, Software | Tagged: , , | 2 Comments »