PDA

View Full Version : Fire up/control your apps @ Docking, PowerOn,Idle etc events


tweakradje
27th March 2006, 09:32 PM
Fire up and control your apps @ Docking, PowerOn or Idle events

This is W.I.P. and my goal is to get a clear overview
of what is possible with (standard/builtin) events in
windows ce.

EDIT: 28/03/06 - added correct event commands and examples
EDIT: 28/03/06 - added References and WM_APP
EDIT: 30/03/06 - added the QUIT message

References:
MSDN Wap Wakeup (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/apisp/html/sp__mdref_wap_wakeup.asp)
MSDN WM_APP Notification (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/messagesandmessagequeues/messagesandmessagequeuesreference/messagesandmessagequeuesmessages/wm_app.asp)

WM_APP and Window Class Name:
00008000 "WMP for Mobile Devices" (Windows Media Player)
00000400 "Inbox.MainWnd" (Outlook main window)

WM_APP findings:

Quit/Exit 00000010

quits a given window class Name. Example:

[HKLM\Software\Microsoft\Shell\Events\PowerOn\QuitW MP]
"On"=dword:00000010
"Class"="WMP for Mobile Devices"

On the Idle event that would be:
[HKLM\Software\Microsoft\Shell\Events\Idle\QuitWMP]
"Idle"=dword:00000010
"Class"="WMP for Mobile Devices"


Minimize 0000000?
....

Maximize 0000000?
....


Note: \....] stands for a choosen key name

Using only "Command=" you can start any application on a given event

PowerOn events:

[HKLM\Software\Microsoft\Shell\Events\PowerOn\....]
"command"="\somedir\someapp.exe"

Idle events:

[HKLM\Software\Microsoft\Shell\Events\Idle\....]
"command"="\somedir\someapp.exe"

[HKLM\System\CurrentControlSet\Control\Power\Activi tyTimers\UserActivity]
"TimeOut"=dword:00000005 (5 secs)

Dock event:

[HKLM\Software\Microsoft\Shell\Event\Dock\....]
"command"="\somedir\someapp.exe"

You can even try this I think:

IncomingCall event:

[HKLM\Software\Microsoft\Shell\Event\IncomingCall]

[HKLM\Software\Microsoft\Shell\Event\IncomingCall\M yRingy]
"command"="wmp.exe \somedir\somemp3.mp3" (or .mid or whatever)

Customizing Event Actions

Note1: The Class string can be found using DotFred's TaskMgr 1.3
Discussion board (http://buzzdev.net/component/option,com_simpleboard/Itemid,59/func,view/id,15027/catid,27/limit,15/limitstart,0/)
TaskMgr 1.3 (http://buzzdev.net/components/com_simpleboard/uploaded/files/TaskMgrv1.3.zip)

Note2: The following dwords are commands. Dunno how to find them yet.

For every Event subkey you can use

"command"="someapp.exe arg1"

and also

"Class"="Window Class Name" (Window class name of active app)
"NotifyOnLaunch"=dword:00000001 (must be 1 to post message to the app window given in Class)
And a dword commando

The dword commando "ConnectMsg"=dword:00008004 is only used
in Event\CallConnect. If the same commando is used in Events\PowerOn
then it would be "On"=dword:00008004

The 8000 value is called the WP_APP is a constant for a application.
In Windows CE 8000 is used by WMP. The commando is WM_APP+X, where X is
an integer value. Sending 8004 to the WMP class window will pause WMP.
Sending 403 to Outlook (Inbox.MainWnd) wil do something in outlook.
(WM_APP for outlook is 400)

Dword Commando's (value 00000000 is cosmetic and not a valid commando):

[HKLM\Software\Microsoft\Shell\Events\PowerOn\....]
"On"=dword:00000000

[HKLM\Software\Microsoft\Shell\Events\Idle\....]
"Idle"=dword:00000000

[HKLM\Software\Microsoft\Shell\Event\CallConnect\.. ..]
"ConnectMsg"=dword:00000000
"DisConnectMsg"=dword:00000000

[HKLM\Software\Microsoft\Shell\Event\Carkit\....]
"CarOnMsg"=dword:00000000
"CarOffMsg"=dword:00000000

[HKLM\Software\Microsoft\Shell\Event\Dock\....]
"DockMsg"=dword:00000000
"UnDockMsg"=dword:00000000

[HKLM\Software\Microsoft\Shell\Event\Headset\....]
"HeadOnMsg"=dword:00000000
"HeadOffMsg"=dword:00000000

[HKLM\Software\Microsoft\Shell\Event\IncomingCall\. ...]
"IncomingBegMsg"=dword:00000000
"IncomingEndMsg"=dword:00000000

[HKLM\Software\Microsoft\Shell\Event\SpeakerPhone\. ...]
"SpeakerOnMsg"=dword:00000000
"SpeakerOffMsg"=dword:00000000

Example for CallConnect and WMP:

[HKLM\Software\Microsoft\Shell\Event\CallConnect\Wi ndows Media Player]
"Class"="WMP for Mobile Devices"
"ConnectMsg"=dword:00008004 (pause WMP)
"DisConnectMsg"=dword:00008005 (resume WMP)

Example for Dock and Outlook:

[HKLM\Software\Microsoft\Shell\Event\Dock\Inbox]
"Class"="Inbox.MainWnd"
"DockMsg"=dword:00000403 (command for Outlook?)
"NotifyOnLaunch"=dword:00000001 (Send DockMsg to Inbox.MainWnd)
"Command"="tmail.exe -RunInBKG" (run this when Docking)

Nygie
30th March 2006, 02:52 PM
hi I have no experience with this type of thing, as yet.
But would it be possible to route all audio through the car kit(whilst not on a call) with a command type thingy?

Thanks

tweakradje
30th March 2006, 08:39 PM
Would be a tough one. I am still studying the potential of these events. The only thing I can think of is fire a command (you must figure that one out yourself) on the Carkit event.

HKLM\Software\Microsoft\Shell\Event\Carkit\RouteAu dio]
"Command"="command to the exe file"
"Class"="the window clas name for that app"
"NotifyOnLaunch"=dword:00000001
"CarOnMsg"=dword:0000xxxx
"CarOffMsg"=dword:0000yyyy

where

xxxx = the message ID for switching audio to carkit
yyyy = the message ID for switching audio back

The message IDīs should be known to the maker of
the exe file you use.

Cheers

ps: doesnīt the device do it automaticaly?

Nygie
30th March 2006, 09:28 PM
pfff
Thanks but that went straight over my head :lol:

Nygie
2nd April 2006, 06:44 PM
It would be great if TT sent it to the car kit automatically!

psneddon
2nd May 2006, 09:41 AM
I can get a command to fire for a docking event, but i does not fire for an IncomingCall event. Do you know if only certain events support having a command fired.

Paul