I'm trying to help out a few Omnitech GPS users with their screen calibration issues. The unit is running Windows CE 5.0. I wrote a script that runs on startup. It checks if a "screencalibration.ini" file exists in the SD card, and if it does, then read the values and put it in the registry. If the file doesn't exist, the script launches the Windows CE control panel (Stylus Properties) and asks the user to calibrate their screen. After calibration, the script reads the registry and saves the value in "screencalibration.ini" file.
That being said, my script is successful in reading the file and writing to registry, but for some reason, the values don't take effect. Anyone know what I need to do to force the unit to re-read the registry and apply the calibration values?
Script that runs at startup:
#Calibrate screen
path = "\SDMMC\Utils\Windows\"
CD = IniRead(path & "calibrationdata.ini", "CalibrationData", "CD")
if (CD eq "")
message "Please calibrate your screen!"
RunWait(path & "CalibrateScreen.mscr")
CD = IniRead(path & "calibrationdata.ini", "CalibrationData", "CD")
endif
RegWriteString("HKLM","HARDWARE\DEVICEMAP\TOUCH","CalibrationData",CD & " ")
Run("\Windows\ctlpnl.exe", "cplmain.cpl,9")
WaitForActive("Stylus Properties", 10)
SendOK("Stylus Properties")
CalibrateScreen.mscr:
# Set Screen Calibration
path = "\SDMMC\Utils\Windows\"
RunWait("\Windows\ctlpnl.exe", "cplmain.cpl,9")
RegReadString HKLM, "HARDWARE\DEVICEMAP\TOUCH", "CalibrationData", CD
message "Screen Calibrated!"
IniWrite(path & "calibrationdata.ini", "CalibrationData", "CD", CD)