Monday, December 04, 2006

Changes in expected behavior in the Vista RTM

So here I am, plugging away at an auto update component for Windows Vista that checks to see if IE is running. The old code that worked on XP used the usual ShellWindow. It's been seen in plenty of places. Here's an old link that gives you a little bit of the original source material.

I've updated it slightly, and I think it's a bit nicer. Easier on the eyes, etc. There's no more real need to import the shdocvw.dll. (Why would I want to slow down my compile time for the compiler to do an import?)

#include
#include

IShellWindowsPtr iWnd;
iWnd.CreateInstance( __uuidof(ShellWindows) );
long count = 0;
iWnd->get_Count( &count );

Pretty straight forward stuff, with all error checking stripped. So I run this application, and print out the count.

Windows XP Professional SP2. Result of total # of instances: 1.
Windows Vista RTM. Result of total # of instances: 0.

Now that is amusing. I'm not sure if they will update this or not, but this is problematic. I'll have to fix my code for specifically for to check on the number of running instances. I was thinking of using the ROT, but that was out of the question.

Now the real question is, why did they change the results? Doesn't the one I just created count as one anylonger?