Mobile development: show a small information window using WIN32 API

ShowWin

Sometimes you may need to display a small window to inform the user about what is going on. Although the scripting tools MortScript and nScript provide functions to show dialogs they can not show simple information windows.

ShowWin default colors

ShowWin default colors

ShowWin with a progress bar

ShowWin with a progress bar

ShowWin is nothing special but a nearly full configurable window to be used from cmd line tools. It just uses Win32 API calls, constants and structures as FindWindow, PostMessage, SendMessage, WM_COPYDATA, COPYDATASTRUCT, GetSystemMetrics, GetDesktopWindow, GetWindowRect, CreateWindowEx, ShowWindow, UpdateWindow, INITCOMMONCONTROLSEX, GetDeviceCaps, CreateFontIndirect, GetWindowDC, ReleaseDC, PROGRESS_CLASS, InvalidateRect, BeginPaint, CreatePen, SelectObject, Rectangle, SetBkMode, DrawText, EndPaint, SetTextColor, DeleteObject, GetKeyState and PostQuitMessage.

Basic WIN32 programming

Possibly you never wrote a native C windows application. Come on and dive into the basics. It is always good to know the basics even if one writes DotNet or JAVA code.

Supported arguments

 showWin -t "Text zum Anzeigen" -r 90 -g 80 -b 70 -s 8 -w 200 -h 50 -x 0 -y 0 -rt 200 -gt 20 -bt 20 -ti 10 -progr 30 -align left

 ARGS: 
 option/parameter:                meaning:                default:            limitations:
 -t "Text zum Anzeigen"           text to show            "Installing"        255 chars, no " inside, no line breaks, no tabs
 -r 90                            background color RED    255                    0-255
 -g 80                            background color GREEN    207                    0-255
 -b 70                            background color BLUE    0                    0-255
 -s 8                             font size in points        10                    7-24 points
 -w 200                           window width pixels        460                    100-screenwidth
 -h 50                            window height pixels    40                    menu bar height (ie 26pixels)
 -x 60                            window pos X            12                    0 + system window bordersize
 -y 60                            window pos Y            48                    0 + system taskbar bar height. Using 0;0 does not work nice on WM, win may be below taskbar
 -rt 200                          text color RED            0                    0-255
 -gt 20                           text color GREEN        0                    0-255
 -bt 20                           text color BLUE            0                    0-255

 -align center                    text alignment            left                center|left|right

 -ti 10                           timeout to autoclose    0                    no autoclose, min: 1 (second), max: 3600 = one hour

 -progr 10                        show with progress val    0                    no progressbar, max: 100
                                  the progressbar is appended at bottom of textwindow
 -prval                           update progress bar value                    no default, min=1, max=100

 -kill                            kill existing window, exit app

 -m "new message text"            replace text in window                        see -t

Continue reading ‘Mobile development: show a small information window using WIN32 API’ »

Windows Mobile: watch the memory footstep of running processes

Some times ago I posted my remote cpu usage monitor. Now here is a similar tool but for logging the memory. You can now watch the memory usage of processes remotely for example when you test an application.

There are two tools: vmUsage and vmUsageRecvr. You may use the mobile vmUsage alone and just use its logging. The other tool receives the memory status information on a PC and enables long time logging and export to a csv text.

vmusage   memeater-vm   excel-linechart

Continue reading ‘Windows Mobile: watch the memory footstep of running processes’ »

Internet Explorer Mobile – QVGA web site do not scale well to VGA screen

As described in this post, I was looking for a way to get a proper view of pages designed for QVGA screens on devices with higher resolutions like VGA.

1) SAP ITS mobile screen on VGA Internet Explorer Mobile

1) SAP ITS mobile screen on VGA Internet Explorer Mobile

2) SAP ITS mobile screen on VGA display with viewport width=240 and zoom=2

2) SAP ITS mobile screen on VGA display with viewport width=240 and zoom=2

Continue reading ‘Internet Explorer Mobile – QVGA web site do not scale well to VGA screen’ »

Internet Explorer Mobile – To zoom or not to zoom

With Windows Mobile 6.5.3, sorry, Windows Embedded Handheld 6.5.3 we have the Internet Explorer Mobile 6 engine.

weh-version

Although it may look nice for the one or other, the rendering, especially the zoom in and out is unusable for commercial use. The IT departments of Warehouses and Stores designed there mobile web pages for a fixed size layout of 240×320 (QVGA). Using IEM (Internet Explorer Mobile) these pages do not show well. Either they are to small to read or, if zoomed in, the user has to scroll here and there. Not very usable. Event the Fit-To-Screen option does not help.

The predefined viewport or 1024×768 may be good for browsing non-mobile web sites but I was unable to find a suitable setting for mobile sites with a fixed QVGA or VGA layout.

Here comes the tipp found at xda-developers: change the default viewport size to match your needs:

Default:
HKCU\Software\Microsoft\Internet Explorer\Main
Viewport Height = dword:00000258(600)
Viewport Width = dword:00000320(800)

Landscape optimized (VGA)
HKCU\Software\Microsoft\Internet Explorer\Main
Viewport Height = dword:000001e0(480)
Viewport Width = dword:00000280(640)

Portrait optimized (VGA)
HKCU\Software\Microsoft\Internet Explorer\Main
Viewport Height = dword:00000280(640)
Viewport Width = dword:000001e0(480)

I assume you will find these better for commercial use than the desktop settings.

Unfortunately these settings are not used on every windows embedded device. So, you may give it a try and if it works for you, fine. I tested one device and iexplore.exe did not care about these entries. I checked with RegLoggerCE and found that iexplore.exe on that device does not query the above settings. For anyone interested, here is the log file of registry access of iexplore.exe captured with regLoggerCE: [Download not found]