GreenButton

Override Green “Talk” Button functionality

How does this work?

GreenButton is an Open Source Windows Mobile 5.0+ program. It runs in the background as a very tiny executable (1kB) that waits for the Green Button (otherwise known as the “Talk” button) to be pressed. At that time, the specified program will be executed. I wrote this with iDialer in mind, and it works perfectly for those who want to use iDialer as their default dialer.

See the xda-developers thread for discussion.

Screenshot

Sorry, nothing interesting to display here, this is a background process :)

Download

Download GreenButton.cab installer – December 15, 2008

Advanced Configuration

GreenButton stores several settings in the registry under HKCU/Software/Supware.net/GreenButton:

  • HandleNormally
  • SendKeys
  • Activate
  • Run

This is how GreenButton interprets these settings when the green button is pressed (in this order):

  1. If the active window text is found in the “HandleNormally” setting, then GreenButton will just return.
  2. Else If a call is in progress, GreenButton will just return.
  3. Else If the active window text is found in the “SendKeys” setting, then GreenButton will send that window WM_KEYUP / WM_KEYDOWN window messages.
  4. Else If the class name specified by “Activate” setting is found, then GreenButton will activate that window.
  5. Else If a command was specified from the command line, GreenButton will run that command.
  6. Else, GreenButton will run the command specified in the “Run” setting.

How do I specify a program from the command line?
The default program built into GreenButton is iDialer (installed on device). But with a command line option, any program can be executed.

How do I change the program?
GreenButton is activated upon startup by a shortcut placed in “WindowsStartup”. Edit that shortcut (easiest to do over ActiveSync) and add your program as an argument (this example will execute Pocket IE upon Green Button press):

44#"Program FilesGreenButtonGreenButton.exe" Windowsiexplore.exe

Will GreenButton work when iDialer is installed on my Storage Card?
Yes, but you have to update your GreenButton settings by installing this cab file and restarting your phone. The cab will update GreenButton to run “Storage CardProgram FilesiDialeriDialer.exe”. Please note: if your storage card has a different name, like “storage card2″ or “internal storage”, this cab will not work for you, you must update the setting manually.

Source Code

I’m releasing this under the GPLv3 license. I hope some developers will be able to make use of it in their open source programs!

What the GPL says is that anybody can use the source code in their own project, provided that the derivitave project also be released as open source under the same GPL license.

I used the GPL license so that the Windows Mobile community can all benefit as a whole from the community efforts. I don’t want someone making money off my work, I want someone to make and share something else cool and useful.

Download GreenButton.zip Visual Studio solution – December 15, 2008