This started from trying to get the backlight control working in Primo on my (wince) sat nav. I now don't think that is possible because I've got into control panel in wince and there is no backlight control there. I assume Primo will try to call a windows backlight control so I'm unlikely to get backlight to work in Primo if it doesn't work in windows.
My sat nav has a BacklightCTL.exe in \windows which pops up a control for the backlight. This goes from 0 to 19. My first step was how to get this to work from inside Primo.
The skin I use, dimka (tomsoft), has the option to run external programs. I think this is meant to work by running scan and then deleting the programs you don't want. Scan didn't work for me, I think because my wince is cut down to the bone. Instead I had to build the list file manually. The file that controls the external programs is user_program_list.txt and this can be in PRIMO\save\userlists for the default version or PRIMO\save\profiles\01\userlists (or profile 02, 03, etc.) for the version in use. My user_program_list.txt is:
-------------------user_program_list.txt--------------------
Backlight Day;\\ResidentFlash\\mortscript\\BacklightD.exe;;0
Backlight Night;\\ResidentFlash\\mortscript\\BacklightN.exe;;0
Backlight;\\Windows\\BacklightCTL.exe;;0
Control Panel;\\Windows\\control.exe;;0
Reg Edit;\\Windows\\RegEdit.exe;;0
Task Manager;\\Windows\\TASKMGR.exe;;0
-----------------------------------------------------------------
The format is NAME;PROGRAM;PARAMETER;0 . You need \\ for a \ . I'll get on to mortscript in a bit. The rest should be obvious. With the Backlight control I can manually change the backlight from within Primo but that's a pain so I've also installed Mortscript to automate the process as much as possible. Mortscript is old and does not seem to be on the author's home page anymore but you can find it here
www(dot)mobyware(dot)org/windows-mobile-6-5-professional-device-1778/mortscript-get-2884.html
This says it is MortScript 4.3b11 but in fact the zip has 4.2 and 4.3b11. I went for 4.2 rather than the beta. To install just copy bin\pna to a folder. I went for \ResidentFlash\mortscript. You write a script as text file and name it .mscr, i.e. MyScript.mscr. Then you copy autorun.exe and rename that as MyScript.exe. You run MyScript.exe to run the script. All files should be the same folder. These are my backlight scripts:
-------------------BacklightD.mscr--------------------
#Set Backlight to Day value (max)
Run ("\Windows\BacklightCTL.exe")
WaitForActive("Backlight Control 0.2", 30 )
if ( WndExists("Backlight Control 0.2") )
#Wind up to max
For i = 0 to 20
SendRight( "Backlight Control 0.2" )
Next
#Then back off as needed
#For i = 0 to 15
# SendLeft( "Backlight Control 0.2" )
# Next
Close( "Backlight Control 0.2" )
EndIf
#close external programs windows in Primo
if ( WndExists("NAVI") )
SendEsc( "NAVI" )
EndIf
-------------------------------------------------------------
-------------------BacklightN.mscr---------------------
#Set Backlight to Night value (5)
Run ("\Windows\BacklightCTL.exe")
WaitForActive("Backlight Control 0.2", 30 )
if ( WndExists("Backlight Control 0.2") )
#Wind down to zero
For i = 0 to 20
SendLeft( "Backlight Control 0.2" )
Next
#Then wind up as needed
For i = 0 to 4
SendRight( "Backlight Control 0.2" )
Next
Close( "Backlight Control 0.2" )
EndIf
#close external programs windows in Primo
if ( WndExists("NAVI") )
SendEsc( "NAVI" )
EndIf
-------------------------------------------------------------
As should be obvious the backlight scripts run the backlight control, then send it arrow keys to ensure it is hard at one stop or the other before sending more arrow keys to set the required value. "NAVI" is the window name for PRIMO and SendEsc closes the external program window to save pressing the back button.