Primo Alternate Backlight / External programs   

Primo Alternate Backlight / External programs

Postby malc » Sun Mar 19, 2023 11:51 am

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.
malc offline


Junior Member



 
Joined: Wed Sep 07, 2011 3:30 pm
Posts: 11
Has thanked: 1 time
Been thanked: 2 times

Re: Primo Alternate Backlight / External programs

Postby JmaCWQ » Sun Mar 19, 2023 1:18 pm

Nice work, I wish I could understand things to write scripts etc., I'd try to have the awesomest gps software out there if I could :003:

On the CE GPS capable devices I have, CE5 & CE6, the backlight is adjustable from within Primo using one of the Dimka skins, not sure which versions of program and skin they are though, next time I get the opportunity I'll check.
JmaCWQ offline


User avatar Junior Member



 
Joined: Fri Sep 13, 2013 9:05 am
Posts: 81
Location: Walkabout
Has thanked: 45 times
Been thanked: 17 times

Re: Primo Alternate Backlight / External programs

Postby k1w1_123 » Sun Mar 19, 2023 8:43 pm

Thanks for posting this :023: .
One of my many projects is to be able to toggle Bluetooth on and off from within Primo (hopefully using the existing button in the "More" menu which presently does nothing). I'm sure some of the informtion you have provided here will help me along the way.
k1w1_123 offline


Junior Member



 
Joined: Tue Mar 15, 2011 7:41 am
Posts: 73
Has thanked: 70 times
Been thanked: 30 times


Return to General Discussions about iGO core

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 15 guests