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)
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)