Windows Mobile – the no-go world of Function Keys

Hello

I want to summarize the role of function keys in Windows Mobile, former Pocket PC, as I got several questions each week on how to use or enable Function keys in this or that application.

Here is a simple information about how function keys work in Windows Mobile.

Continue reading ‘Windows Mobile – the no-go world of Function Keys’ »

Mobile Developement – RDP AutoLogin extended (version 4)

Hello

on the wish of the one or other user I extended the RDP AutoLogin code and we now reached level 4.

The new code simply has only one extension, it supports the color depth selection. Also the color depth and other settings are visible on the dialog of Remote Desktop Mobile, the settings itself are done via the Default.rdp file. But you are right, RDP_AutoLogin also controls some of the dialog items directly.

  1. ...
  2. Domain:s:
  3. ColorDepthID:i:3
  4. ScreenStyle:i:0
  5. DesktopWidth:i:640
  6. DesktopHeight:i:480
  7. UserName:s:rdesktop
  8. ...
  9. ServerName:s:192.168.128.5
  10. SavePassword:i:1
  11. ...

The color depth setting supports two modes, 8 Bit with 256b colors (ColorDepthID:i:1) and 16 Bit with ~65000 colors (ColorDepthID:i:3).

  1. REGEDIT4
  2.  
  3. [HKEY_LOCAL_MACHINE\Software\RDP_autologin]
  4. "FitToScreen"="1"
  5. "FullScreen"="1"
  6. "Status"="connecting..."
  7. "Save Password"="1"
  8. "Domain"=""
  9. "Password"="Intermec+2004"
  10. "Username"="rdesktop"
  11. "Computer"="192.168.0.130"
  12. "DesktopWidth"=640
  13. "DesktopHeight"=480
  14. "startOnExit"="\\rdp_keepBusy.exe"
  15. "execargs"="noRDPstart"
  16. "UseMouseClick"="0" //added with version 3 to switch between mouse and keyboard simulation
  17. "ColorDepth"=1 //added with version 4 to enable switching between 8 and 16 Bit colors

The code changes are small. Some code addition to read the value from the registry and some to write the rdp file:

  1. void readReg(){
  2. ...
  3.         //ColorDepth new with version 4
  4.         if(RegReadDword(L"ColorDepth", &dwTemp) == 0)
  5.             dwColorDepth=dwTemp;
  6. ...
  7. }
  8. void writeRDP(){
  9. ...
  10. else if(wcsstr(rdpLines[c].line, L"ColorDepthID")!=NULL){
  11. wsprintf(szTemp, rdpLines[c].line, dwColorDepth); //3=HighColor(16Bit) or 1=(8Bit) color
  12. }
  13. ...
  14. }

Additionally I have added a new project to the solution to enable to set all the settings not only via the registry but using a GUI application. RDP_Autologin_Settings is born:

Continue reading ‘Mobile Developement – RDP AutoLogin extended (version 4)’ »

Windows Mobile – tasker2 runs and stops applications periodically

Tasker2 is a tool to launch or kill applications periodically using windows mobile scheduler. It was born to control the running of agent software on windows mobile at specified times. The problem with the agent software was that it does not open/close connections only on usage times but all the time and the device’s battery was drain very fast. We decided to write a helper that would launch and kill the agent to have it running only within a defined time frame.

Background process

We could have written a background process to run external tasks periodically. But the main disadvantage of timers and threads in background processes is that they do not run, if the device is in suspend mode.
To ensure that tasks will be launched also if the device is sleeping, we decided to use the windows mobile scheduler. There are functions inside the notification API to create notifications that will run an application at a specified time. This is what we call a schedule.

The scheduler (notification API)

After a timed schedule has been done by the scheduler, the schedule is removed from the notification database. If you like to have a periodic schedule, you have to ensure that a new schedule is created inside your code.

Pitfalls

During development we found many pitfalls in conjunction with the windows mobile scheduler. This is why I decided to write this post.

The tasks

Tasker2 is a console application without any GUI but it will write a log with all you need to know. Tasker2 supports up to ten tasks. A task is defined using the registry. Every task has an entry for start and stop times, the application to control, an interval for the schedule and a flag for control if a task is only to be run on external power:

REGEDIT4

[HKLM\Software\Tasker\Task1]
"active":DWORD=1
"exe":="\Windows\fexplore.exe"
"arg":="\My Documents"
"start":="1423"
"stop":="1523"
"interval":="2400"
"startOnAConly":DWORD=0;

active: if active is 0, tasker2 will not kill or start the process
exe: name of the process executable to start or kill
arg: arguments to be when launching the executable
start: when to start the executable the next time
stop: when to kill the process the next time
interval: when a start or kill has been executed, tasker2 will create a new schedule using this interval. If the interval is “0010″, the start process will be scheduled for every 10 minutes.
startOnAConly: if 1 and when a process has to be started, the process will only be started if the device is on external power

The scheduler

First, tasker2 is normally only launched one time manually and all future calls are made by the scheduler. Tasker2 will clear and schedule all planned tasks as defined in the registry if it is launched without arguments.

Continue reading ‘Windows Mobile – tasker2 runs and stops applications periodically’ »

Opencart vqmod – Telefonnummer bei Registrierung nicht erforderlich

Anbei ein kleines vqmod file für Opencart 1.5.1.3 (englische und deutsche Sprachdateien) welches die Telefonnumer bei Registrierung als Kunde nicht zwingend erforderlich kennzeichnet.

Normalerweise muß ein Neu-Kunde seine Telefonnummer bei der Registrierung angeben. Dies wird durch dieses vqmod file geändert und der Kunde muß keine Telefonnumer angeben, wenn er sich registriert. Das vqmod file einfach in das Opencart vqmod/xml Verzeichnis kopieren. Wenn was nicht funktioniert, die Datei einfach wieder löschen.

Continue reading ‘Opencart vqmod – Telefonnummer bei Registrierung nicht erforderlich’ »