Icons for Windows 7 Internet Games

18/08/2009 16:10

I'm currently developing E-Explorer on a Windows 7 RC1 x86 test PC during my reduced spare time, and am making Windows 7 compatibility a priority over Vista for now (will make sure it works ok in Vista later on).


After not hearing from Julius from Neowin in a long time (he provided most of the 'behind the scenes' code making this project possible in the first place), I've been stepping through it all seeing what changes or additions are required to get the basics completed.


So, what is all this 'background code'?

Julius has created a class that connects to the WMI where game information used by the Windows game Explorer is stored. It then loads XML, Thumbnail and Icon resources for each game. There is also code to save changes, to install and uninstall games from the WGE and Windows Media Centre, as well as other items that I have yet to examine.


When E-Explorer starts, it loads program preferences from the Local_User section of the registry, then get's a list of installed* games from the WMI, then asks the class to return information and images for each game, which are added into a dynamic ListView control.


The latest version of the source files that I had with me (emailed back from Julius) had a few issues with displaying icons for all games, and displaying all the info for the game in the Edit screen. The problem is that a number of games do not return any images/boxart to be used in the main screen. I've caught these exceptions and told it to load a white 256x256 image instead, so that I can at least get the program to run now.


I'm now faced with the task of getting EE to find an image for each type of game that could potentially be on a user's system. These include (1) the standard Windows games (Solitaire, etc), (2) 3rd party Games for Windows that come with boxart, (3) 3rd-party legacy games that get game info from the Internet, and (4) 3rd party games that do not fall into any of the preceeding categories and display as a stretched icon in the WGE (Vista Game Explorer Editor was used primarily to make these games appear as Category 3 games so that boxart could be used).


After making the white 256x256 image to be used instead of receiving 'Object = Nothing' errors, the game list looked like this. I discovered the reason behind why some Windows Games weren't showing icons earlier today. In Julius' class, there were some lines of code along the lines of:

        If strGamePath.Contains("Solitaire") Then strIconResourceLocation = "108"

Using a Resource Viewer I viewed the contents of the Solitaire .exe file, and sure enough, all the icons were under a section named '108'. Unfortunately, most games have the icons under a different number:


Mahjong Titans & Purble Place - "102"

Hearts, Solitaire & Spider Solitaire - "108"

Minesweeper - "110"

Freecell - "121"

Chess - "128"


After manually entering the values for these other games, E-Explorer had no issues loading the images for them. Click here to view the latest screenshot.


You've probably noticed that there are still no icons for the Internet Games (Spade, Backgammon and Checkers). I had a look at them in the resource viewer as well, and instead of having a number as the resource location, the section is called "IDI_ICON". Click here to see the resource viewer screenshot. I figured entering this string in the code just like all the other lines would be enough to get the icons I needed, but it isn't working for some reason. If you can help with this, feel free to get in contact with me.


Another thing that concerns me is that Julius has hard-coded resource location for some of the 3rd-party games on his PC. I'm hoping that all 3rd party games store the XML and thumbnail data in the same universal location ("DATA\__GDF_XML" and "DATA\__GDF_THUMBNAIL" respectively), otherwise I'll have to think about some sort of online database that has all the various resource locations in it (based on user-contributed info). If I hear from Julius again, I'll be sure to ask him, otherwise feel free to contact me if you know what's going on.


That's it for this blog post.





* "Installed" in this context has nothing to do with 'Add/Remove Programs' in the Windows Control Panel (although come to think of it, it could be a useful feature worth adding). Think of 'installing' a game as adding it to the WGE, and 'uninstalling' as removing the entry from the WGE.

Search site