03
Jan 2008
9 Comments
Windows Mobility Center Tile/Tile Installer Source Code

Made by Long ZhengAs promised, I have made the source code for both the Display Off tile and its installer available for download.

displayOffTileSrc.zip (VS08 project) contains the code for the tile executable itself. It’s nothing magic, simply creates a hidden window and sends a message to it to shut the monitor off. Dead easy to back-port project to Visual Studio 2005.

NOTE: The icon (and all derivative works), as per Long Zheng, is licensed under Creative Commons Attribution-Share Alike 3.0.

displayOffTileInstallerSrc.zip (VS05 project) contains the WiX project and code that creates the MSI used to install and configure the tile. Pay particular attention to the areas that detect existing OEM tiles. I strongly recommend you should leave that logic intact.

  • http://www.dev0.de murphy

    Thanks for the sourcecode. Will take a look next days on it ;)

  • Scott W. Kurth

    I’ve taken the setup project that you created and created a new tile for enabling / disabling Bluetooth. Here is a screenshot from my machine:
    http://www.flickr.com/photos/scottwkurth/2348966202/

    This has only been tested on two machines thus far, my MacBook Pro and a friend’s Sony Vaio. I’m not really sure whether this completely powers down the radio, but at the very least it disables the device from a security perspective. If you have UAC turned on, you will be prompted to Allow whenever you toggle. Annoying, but still easier than going through Device Manager. The MSI file for installing the tile is here:
    http://rapidshare.com/files/101112149/BluetoothTileInstaller.zip.html

    If you don’t trust downloading an MSI from a file sharing site posted by a guy in a comment on a blog (I know I don’t….), here are the source code, projects, and solution for VS2008. Build away – it should be pretty painless. You will still need to provide the MSM files for some Microsoft redistributables like with the DisplayOff source. This is not the most elegantly designed code, but I got it up and running quickly with some samples from the XP DDK.
    http://rapidshare.com/files/101112150/BluetoothMobilityCenterTile.Source.zip.html

    Rafael – if you would like to host this, feel free to drop these files on your site. This has served my purpose and I’m not interested in maintaining or supporting it so going through the effort to put it up on Sourceforge isn’t in the cards. Hence, the quick and dirty upload to RapidShare.

  • Scott W. Kurth

    I should add that your mileage may vary based on the assumptions I made about device ids for your Bluetooth device. There is no warranty implied, explicitly stated, etc. This won’t willy-nilly start disabling random devices on your machine, but it does look for all devices of type “Bluetooth” with ids that begin with USB. Good luck.

  • Scott W. Kurth

    One last thing… you’ve got a minor error in your WXS file. If you detect X86 instead of X64, the ProgramFilesFolder variable gets set incorrectly to ProgramFiles – not ProgramFilesFolder. The net result is that on 32-bit systems the tiles directory ends up at the root of C:\.

    Thanks for figuring this out! I’m glad I can finally easily turn on / off Bluetooth without nasty batch files or using device manager.

  • Pushkar Sharma

    Hi,
    I am not able to see the tile in Windows Vista Mobility Center after I install the MSI. The display off tile works fine. I am not sure if I missed something here. I downloaded the MSI file and ran it. I have done it few times but no luck.

    The display off tile ended up in c:\ProgramFiles\Windows Mobility Center

    whereas the bluetooth power off tile ended up in c:\ProgramFiles(x86)\Windows Mobility Center

    I am running 64bit Vista Ultimate on the mac.

    Any suggestions.

  • Lester_br

    Very very good!!! I have HP TX2510us, and this will be very helpful!!! Thank you!!!

    New link working for Bluetooth:
    http://www.withinwindows.com/files/wmc/tiles/Bluetooth/BluetoothTileInstaller.zip

  • http://yehudiinsurance.blogspot.com Eternity

    Keep up the good work.

  • http://nonglam.ru Lydayseaf

    Много букф, можно чуть покомпактнее?

  • http://plito4niku.ru Vassejapjat

    Слу, да как ты вобще до такого додумался?