Saturday, March 28, 2009

Remapping the Dell MediaDirect Button

Have you ever wanted to take control of the Dell MediaDirect button and have it launch another application? Perhaps turn off the LCD when pressed? How about launch your default browser and load your favorite website? Well, now you can do just this.

IMPORTANT NOTES:
  • This modification requires that QUICKSET be installed on the system. Quickset provides the necessary Registry entries and functionality.

  • Tested and verified compatible with MediaDirect 3.5, MediaDirect 4.0 and Quickset v8.2.20+. This process has been confirmed to work with Vista 32 & 64 bit versions. Also confirmed to work under XP 64 and Windows 7 64.

  • BE AWARE, WE WILL BE EDITING THE REGISTRY. IF YOU MAKE A MISTAKE OR CHANGE SOMETHING BY ACCIDENT, YOU CAN HOSE YOUR SYSTEM. BACK UP YOUR REGISTRY IF YOU FEEL THE NEED. IF YOU DO NOT FEEL COMFORTABLE, STOP NOW. I AM NOT RESPONSIBLE IF YOU MUCK UP YOUR OS INSTALLATION.

    EDITING THE REGISTRY
    Let’s get started:

    The first step is to modify (or create) the registry entries that handle the MediaDirect button. Open REGEDIT via the RUN command (type REGEDIT). This will launch the REGISTRY EDITOR.

    Find the following keys...

  • HKey_Local_Machine\SYSTEM\CurrentControlSet\Control\MobilePC\HotStartButtons\0
  • HKey_Local_Machine\SYSTEM\CurrentControlSet001\Control\MobilePC\HotStartButtons\0
  • HKey_Local_Machine\SYSTEM\CurrentControlSet002\Control\MobilePC\HotStartButtons\0
  • HKey_Local_Machine\SYSTEM\CurrentControlSet003\Control\MobilePC\HotStartButtons\0

    Note: You may not have an entry for ControlSet003 - if not, don't worry. Just proceed.

    For each of these keys, there is an Application Path entry. This is the entry you will need to modify.

    When looking at it, it will look like this:

    "C:\Program Files\Dell\MediaDirect\MDirect.exe"

    In order to remap it to launch another application, just edit the path to whatever application you want. So, for example:

    To map it to launch Windows Media Center, you would change the path to: "C:\Windows\ehome\ehshell.exe"

    You now have the process to change the mapping to any application you have. Just point the application path to the application you want the button to launch. Remember to leave in the quotes.

    NOTE: After modifying the registry, you will need to reboot for your changes to take effect.

    OTHER FUNCTIONS
    Several people have expressed interest inhaving the MediaDirect button power off the LCD when pressed. In order to do this, use the following process:

  • Download TurnOffLCDv101.zip. This is a small 85kb Freeware application. Thanks to Taimur Asad for writing this AWESOME little application.

  • Extract the file you downloaded and move it to the root level of your C: Drive. To keep things neat and tidy, rename the application to 'TurnOffLCD'.

  • When editing the registry, you would change the Application Path key to: "C:\TurnOffLCD.exe"

  • Close regedit and reboot your system

    That’s it! After your reboot is complete, depressing the MediaDirect button will turn off the LCD. Moving the mouse or pressing a keyboard key will power on the LCD.

    LOCK YOUR LAPTOP
    So, for Lock Workstation you would:

  • Right-click an empty space on your desktop, point at New, and then select Shortcut from the context menu

  • Type rundll32.exe user32.dll,LockWorkStation in the location field and then press Next

  • Type the name of the shortcut in the name box ("LockWorkstation")

  • Click Finish to create the shortcut. To keep the desktop clean and free of clutter, move the newly created shortcut to the root level of your C: drive.

  • Now, in the Application Path of the registry edit process, change it to point to your LockWorkstation shortcut:

    "C:\LockWorkstation"

  • Close regedit and reboot your system

    Pressing the MediaDirect button will now lock your laptop. Granted it’s probably just as fast to use the keyboard shortcut (Windows Key+L), but some people may find it useful.

    POWER OFF LCD AND LOCK WORKSTATION:
    How about locking and turning off the LCD by just pushing the button?

  • First we will need to create a batch file. This is very simple to do. Open NotePad and type the following:

    @echo off
    start C:\Windows\System32\rundll32.exe user32.dll,LockWorkStation
    PING 127.0.0.1 -n 3
    start C:\TurnOffLCD.exe

    Save the file as 'TurnOffLCDandLock.bat' - BE SURE TO CHANGE THE FILE TYPE to: All Files or it wont save properly. Save the file to the root level of the C: drive.

  • Be sure that The TurnOffLCD application is named 'TURNOFFLCD' its located at the root level of the C: drive.

  • Edit your Current Control Set registry entries as explained above to point to the TurnOffLCDandLock.bat file you created in Step 1.

    "C:\TurnOffLCDandLock.bat"

  • Reboot and depress the MediaDirect button - your workstation should lock then 3 seconds later the LCD will power off.

    SHUTDOWN
    As before, create a new shortcut, but instead use the following to create a "SHUTDOWN shortcut" which will force all open applications to close and the system to shutdown when the button is pressed:

    Shutdown.exe -s -t 00

    or to give the system 30 seconds, use this:

    Shutdown.exe -s

    SLEEP/SUSPEND
    For SLEEP, try:

    Rundll32.exe Powrprof.dll,SetSuspendState Sleep

    HIBERNATE
    For HIBERNATE, try:

    Rundll32.exe Powrprof.dll,SetSuspendState Hibernate

    WEBSITES AND DOCUMENTS
    For Website or Document shortcuts just follow the same procedure. Right Click on the desktop and create your shortcut. You could even link to a .wav or .mp3. Anything is possible. ;)

    Remember, once you have identified the shortcut/application/file you want to link the button to, just go into the registry as before and change the Application Path.

    Kind of cool, huh? Well, that's about it for remapping the Dell MediaDirect button.