Category Archives: Windows Gadget

LOL Server Status Gadget

EDIT: 01 Aug 2013: Due to me switching LOL servers I cannot continue updating the na thread – I have moved updates to this OCE thread:

This post is a little different to my previous ones as this is about Windows Vista/7 Gadgets. I play this game called League Of Legends (LOL) and when they patch the game the servers go offline, I got bored of refreshing their front end to see when it was back up, so I built a gadget to do it for me. About a year later (nowish) it has been noticed by Riot (whom make LOL) and they are probably going to use it which is really cool, the forum thread is here: Enough about how cool this is, I am now going to summarise what I learnt about windows gadgets in building this.

  1. .gadget files are just renamed .zip files, so you can unzip and have a look to your hearts content.
  2. Every gadget is simply a small IE browser (with some extras), so you have all the HTML, Javascript (this includes jQuery!!) stuff you usually would but also you can use IE specific calls. Some examples I used in the gadget are: System.Shell.execute(“path”)). To break that little fragment down;“path”) reads the setting “path” (in my gadget this is the path to the LOL executable, you set these elsewhere) as the string parameter into System.Shell.execute() which has the same affect as typing the path to an executable into cmd prompt. (for those that don’t know what this does, start up the command prompt and type in (with quotes) “C:\Program Files\Internet Explorer\iexplore.exe” this should launch IE as long as it is still there.)
  3. Settings are written and read through the calls and System.Gadget.Settings.write (I used these in a js script).
  4. Some useful System.Gadget things I discovered are onDock, onUndock (these two are event handlers for when the gadget is changed from small to big or vice-versa) and onSettingsClosed (called when the gadgets settings have closed, here’s where you update the gadget) these three all require you to assign a function to them that will be called when the event occurs. The last one I used is settingsUI which is the name of the html file that is called for the settings.
That’s about all I found that was interesting or a little tricky, if you’d like me to do a more detailed tutorial/breakdown of how I built it leave a comment!