'팁'에 해당되는 글 25건

  1. 2008.03.16 CommsBlog » Blog Archive » More Samsung SGH-i600 Blackjack Info, Tips, Tricks and NES Emulation 3
  2. 2008.01.30 블랙잭 팁 2 가지
  3. 2007.10.10 정말 도움되는 Windows Mobile 팁
  4. 2007.08.30 HTC UNIVERSAL HACK COLLECTION POOL! - xda-developers
  5. 2007.08.30 PPCSG -> How to disable GPRS and MMS
  6. 2007.08.30 SmartPhone Tips
  7. 2007.08.30 Popular Reg Tweaks - SPV-Developers Forums
  8. 2007.08.30 Windows Mobile Registry Tweaks and Hacks - htc
  9. 2007.08.28 Opera 8.60 for PPC 관련 팁
  10. 2007.08.14 블랙잭(SCH-M620,SPH-M6200) 에서 메시지 (POP3)에 Gmail 설정하기
  11. 2007.08.13 XDADeveloperWiki - WM5_Tweaks_Other
  12. 2007.08.13 XDADeveloperWiki - WM5_Tweaks_Performance
  13. 2007.08.10 Jeff Atwood : Samsung Blackjack tips and tricks
  14. 2007.08.06 HowardForums: Your Mobile Phone Community & Resource - Bluetooth Stereo (A2DP) on Qtek 8500
  15. 2007.08.06 WM6 A2DP best settings here - xda-developers
  16. 2007.08.06 Windows CE Developers FAQ 9
  17. 2007.08.03 Bluetooth (A2DP)
  18. 2007.08.01 Wireless DevCenter: Microsoft Smartphone Tips and Tricks 4
  19. 2007.07.31 RegistryNotifyCallback 4
  20. 2007.07.31 The State and Notifications Broker Part I 4
  21. 2007.07.30 HTC Application Unlock Guide
  22. 2007.07.30 Application Unlock Motorola Q for Telus
  23. 2007.07.26 스마트 폰 (SCH-M620,블랙잭)의 레지스트리 만지기 1
  24. 2007.07.26 MOTO-Q 속도 올리는 방법 : 블랙잭 (SCH-M620) 에도 적용 될까?
  25. 2007.07.26 블랙잭 (SCH-M620) 에서 3G 접속을 막는 방법이 TODAYSPPC에 소개되어 있다
블랙잭이야기2008. 3. 16. 16:41

북미의 블랙잭 SGH-i600 에대해서 간단하게 정리된 내용입니다. 국내 블랙잭에는 안되는 기능들도 보이네요.

More Samsung SGH-i600 Blackjack Info, Tips, Tricks and NES Emulation

October 8th, 2007 . by Paul McGuinness

samsung i600 samsung sgh i600

Specification: Samsung SGH-i600 is a HSDPA/Tri-band GSM/GPRS/EDGE Class 10/WiFi Windows Mobile 5 smartphone and with a  QWERTY keyboard, 1.3 Megapixel camera/camcorder, Music player, Bluetooth, Micro SD slot, 218MB ROM and 64MB RAM - Samsung Spec Sheet: [Link]

Official Samsung SGH-i600 User Manual - [Link] - PDF 2.2MB


Hello again.It seems my ‘hacks’ for the i600 are going down a treat, so I thought I would list a few more for everyone…In the UK, the Samsung SGH-i600 (Called the ‘Blackjack’ in the USA) is only provided via Orange. Unfortunately this means that it has the horrible Orange branding [crippleware], and is only running Windows Mobile 5.

The Samsung site allows you to upgrade from WM5 to Windows Mobile 6 via this link: http://www.samsungmobile.com/promotion/i600/index.jspUnfortunately… the UK is not listed (to to Orange… Grrrr…), but if you are from one of the following countries, you can slide on over there and grab some WM6 (well… WM5.2 in new clothes!); Belgium, Bulgaria, Demark, Estonia, Finland, France, Iceland, Latvia, Lithuania, Netherlands, Norway, Russia, Sweden, Switzerland, and the Ukraine.

Apparently, you can override your i600 to another country + language (make sure it’s one you can read!) and then download the appropriate update, get WM6 and then change the country settings back. This is all controlled by the service menu by dialling *#1546792*# and then using the preconfig password *#81230*# - THIS WILL WIPE YOUR PHONE so don’t do this without making a full backup first! Full instructions over at vowe.net; http://vowe.net/archives/008792.html

Keyboard Shortcuts (For the European Model)

Function
Details

Task Manager
Hold Down the [Home] button to show the task manager

Quick Links
Hold in the [Jog Dial] to brings up a editable list of Shortcuts

Quicklist
Pressing the power button brings up the quicklist (Change to Silent etc…)

Voice Assist
Press and hold the “volume up” button on the left side of the phone, near the top to bring up the voice recorder

Custom
You can set the Back button on the side to open whatever app you want when held for a few seconds (by default is ‘Camera’)

Quick “KeyLock” 
Hold down the [End] Key for a few seconds

Quick “Silent Mode”
Hold down then ‘#’ key to toggle Silent mode.

Numeric in TXT
Quickly enter numbers without changing input mode by holding down the according button for a couple of seconds

Page Up/Down in IE
When browsing the internet using Internet Explorer Mobile Edition, use T and V to scroll Page Up / Down

I have found lots of information and hacks here: http://i607.org/ the SGH-i607 is the USA version, but many of the ‘hacks’ work on the European version of this phone

Hidden Applications

Whilst rooting around in the \Windows folder on my phone, I found a series of applications that don’t normally show on the menu. Here is a list of the more interesting ones I found. If you want to use them on a frequent basis, use the ActiveSync explorer to right-click-drag and create a shortcut in the \Start Menu folder for any of these apps.

EXE Name
Details

CamTest_Int, CamTest_Ext
Turns on and shows the Internal (front) or External (rear) cameras. Interestingly, this takes <1sec to initialise, so why does the camera app take so long to load!?

cprog
Appears to show the last call details

instmsgr
MSN Instant Messenger (You could setup a quick shortcut to this instead of having to go through the Internet / MSN / Messenger route…

MySimMessage
Shows SMS Messages that are on the SIM (as opposed to on the Phone)

Playsound
MP£ Test app that allows you to test the Speaker, Earpiece and Headset - Handy for checking your Bluetooth headsets etc

RTCViewer
Shows the internal RTC (Real Time Clock)

SoundTest
Haven’t quite worked this one out… it appears to be a more advanced version of PlaySound

wrlsmgr
Wireless Manager - Top Tip: Set a shortcut to startmenu, then assign to a speed dial (Press Menu when the icon is selected, then choose ‘1 - Menu Shortcut’) - I’ve set mine as speedfial 9, so I just hold down the ‘9′ key for a couple of second to bring up the Wireless manager

TestMode
Hidden App: You need to create a shortcut to the Start Menu to access this, or use something like Resco File Explorer to see it.

This shows *lots* of Engineer stuff (3G, UTMS, GSM Cell Info etc), and appears to let you do (possibly) damaging things to your phone. Only use this if you know what you are doing!


NES Emulation

I found most of this information on i607.org’s NES Page [Link], but here is the simple guide for the UK Version of the Samsung SGH-i600

  1. Download Pocket Nester Plus - http://mobile.surrealnetworks.com/Dash%20Applications/SN%20PocketNesterPlus%20D.cab
  2. Download either All the ROM’s as a 40Mb CAB File (http://surrealnetworks.net/NES%20ROMs/393NESROMS.cab), or the ‘50 Classics’ as a 10Mb CAB File (http://surrealnetworks.net/NES%20ROMs/50%20NES%20Classics.cab) or individual games [HERE]
  3. Install Pocket Nester
  4. Install the ROMS (to your Memory card!)
  5. Install the Pocket Nester Update [Pocket Nester Update] by copying the .exe over the top of the one in the \Program Files\PocketNester (You only need this if you already have an older version)
  6. Open the game, go into Preferences and tick “Associate .NES Files”, also set up all the keys (Try to make them memorable!)
  7. The Open ROM option does not work unless you install tgetfile.dll… this is time-limited, so I suggest just browsing to the ROM Folder and select the Game you want. Nester will automatically load. The ROM’s should be located in \Storage Card\My Documents\ROMs

When playing a game, if you can’t seem to get it to exit, hold down the HOME key, this will bring up the menu.

CommsBlog » Blog Archive » More Samsung SGH-i600 Blackjack Info, Tips, Tricks and NES Emulation

Posted by krsuncom
블랙잭이야기2008. 1. 30. 16:47

삼성 와이즈원폰 설명서에 나와있는 팁입니다.

기존에 많이 공개 되었던 방법인것 같은데.. 블랙잭 MAC 주소 확인은 처음 알게 된 팁입니다.


■블랙잭의MAC주소확인


      홈 스크린 화면에서 *#232338# 를 누릅니다.
      그러면 무선랜카드의MAC Address 가 확인 됩니다.


■블랙잭의포맷방법

      부팅시에 네비게이션위쪽버튼(OK버튼위방향) 과블랙잭우측면의카메라이동메뉴버튼

       2개의버튼을함께누르면  블랙잭을포맷할수있는화면으로이동합니다.





Posted by krsuncom
개발이야기2007. 10. 10. 09:57

원문이라네 : 요기

Tweaks and Hacks

Post registry and software hacks to make your TyTN do even more here.
(Obviously none of these will be supported by either HTC or your local phone service provider. Use these at your own risk.)
Registry Editors:
Mobile Registry Editor
Works with Mobile 5 though developed for older

Change Bluetooth Name Without Changing Owner Name
Normally the name of your device which is displayed when using bluetooth is the owner name.
To change this use a registry editor and browse to
\HCKU\Software\Microsoft\Bluetooth\Settings\Local Name
And change the value of the local name key to what ever you want.
THIS HAS ONLY BEEN TESTED ON MY DEVICE: IMATE JASJAM RUNNING WINDOWS MOBILE 5.0 (build 14955.2.3.0) AKU 2.3
Internet Explorer Navigation
The default behaviour for your device's four-way direction button in Pocket Internet Explorer (PIE) is to jump between hyperlinks/form fields on a web page. To change this behaviour so that the button scrolls the page left, right, up and down, use the following tweak:
\HKLM\Software\Microsoft\Internet Explorer\Navigation\4-Way Nav = 0 (DWORD decimal)
And to re-enable hyperlink/form field navigation:
\HKLM\Software\Microsoft\Internet Explorer\Navigation\4-Way Nav = 1 (DWORD decimal)
NB: You may still jump between links using Tab and Shift-Tab if your device has a built-in hardware keyboard.
WM5: Increase Performance and Speed

Boost Windows Mobile 5 performance by makeing the following changes in the registry...
[HKLM\System\StorageManager\FATFS] CacheSize = 4096 EnableCache = 1
[HKLM\System\StorageManager\Filters\fsreplxfilt] ReplStoreCacheSize = 4096
Default values for all keys are 0. Soft reset for changes to take effect.
Disable Menu Animation

Navigate to HKEY_LOCAL_MACHINE\SYSTEM\GWE\Menu, then change the value of "AniType" from 6 (default) to 0.
This disables the menu animation which helps in speeding up your PocketPC.
Change the Tap and Hold Dots Colours

1) Go to the HKLM\SOFTWARE\Microsoft\Color\ key.
2) Add a Binary value called "40" if it does not already exist.
3) Set the value to "rr gg bb 00" (RGB hex values 00 to FF so "FF 00 000 00" is Red)
SMS Settings

SMS Notification Always On
[HKEY_CURRENT_USER\Software\Microsoft\Inbox\Settings]
"SMSDeliveryNotify"=dword:00000001 ->0 to disable, 1 to enable.
Disable SMS Sent Notification
[HKEY_LOCAL_MACHINE\Software\Microsoft\Inbox\Settings]
"SMSNoSentMsg"=dword:00000001 ->0 to enable, 1 to disable.
Bottom tray icons

Remove the Battery Icon:
[HKEY_LOCAL_MACHINE\Services\Power]
"ShowIcon"=dword:00000000
Remove the Wireless Manager Icon:
[HKEY_LOCAL_MACHINE\Services\WirelessMgr]
"Keep"=dword:00000000
Restore local language support for sliding keyboard after upgrade to a different language ROM

This has been reported not to work, see below for another hack
You need to create Registry value of name "Locale" and type of "String" and data of "Localization ID" within [HKEY_CURRENT_USER\ControlPanel\Keybd]
Localization IDs:
French = 040c
German = 0407
Italian = 0410
Japanese = 0411
Kazakh = 043f
Russian = 0419
Other IDs can be found here: Tweaks and Hacks - htcwikihttp://www.microsoft.com/globaldev/reference/winxp/xp-lcid.mspx.
Some versions of the OS seem to be case sensitive on this value, and if it does not work, try upper case letters. Registry example for say russian kbd:
[HKEY_CURRENT_USER\ControlPanel\Keybd]
"Locale"="0419"
Modification to keyboard hack. The above solution does not work for the Hermes the following new settings are required.

Goto the following registry entry
[HKEY_LOCAL_MACHINE\Software\Oem\Qwerty]
There is a key called 'Layout' and it is in Decimal.
The default value of English ROM is 20409, and Chinese ROM is 20404 (both are in hexadecimal).
The suitable value for German Hermes keyboard is 20407 (132103 in decimal).
Probably Hermes use 20+country ID (409=WWE, 407=German, 404=Trad. Chinese, etc...) format for keyboard layout value.

The above settings does not work with the latest Hermes firmware, the following is required.

[HKEY_CURRENT_USER\keyboard layout\Preload]
"Default"="e0010414"
[HKEY_CURRENT_USER\keyboard layout\Preload\1]
"Default"="e0010414"
[HKEY_LOCAL_MACHINE\Software\Oem\Qwerty]
"Layout"="132116"
The last setting is the same as in the above solution
These settings are for Norwegian keyboard, country code : 0414
Tested on fw. 1.31.502.1
Improve BT A2DP sound quality

[HKLM/Software/Microsoft/Bluetooth/A2DP/Settings]
Add new dword, Value name=BitPool; Value data=48 (Decimal)
Modify, Value name=UseJointStereo; Value data=0 (Decimal, Originally 1)
For BitPool:
Microsoft suggests the following bitpool values for optimal buffer sizes.
30 - Low audio quality
40 - Medium audio quality
48 - High audio quality
58 - Excellent audio quality
Chose one you like. I think 48 is good enough.
For UseJointStereo: use 0 instead of 1, then you got the real stereo.
Show Network Operator Name in today screen

Restoring Today Item: WiFi, BT and Phone Connection Status
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Today\Items] Create "Wireless" use Key "Flags"=dword:00000000
"Options"=dword:00000000
"DLL"="netui.dll"
"Order"=dword:00000000
"Enabled"=dword:00000001
"Type"=dword:00000004
  • Enable clicking on the today plugin above open Comm Manager
[HKEY_LOCAL_MACHINE\ControlPanel\WrlsMgr] Create key "Redirect" "Redirect"= "\Windows\CommManager.exe"
Restore clock on top bar

[HKLM\Software\Microsoft\Shell\]
"ShowTitleBarClock"=1 (enable)
"ShowTitleBarClock"=0 (disable)
PocketIE Cache in storage card

Create these folders:
\Storage Card\Pocket IE\Temporary Internet Files
\Storage Card\Pocket IE\Cookies
\Storage Card\Pocket IE\History
Add the following registry keys, string data type:
[HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders]
"Cache"="\Storage Card\Pocket IE\Temporary Internet Files"
"Cookies"="\Storage Card\Pocket IE\Cookies"
"History"="\Storage Card\Pocket IE\History"
Disable flashing service LEDs

[HKLM\Drivers\BuiltIn\AllLEDMgr]
"Index"=0 Note! Disables vibrating.
Adding disconnect GPRS/UMTS button

To add Disconnect button and a timer display showing how long GRPS is in use for the session: HKLM\ControlPanel\Phone\Flags2 = 16 (DWORD decimal) To have only Disconnect button: HKLM\ControlPanel\Phone\Flags2 = 8 (DWORD decimal) To disable both the Disconnect button and the timer: HKLM\ControlPanel\Phone\Flags2 = 0 (DWORD decimal)
Disable annoying beeps when changing in-call volume

There are actually 3 different sounds in play here: the one at the bottom end of the slider (quietest), the one in the middle posisitions (standard), and the one at the top end of the slider (loudest). These are handled by 3 registry keys: HKCU\ControlPanel\Sounds\LoudestInCallVolume
HKCU\ControlPanel\Sounds\QuietestInCallVolume
HKCU\ControlPanel\Sounds\StandardInCallVolume Within each of these keys the default 'Script' value is 'p' for 'play', change the 'Script' value to blank (erase the 'p').
Change ringtone/vibrate/LED flash characteristics

If you would like more control over how your device rings/vibrates/flashes its LEDs on events, you can can change the Script values of these events.
For example, for an incoming call performing 'activate device, play ringtone, wait 3 seconds, repeat':
HKCU\ControlPanel\Sounds\RingTone0\Script = "apw3r" (REG_SZ string, no quotes)
For performing 'active device, set volume to 33%, play ringtone, set volume to 67%, play ringtone, set volume to 100%, play ringtone (no repeat)':
HKCU\ControlPanel\Sounds\RingTone0\Script = "ac33pc67pc100p" (REG_SZ string, no quotes)
The following are the full codes available to you.
Please note that all the codes are executed simultaneously except after a ringtone play / wait code. E.g. 'v1p' will vibrate and play at the same time, while vibrating for 1 second. But 'pv1' will play the ringtone through all the way first, then start vibrating for 1 second. a = activate device
cN = set volume to N in percentage max volume
fN = flash notification LED for N seconds
p = play ringtone. Note that this will play the ringtone all the way through before continuing with the next code.
r = repeat. Note that this should be the last code in your Script string, if used at all. The repeat will be from the most recent a. So: v3apr will vibrate once then repeat the ring signal.
vN = vibrate for N seconds
wN = wait for N seconds. Note that the device will wait this long before continuing with the next code.

Tweaks and Hacks - htc

Posted by krsuncom
개발이야기2007. 8. 30. 15:36

엄청나게 많은 정보다. 원본은 요기 :HTC UNIVERSAL HACK COLLECTION POOL! - xda-developers

HTC UNIVERSAL HACK COLLECTION POOL!


Dear Friends,
As an one month owner of Htc Universal, i searched the internet a lot and found lots of information. Also this great forum is really helpfull for me to do the rom updates or hacks provided by the experienced members... But i am thinking to open a topic to share what i found with all description... So i want to upload all the cabs and hacks i found, in an ordinary way... Probably most of the hacks which i uploaded here may be given a time ago in these forum or somewhere else... So this topic is aimed to be a collection pool of all the hacks for newbies like me and i will try to update the topic frequently... Any help to me is really great and for any mistake of mine, please forgive me...
Regards and thanks...

HTC UNIVERSAL HACK COLLECTION POOL!
**** NONE OF THE HACKS, UPLOADED IN THIS TOPIC, BELONG TO ME...I HAVE COLLECTED ALL OF THEM FROM THE INTERNET... THANKS GO TO THEIR PROGRAMMERS AND FOUNDERS....
*** AFTER APPLYING HACKS, PLEASE POWER OFF THE PHONE AND WAIT FOR 5 SECONDS AND THEN SOFT RESET...
HARD RESET:
PLEASE DONT FORGET TO BACKUP YOUR IMPORTANT DATA.
PRESS BOTH SOFT KEYS ON THE KEYBOARD AND RESET HOLE WITH STYLUS AT THE SAME TIME TO DO A HARD RESET...
BOOT LOADER MODE(USB/SERIAL):
FIRST DEATTACH SIM AND SD/MMC MEMORY CARD.
DISCONNECT USB CABLE.
PRESS BACKLIGHT BUTTON + POWER BUTTON + RESET HOLE AT THE SAME TIME.
YOU WILL SEE " SERIAL " ON THE SCREEN.
NOW CONNECT USB CABLE TO ENTER " USB " MODE.
PHONE KEYS VIBRATION EFFECT:
With this hack, you can feel the vibrate effect while pressing phone keys...
PHONE KEYS SOUND EFFECT:
With this hack, you can go back to default settings after phone keys vibration effect hack...
SHOW CONTACTS FIRST NAME SURNAME ORDER:
With this hack, you can change the view style of contacts to first name surname. After installation, tap and hold any contact and slect the file as option from the menu...
CHANGE BACKLIGHT KEY COMMAND:
With this hack, you can change the command of back light button to any program other than backlight function...
CLEARTYPE ON FOR PORTRAIT AND LANDSCAPE MODES:
With this hack, you can activate clear type both for portrait and landscape modes...
ACTIVATE PHONE SKIN WITH 3D BUTTONS:
With this hack, you can activate phone skin with 3d buttons in the expense of some memory and speed..
BLUETOOTH VOICE DIAL COMMAND OFF:
With this hack, you can deactivate the launching of voice command program and get opportunity to transfer the playing music directly to bluetooth headset by pressing the voice call button on the bluetooth headset (must be supported by bluetooth headset)...
BLUETOOTH VOICE DIAL COMMAND ON:
With this hack, you can reactivate voice call function over bluetooth headset...
DISABLE SECURITY:
With this hack, you can disable security procedures just after a clean hard reset without extented rom installations...
PERFORMANCE TWEAK HIGH RESOURCES:
With this hack, you will change the all storage caches,audio prioty,soft keyboard sensivity,font cache,glyph cache,deactivate start menu and windows animations with high amount of memory allocations...
PERFORMANCE TWEAK LOW RESOURCES:
With this hack, you will change the all storage caches,audio prioty,soft keyboard sensivity,font cache,glyph cache,deactivate start menu and windows animations with low amount of memory allocations...
WIFI G MODE ON:
With this hack, you can activate the mode for connecting wifi networks only for g protocol but be advised that there is no significant speed improvement over b mode...
WIFI SCAN INTERVAL LOW:
With this hack, you can consume some battery power while wifi is on by lowering the scan interval of wifi networks...
POCKET IE TWEAKS:
With this hack, you can change the parameters of pocket ie.the changes are make fit,zoom to small,search page as google,max request and max connections,cleartype on for ie,pocket ie as msie6.0 ...
ENHANCED FILE DIALOG:
With this Hack, you can enhance the builtin file dialog applet to browse whole the phone easily in the dalog window.just copy all the files in the archive to windows dir and soft reset.After run the file dialog applet from control panel and check the option Exchange standart File Dialog.
SOFT KEY APPLET:
With this hack, you can change the soft key commands.Just copy the file in the archive to windows dir and soft reset.After run the applet from control panel...
DSP ENHANCER -BASS&TREBLE SETTINGS:
With this hack, you can set the level of bass and treble easily via applet in the control panel. Especially you can feel the basss and treble changes by headset... ( Removed! Reported to be not working with Htc Universal )
UNLOCK EXTENDED ROM:
With this hack, you can get extra 10 mb free space in the new mounted storage area called ExtendedROM...Simply after installing cab, just run the ExtROMUNLOCKER from start menu - programs and soft reset.After you can add or delete any file in this new storage space or organize it with the cabs which you want to automatically be installed after hard reset...
HIDE ROTATE ICON FROM TRAY BAR:
With this hack, you can hide rotate icon from tray bar...
SHOW ROTATE ICON ON TRAY BAR:
With this hack, you can show rotate icon on tray bar...
HIDE WIRELESS MANAGER ICON FROM TRAY BAR:
With this hack, you can hide wireless manager icon from tray bar...
SHOW WIRELESS MANAGER ICON ON TRAY BAR:
With this hack, you can show wireless manager icon on tray bar...
HIDE BATTERY ICON FROM TRAY BAR BATTERY:
With this hack, you can hide the battery icon from tray bar...
SHOW BATTERY ICON ON TRAY BAR:
With this hack, you can show the battery icon on the tray bar...
ACTIVATE TRUE VGA MODE:
With this hack, you can activate true vga mode (96 dpi instead of 192 dpi). Installation information included.
WM5 NEW MENU
With this hack, you can change one of the soft keys as a new menu like in windows mobile 2003...
DISABLE GPRS AUTO CONNECT
With this hack, you can disable gprs autoconnect and then connect manually whenever you want...
BLUETOOTH ICON ON TRAY BAR
With this hack, you can see and change the status of bluetooth from tray icon.
***UPDATE: 03.03.2006***
TUNE CLEAR TYPE LEVEL:
With this hack, you can tune the level of clear type from high to low or from low to high. Very usefull when using true vga mode. Install and run the program from start menu...
POCKETIE BLANK HOME PAGE
With this hack, pocketie will start with a blank home page...
DATE+TIME ON TITLE BAR
With this hack, date and time is available on the title bar...

HTC UNIVERSAL HACK COLLECTION POOL! - xda-developers

Posted by krsuncom
개발이야기2007. 8. 30. 15:32

Source: http://www.ppcsg.com/index.php?showtopic=49904 

Just fiddled with my mini's registry and found that the GPRS can be disabled. This would be pretty useful if u:
1) have absolutely no use for GPRS.
2) have no intention to use GPRS.
3) have been chalking up huge bills for GPRS.
Anyway, if u wanna rid urself of GPRS:
1) Open ur registry editor
2) Go to the key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ConnMgr\Providers\
{7C4B7A38-5FF7-4bc1-80F6-5DA7870BB1AA}\Connections
\IDEAS Internet (GPRS)\Enabled
3) Edit the key 'Enabled' by double-tapping or otherwise.
4) Change its DWORD Data from '1' to '0'.
5) Go to the key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ConnMgr\Providers\
{7C4B7A38-5FF7-4bc1-80F6-5DA7870BB1AA}\Connections
\IDEAS WAP (GPRS)\Enabled
6) Edit the key 'Enabled' by double-tapping or otherwise.
7) Change its DWORD Data from '1' to '0'.
8) Soft-reset.
If u really really hate GPRS, u might as well rid urself of the MMS function as well:
1) Open ur registry editor
2) Go to the key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ConnMgr\Providers\
{7C4B7A38-5FF7-4bc1-80F6-5DA7870BB1AA}\Connections
\IDEAS MMS\Enabled
3) Edit the key 'Enabled' by double-tapping or otherwise.
4) Change its DWORD Data from '1' to '0'.
5) Soft-reset.

PPCSG -> How to disable GPRS and MMS

Posted by krsuncom
개발이야기2007. 8. 30. 15:15

원본은 요기

SmartPhone Tips

Source: http://67.122.16.97/lars/misc/smartphone/smartphonetips.txt

Disable Guest Mode
On the PC to disable guest mode
Open up regedit..
Start-Run-Regedit and click OK.
Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows CE Services

and change the value of GuestOnly registery to 0 or delete it..
-----------------------------------------

Good Software
  • A registry editor like PHMregedit or Resco's
  • Westek ClearVue suite for viewing Word, Excel, PDF, Powerpoint and Images.
  • Zsoft PTab spreadsheet program. This is a full Excel spreadsheet program.
  • O]ios ToDo List replaces the worthless task functionality with a real Outlook-like version.
  • Resco Explorer is a better file explorer
  • Orneta Notepad. A really good text editor. See also Orneta ftp.
  • TCPMP with the AAC plugin a truly amazing media player
  • FoneDB from Syware. Not currently working on the Q but an ODBC customizable database with two way sync. Data can be read by MSAccess.
  • PDASyncserver Set it up to Sync files/folders between the smartphone and PC. Unfortunately it requires a manual key press to initiate the sync after connecting the phone.

Useful registry entries/locations:

\hkey_current_user\security LockTimeout Allows you to set custom timeouts beyond 60min.
One minute is 60000. So 10 hours is 36,000,000. Long enough to lock overnight but
not be bothersome during the day.
\hkey_current_user\controlpanel Lockedtimeout Sets the amount of time the screen stays on
when the phone is locked. Default is a short 2 seconds. Browse around the Control
Panel section for lots of other useful ones.

\hkey_classes_root is where the file associations are. Look for entries like
\hkey_classes_root\xlsfile\shell\open\command or opendoc. See the existing entries and
it will be obvious how to modify them. Some programs like "%1" param.
Others just %1. Ignore .xls entries as they refer to xlsfile

No Startup Sound
\HKEY_CURRENT_USER\ControlPanel\Sounds\SystemStart \Sound
Change
\Windows\Piano.wav to \Windows\*none*

No Camera Click Sound
\HKEY_LOCAL_MACHINE\System\Pictures\Camera\OEM\Sou ndFile
Change the string/value:
\windows\shuttersound_02_secs.wav
to say:
\windows\*none*

Making the scrollbars smaller (Vert. and Horz.)

1) Go to HKey_LOCAL_MACHINE\SYSTEM\GWE\
2) Adjust the following values
cyHScr : Horizontal Scrollbars
Height in pixels (default is 6, set it to 3)
cxVScr : Vertical Scrollbars
Width in pixels (default is 6, set it to 3)
3) Soft-reset

Speed hack

1) Navigate to HKEY_LOCAL_MACHINE\SYSTEM\GDI\GLYPHCACHE
-> change limit from 16384 to 32768

2) Navigate to HKEY_LOCAL_MACHINE\SYSTEM\STORAGEMANAGER\FATFS
-> change cachesize to 4096

To free up memory

To free up a bunch of memory on your phone perform the following to move the Cache, Cookies, and History to your storage card. After doing so, you must use that storage card when using Pocket Inernet Explorer. You can however create the same folders on each memory card that you use.
Step 1.
Using File Explorer in ActiveSync or the File Manager on your smartphone, create the following folders on the root of your Storage Card.

\ietemp\cache
\ietemp\cookies
\ietemp\history

Step 2.
Fire up the registry editor on your phone and navigate to the following key.

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders

You will need to edit the following values.

Cache Change Value Data to \Storage Card\ietemp\cache
Cookies Change Value Data to \Storage Card\ietemp\cookies
History Change Value Data to \Storage Card\ietemp\history

Reboot your phone.

Step 2.
Next, fire up your File Manager and navigate to \Windows\Profiles\Guest and delete the \cache, \cookies, and\history, folders.

If they do not delete then double check your regedits. To verify that it is working, visit a website with PIE and then check your new folders on the storage card for contents.


Move Email and Attachments to Storage Card

Written by Tony Leone
Monday, 16 January 2006
You can free up even more memory on your phone by moving all of your downloaded mail and attachments to your Storage Card.
Step 1.
Using the file manager in activesync, create the following folders on your Storage Card.

\MAPI
\MAPI\ATTACHMENTS
(You can actually name them whatever you want, "Inbox" for example.)

Step 2. Now browse to \Windows\Messaging (SmartPhone) or \Windows\MAPI (PocketPC)
If you want to save all of your existing mail, move everything in this directory to the new ones on your Storage Card.

Step 3. Now fire up your registry editor and navigate to the following.

[ HKEY_CURRENT_USER\Software\Microsoft\MAPI ]
Then create the following keys.
"AttachPath" (Value)= \Storage Card\MAPI\Attachments
"PropertyPath" (Value)= \Storage Card\MAPI
Step 4. Reboot your phone and then goto your inbox. If you can see all of your mail then mission accomplished. Double check your attachments as well.


Page Up and Page Down in IE

Key mapping for "Page Up" and "Page Down" in Internet Explorer

1. Open your favorite registry editor then navigate to HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer

2. Create a new key 'KeyMaps' (without the quotes)

3. Under KeyMaps, create 2 new DWORD values:

50 with a value data 1 (this will make key "2" Page Up)

56 with a value data 2 (this will make key "8" Page Down)

I created 2 more DWORD values:

52 with a value date 5 (this will make key "4" Page Left)

54 with a value date 6 (this will make key "6" Page Right)

The key name is the keycode you want. 50 = Key 2, 56 = Key 8, 52 = Key4, and 54 = Key 6.

Other DWORD values available are:

1 - Page Up
2 - Page Down
3 - Top
4 - Bottom
5 - Left
6 - Page Rignt
7 - Horizontal Top
8 - Horizontal Down
9 - Default Layout
10 - Desktop Layout
11 - One Column Layout
12 - Full Screen Toggle
13 - Show Pictures Toggle

Keycodes Values for 0-9: 48='0', 49='1', 50='2', 51='3', 52='4', 53='5', 54='6', 55='7', 56='8', 57='9'.

4. Exit registry editor once you have mapped it to your favorite keys.
I use:
49 3, 50 1, 52 5, 54 6, 55 4, 56 2, 69 1, 70 6, 83 5, 87 3, 88 2, 90 4

CREDIT: Gadget & the fine people at modaco.com forums

69 with a value data 1 (this will make key "E or 2" Page Up)

70 with a value data 6 (this will make key "F or 6" Page Right)

83 with a value date 5 (this will make key "S or 4" Page Left)

88 with a value date 2 (this will make key "X or 8" Page Down)

Adding Password Protection Before Using Data Connection

\HKEY_LOCAL_MACHINE\COMM\ConnMgr\Providers(7C4B7A38-5FF7-4BC1-80F6-5DA7870BB1AA)Connections

If you want it to require you to put a password in when you login on to the internet d the following: inside the broadband and express folder change requirepw from 0 to 1, it will require u to put in a password. Perform the same action in the following Keys.

&
\HKEY_LOCAL_MACHINE\COMM\ConnMgr\Providers(EF0974C-4C98FF6-AEF805DC0E8E)VZW BROWSER
&
HKEY_LOCAL_MACHINE\SOFTWARE\MOTOROLA\MMS\PROFILES\VZW MMS

CREDIT: grigsby1

SmartPhone Tips

Posted by krsuncom
개발이야기2007. 8. 30. 14:37

유용한 정보가 될것같다 : 원본은 요기

Popular Reg Tweaks


Here's a list of some of the more popular reg tweaks taken from my Longhrn 4015 theme:

Quote:

[RegData] ; registry key list
HKLM,Software\Microsoft\Splash Screen, CarrierBitmap,, \Storage\Longhorn\boot2.gif
HKLM,Software\Microsoft\Splash Screen, CarrierShutdownBitmap,, \Storage\Longhorn\boot2.gif
HKLM,Software\Microsoft\Splash Screen, MSBitmap,, \Storage\Longhorn\boot1.gif
HKLM,Software\Microsoft\Splash Screen, MSShutdownBitmap,, \Storage\Longhorn\boot1.gif
HKLM,Software\Microsoft\Windows Media Player\Parameters,SkinDir,,"\Storage\WMP\"
HKLM,Software\Microsoft\Windows Media Player\Parameters,SkinFile,,wmplayer.skn
HKLM,Software\Microsoft\Shell\Rai\:CallAlert, BKBitmapFile,,\Storage\Longhorn\call.gif
HKLM,Software\Microsoft\Shell\Rai\:ErrorBox, BKBitmapFile,, \Storage\Longhorn\exclamation.gif
HKLM,Software\Microsoft\Shell\Rai\:ExclamationBox, BKBitmapFile,, \Storage\Longhorn\exclamation.gif
HKLM,Software\Microsoft\Shell\Rai\:InformationBox, BKBitmapFile,, \Storage\Longhorn\information.gif
HKLM,Software\Microsoft\Shell\Rai\:QuestionBox, BKBitmapFile,, \Storage\Longhorn\question.gif
HKLM,Software\Microsoft\Shell\Rai\:VolDlg, BKBitmapFile,, \Storage\Longhorn\volume.gif
HKLM,Software\Microsoft\Shell\Rai\:MSCPROG, BannerImage,, \Storage\Longhorn\incall.gif
HKLM,Software\Microsoft\Shell\Rai\:MSCPROG, BKBitmapFile,, \Storage\Longhorn\startmenu.gif
HKLM,Software\Microsoft\Shell\Rai\:MSCdial, BannerImage,, \Storage\Longhorn\dial.gif
HKLM,Software\Microsoft\Shell\Rai\:MSCdial, BKBitmapFile,, \Storage\Longhorn\startmenu.gif
HKLM,Software\Microsoft\Shell\Rai\:MSClog, BKBitmapFile,, \Storage\Longhorn\startmenu.gif
HKLM,Software\Microsoft\Shell\Rai\:MSStart, BKBitmapFile,, \Storage\Longhorn\startmenu.gif
HKLM,Software\Microsoft\Shell\Rai\:MSCONTACTS, BKBitmapFile,, \Storage\Longhorn\contacts.gif
HKLM,Software\Microsoft\Shell\Rai\:MSSYNCAPP, BKBitmapFile,, \Storage\Longhorn\async.gif
HKCU,ControlPanel\Home, BgImage,, ""
HKCU,ControlPanel\Home, ColorScheme,, ""
HKCU,ControlPanel\Home, Scheme,, \Storage\Application Data\Home\LH2.home.xml
HKCU,ControlPanel\Sounds\SystemStart, Sound,, \Storage\Application Data\Sounds\start.wav
HKCU,ControlPanel\Sounds\SystemStart, Script,, ap
HKCU,ControlPanel\Sounds\MenuCommand, Script,, av0p
HKCU,ControlPanel\Sounds\MenuPopup, Script,, av0p
HKCU,ControlPanel\Sounds\Ringtone0, Script,, av0pr
HKCU,ControlPanel\Sounds\Ringtone0, Sound,, \Storage\Application Data\Sounds\GiveMeAReason.wav
HKCU,ControlPanel\Sounds\E-mail, Script,, av0p
HKCU,ControlPanel\Sounds\E-mail, Sound,, \Storage\Application Data\Sounds\gotmail10.wav
HKCU,ControlPanel\Sounds\SMS, Script,, av0p
HKCU,ControlPanel\Sounds\SMS, Sound,, \Storage\Application Data\Sounds\gotmail10.wav
HKCU,ControlPanel\Sounds\VoiceMail, Script,, av0p
HKCU,ControlPanel\Sounds\VoiceMail, Sound,, \Storage\Application Data\Sounds\gotmail10.wav
HKCU,ControlPanel\Sounds\SystemQuestion, Script,, av0p
HKCU,ControlPanel\Sounds\SystemQuestion, Sound,, \Storage\Application Data\Sounds\confirm.wav
HKCU,ControlPanel\Sounds\SystemHand, Script,, av0p
HKCU,ControlPanel\Sounds\SystemHand, Sound,, \Storage\Application Data\Sounds\BreakYourself.wav
HKCU,ControlPanel\Sounds\SystemExclamation, Script,, av0p
HKCU,ControlPanel\Sounds\SystemExclamation, Sound,, \Storage\Application Data\Sounds\BreakYourself.wav
HKCU,ControlPanel\Sounds\SystemAsterisk, Script,, av0p
HKCU,ControlPanel\Sounds\SystemAsterisk, Sound,, \Storage\Application Data\Sounds\kick_a.wav
HKCU,ControlPanel\Sounds\SystemDefault, Script,, av0p
HKCU,ControlPanel\Sounds\SystemDefault, Sound,, \Storage\Application Data\Sounds\kick_a.wav
HKCU,ControlPanel\Sounds\Warning, Sound,, \Storage\Application Data\Sounds\BreakYourself.wav
HKCU,ControlPanel\Sounds\Reminder, Script,, av0pr
HKCU,ControlPanel\Sounds\Reminder, Sound,, \Storage\Application Data\Sounds\alarm.wav
HKCU,ControlPanel\Sounds\Clock, Script,, av0pr
HKCU,ControlPanel\Sounds\Clock, Sound,, \Storage\Application Data\Sounds\alarm.wav
HKLM,SOFTWARE\Microsoft\RIL\OperatorNames, 23410,, Longhorn
HKLM,SOFTWARE\Microsoft\RIL\OperatorNames, 23433,, Longhorn
HKLM,Ident, Name,, Longhorn
HKCR,exefile,editflags,0x00010001,65536
HKLM,SOFTWARE\Microsoft\FontPath, FontPath,, \Storage\Windows\Fonts

Popular Reg Tweaks - SPV-Developers Forums

Posted by krsuncom
개발이야기2007. 8. 30. 14:24

원본: weaks and Hacks - htc

Tweaks and Hacks

Post registry and software hacks to make your TyTN do even more here.
(Obviously none of these will be supported by either HTC or your local phone service provider. Use these at your own risk.)
Registry Editors:
Mobile Registry Editor
Works with Mobile 5 though developed for older

Change Bluetooth Name Without Changing Owner Name
Normally the name of your device which is displayed when using bluetooth is the owner name.
To change this use a registry editor and browse to
\HCKU\Software\Microsoft\Bluetooth\Settings\Local Name
And change the value of the local name key to what ever you want.
THIS HAS ONLY BEEN TESTED ON MY DEVICE: IMATE JASJAM RUNNING WINDOWS MOBILE 5.0 (build 14955.2.3.0) AKU 2.3
Internet Explorer Navigation
The default behaviour for your device's four-way direction button in Pocket Internet Explorer (PIE) is to jump between hyperlinks/form fields on a web page. To change this behaviour so that the button scrolls the page left, right, up and down, use the following tweak:
\HKLM\Software\Microsoft\Internet Explorer\Navigation\4-Way Nav = 0 (DWORD decimal)
And to re-enable hyperlink/form field navigation:
\HKLM\Software\Microsoft\Internet Explorer\Navigation\4-Way Nav = 1 (DWORD decimal)
NB: You may still jump between links using Tab and Shift-Tab if your device has a built-in hardware keyboard.
WM5: Increase Performance and Speed

Boost Windows Mobile 5 performance by makeing the following changes in the registry...
[HKLM\System\StorageManager\FATFS] CacheSize = 4096 EnableCache = 1
[HKLM\System\StorageManager\Filters\fsreplxfilt] ReplStoreCacheSize = 4096
Default values for all keys are 0. Soft reset for changes to take effect.
Disable Menu Animation

Navigate to HKEY_LOCAL_MACHINE\SYSTEM\GWE\Menu, then change the value of "AniType" from 6 (default) to 0.
This disables the menu animation which helps in speeding up your PocketPC.
Change the Tap and Hold Dots Colours

1) Go to the HKLM\SOFTWARE\Microsoft\Color\ key.
2) Add a Binary value called "40" if it does not already exist.
3) Set the value to "rr gg bb 00" (RGB hex values 00 to FF so "FF 00 000 00" is Red)
SMS Settings

SMS Notification Always On
[HKEY_CURRENT_USER\Software\Microsoft\Inbox\Settings]
"SMSDeliveryNotify"=dword:00000001 ->0 to disable, 1 to enable.
Disable SMS Sent Notification
[HKEY_LOCAL_MACHINE\Software\Microsoft\Inbox\Settings]
"SMSNoSentMsg"=dword:00000001 ->0 to enable, 1 to disable.
Bottom tray icons

Remove the Battery Icon:
[HKEY_LOCAL_MACHINE\Services\Power]
"ShowIcon"=dword:00000000
Remove the Wireless Manager Icon:
[HKEY_LOCAL_MACHINE\Services\WirelessMgr]
"Keep"=dword:00000000
Restore local language support for sliding keyboard after upgrade to a different language ROM

This has been reported not to work, see below for another hack
You need to create Registry value of name "Locale" and type of "String" and data of "Localization ID" within [HKEY_CURRENT_USER\ControlPanel\Keybd]
Localization IDs:
French = 040c
German = 0407
Italian = 0410
Japanese = 0411
Kazakh = 043f
Russian = 0419
Other IDs can be found here: Tweaks and Hacks - htcwikihttp://www.microsoft.com/globaldev/reference/winxp/xp-lcid.mspx.
Some versions of the OS seem to be case sensitive on this value, and if it does not work, try upper case letters. Registry example for say russian kbd:
[HKEY_CURRENT_USER\ControlPanel\Keybd]
"Locale"="0419"
Modification to keyboard hack. The above solution does not work for the Hermes the following new settings are required.

Goto the following registry entry
[HKEY_LOCAL_MACHINE\Software\Oem\Qwerty]
There is a key called 'Layout' and it is in Decimal.
The default value of English ROM is 20409, and Chinese ROM is 20404 (both are in hexadecimal).
The suitable value for German Hermes keyboard is 20407 (132103 in decimal).
Probably Hermes use 20+country ID (409=WWE, 407=German, 404=Trad. Chinese, etc...) format for keyboard layout value.

The above settings does not work with the latest Hermes firmware, the following is required.

[HKEY_CURRENT_USER\keyboard layout\Preload]
"Default"="e0010414"
[HKEY_CURRENT_USER\keyboard layout\Preload\1]
"Default"="e0010414"
[HKEY_LOCAL_MACHINE\Software\Oem\Qwerty]
"Layout"="132116"
The last setting is the same as in the above solution
These settings are for Norwegian keyboard, country code : 0414
Tested on fw. 1.31.502.1
Improve BT A2DP sound quality

[HKLM/Software/Microsoft/Bluetooth/A2DP/Settings]
Add new dword, Value name=BitPool; Value data=48 (Decimal)
Modify, Value name=UseJointStereo; Value data=0 (Decimal, Originally 1)
For BitPool:
Microsoft suggests the following bitpool values for optimal buffer sizes.
30 - Low audio quality
40 - Medium audio quality
48 - High audio quality
58 - Excellent audio quality
Chose one you like. I think 48 is good enough.
For UseJointStereo: use 0 instead of 1, then you got the real stereo.
Show Network Operator Name in today screen

Restoring Today Item: WiFi, BT and Phone Connection Status
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Today\Items] Create "Wireless" use Key "Flags"=dword:00000000
"Options"=dword:00000000
"DLL"="netui.dll"
"Order"=dword:00000000
"Enabled"=dword:00000001
"Type"=dword:00000004
  • Enable clicking on the today plugin above open Comm Manager
[HKEY_LOCAL_MACHINE\ControlPanel\WrlsMgr] Create key "Redirect" "Redirect"= "\Windows\CommManager.exe"
Restore clock on top bar

[HKLM\Software\Microsoft\Shell\]
"ShowTitleBarClock"=1 (enable)
"ShowTitleBarClock"=0 (disable)
PocketIE Cache in storage card

Create these folders:
\Storage Card\Pocket IE\Temporary Internet Files
\Storage Card\Pocket IE\Cookies
\Storage Card\Pocket IE\History
Add the following registry keys, string data type:
[HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders]
"Cache"="\Storage Card\Pocket IE\Temporary Internet Files"
"Cookies"="\Storage Card\Pocket IE\Cookies"
"History"="\Storage Card\Pocket IE\History"
Disable flashing service LEDs

[HKLM\Drivers\BuiltIn\AllLEDMgr]
"Index"=0 Note! Disables vibrating.
Adding disconnect GPRS/UMTS button

To add Disconnect button and a timer display showing how long GRPS is in use for the session: HKLM\ControlPanel\Phone\Flags2 = 16 (DWORD decimal) To have only Disconnect button: HKLM\ControlPanel\Phone\Flags2 = 8 (DWORD decimal) To disable both the Disconnect button and the timer: HKLM\ControlPanel\Phone\Flags2 = 0 (DWORD decimal)
Disable annoying beeps when changing in-call volume

There are actually 3 different sounds in play here: the one at the bottom end of the slider (quietest), the one in the middle posisitions (standard), and the one at the top end of the slider (loudest). These are handled by 3 registry keys: HKCU\ControlPanel\Sounds\LoudestInCallVolume
HKCU\ControlPanel\Sounds\QuietestInCallVolume
HKCU\ControlPanel\Sounds\StandardInCallVolume Within each of these keys the default 'Script' value is 'p' for 'play', change the 'Script' value to blank (erase the 'p').
Change ringtone/vibrate/LED flash characteristics

If you would like more control over how your device rings/vibrates/flashes its LEDs on events, you can can change the Script values of these events.
For example, for an incoming call performing 'activate device, play ringtone, wait 3 seconds, repeat':
HKCU\ControlPanel\Sounds\RingTone0\Script = "apw3r" (REG_SZ string, no quotes)
For performing 'active device, set volume to 33%, play ringtone, set volume to 67%, play ringtone, set volume to 100%, play ringtone (no repeat)':
HKCU\ControlPanel\Sounds\RingTone0\Script = "ac33pc67pc100p" (REG_SZ string, no quotes)
The following are the full codes available to you.
Please note that all the codes are executed simultaneously except after a ringtone play / wait code. E.g. 'v1p' will vibrate and play at the same time, while vibrating for 1 second. But 'pv1' will play the ringtone through all the way first, then start vibrating for 1 second. a = activate device
cN = set volume to N in percentage max volume
fN = flash notification LED for N seconds
p = play ringtone. Note that this will play the ringtone all the way through before continuing with the next code.
r = repeat. Note that this should be the last code in your Script string, if used at all. The repeat will be from the most recent a. So: v3apr will vibrate once then repeat the ring signal.
vN = vibrate for N seconds
wN = wait for N seconds. Note that the device will wait this long before continuing with the next code.

Tweaks and Hacks - htc

'개발이야기' 카테고리의 다른 글

SmartPhone Tips  (0) 2007.08.30
블랙잭에서 SD를 내문서로 사용하기  (0) 2007.08.30
Popular Reg Tweaks - SPV-Developers Forums  (0) 2007.08.30
Virtual-Key Codes  (4) 2007.08.29
Opera 8.60 for PPC 관련 팁  (0) 2007.08.28
Accessing the Internet by E-mail FAQ  (3) 2007.08.18
Posted by krsuncom
개발이야기2007. 8. 28. 12:47

원본 : Opera 8.60 for PPC 

Guide for Opera for Pocket PC by ResearchWizard

your web, your choice

goto index

[logo]

View with Opera!

Guide for Opera 8.60 for Windows Mobile, Pocket PC


collected by ResearchWizard

[logo]

Change log

11. September 2006 - Version 1: initial version

content

  1. introduction
  2. general
  3. view modes and screen width
  4. transfer bookmarks
  5. customize Opera Mobile
  6. Opera files and main memory
  7. links
  8. off topic: free software for PPC

introduction

[logo]

This is my collection of tips and hints towards Opera 8.60 for Windows Mobile, Pocket PC (in the following text called Opera Mobile).

Please provide feedback towards the tips and additional solutions with a post in the >>> forum thread ... <<< For general feedback not related to the tips (smilies, praise, resentment, pagedesign etc) please leave a >>> comment in my blog  <<<

If you have a problem not related to the tips in this guide please search the >>> Forum for Opera Mobile <<< and start your own post if it is a new topic. Or you can provide feedback in this >>> thread for Opera Mobile 8.6 <<<

This presentation is based on a template generated with Opera Show Generator 1.0. I added the content as XHTML using the German (X)HTML-text-editor Scribe! and I tweaked the CSS a little bit. Choose Opera, press F11 and enjoy :-)

The text should be well readable in any browser, but only Opera is capable of all the goodies. Besides projection especially print layout is really nice in Opera. Firefox manages at least the numbering. Don't ask about stupid IE (but it should be no problem to just read the text).

General

  • Help pages are on the lower half of the start page
  • Edit your startpage (start.html) to get fast access to top links
  • There is no menu Edit but context menus (click and hold) and default Windows shortcuts on (virtual) keyboard work as well
  • Exit Opera: Menu-Tools-Exit, STRG+Q on (virtual) keyboard, automatically by Windows Mobile, via task manager, with reset

General

  • Opera:cache (in the adress-bar) shows the content of the cache, Opera:history the links in history (Action - Go to - History is displayed different) and Opera:about shows the version
  • Save images (yet there is not built in feature): View the images in \Application Data\Opera\cache4 with an image viewer and copy files with a file explorer (easier with cleared cache).
  • There are some bookmarklets working with Opera Mobile, e.g. disable external CSS, see Mayo Kyomoto's (borbis) blog
  • There is no Flash support yet, but there is hope

View modes

Fit to width on Opera Mobile is an automatic mode switching between Small Screen Rendering (SSR, Shift+F11 on Desktop Opera) and Medium Screen Rendering (MSR, Fit to width on Desktop Opera) depending on screen width.

  • QVGA(320x240px)-Portrait + Fit to width =SSR=One Column View
  • Landscape or VGA(640x480px)-Portrait + Fit to width = MSR
  • Menu - Display - Desktop = Desktop Screen Rendering
    (with horizontal scrollbars)
  • Menu - Display - One Column forces Small Screen Rendering

Using Zoom can change the behaviour of fit to width. An explicit media=handheld CSS with the page will probably switch to SSR.

With the setting Fit to width on my iPAQ (QVGA 320*240px) in portrait mode SSR is used (I could force Desktop view with the setting View - Desktop) and switching to landscape mode MSR is used (I could force SSR with the setting View - One Column).

Transfer Bookmarks

Opera Mobile and Desktop Opera use almost the same bookmark format. Import and export work fluently with one visible difference:

(Re-)Importing bookmarks into Desktop Opera will lead to "=" in front of the bookmarks name: "=Opera homepage" instead of "Opera homepage". Opera Mobile makes "==" out of a single "=".

Exporting bookmarks from Desktop Opera and use them in Opera Mobile works without drawbacks. You can export (all or selected, see 3+4 on next slide) bookmarks from Desktop Opera and replace opera6.adr in \Application Data\Opera\

You can try third party tools like the Bookmark Manager or Bookmarkbridge, but there are more difficulties besides "==": no direct file-access via ActiveSync, Opera Mobile has to be closed and there are no entries for icon and last visited.

How to import bookmarks from Pocket IE

  1. Copy [mobile device]\Windows\Favorites to a desktop folder
  2. Import this folder to Desktop Opera (optional: organizing)
  3. Menu: Bookmarks - Manage bookmarks - (select bookmarks) - right click: File - Save selected as
  4. Copy the generated opera6.adr to \Application Data\opera\

The procedure should be pretty similar to import bookmarks from other browsers.

Step by step instructions are in the handout to this slide (not visible in projection mode).

Step by step instructions to transfer bookmarks from PIE

All following steps use Desktop Windows, with access to the mobile device in Windows Explorer with Active Sync:

  1. Windows Explorer: copy the folder with the Favorites from PIE [mobile device]\Windows\Favorites to any place on your Desktop PC (you have to remember it, for example you can copy it to the Desktop)
    Alternative: if you synchronize your Favorites you can skip 1 and instead look for the place they are stored on the desktop (something like c:\documents and settings\[your user name]\favorites\mobile favorites)
  2. Desktop Opera: File - Import and Export - Import Internet Explorer Favorites - (select the folder with the PIE favorites from step 1) - OK
    Info: The bookmarks are imported into a new folder with the name "Internet Explorer Favorites" (the new folder is most probable a subfolder of the folder you have been before, e.g. in bookmark panel) and the number given is number of bookmarks + number of folders including the generated one, so if there is only one bookmark the number is 2 (one bookmark and one generated folder "Internet Explorer Favorites").
  3. Desktop Opera: Open Bookmarks Panel (e.g. Strg+2) OR Manage Bookmarks View (Menu Bookmarks - Manage Bookmarks) select the files in the imported folder "Internet Explorer Favorites" (or select all the bookmarks and folders you like to have for your Opera Mobile). Right click - file - save selected as ... (choose a place to save, keep the name opera6.adr)
    Info: If you right click directly on the folder "Internet Explorer Favorites" this folder will be an useless subfolder on your Opera Mobile (Action - Go to - Bookmarks - ("Internet Explorer Favorites" -) your bookmarks)
    Tip: Before exporting you can organize your bookmarks in Desktop Opera, import additional bookmarks from IE, Netscape/Firefox, Konqueror or another Opera installation (e.g. [mobile device]\application data\opera\opera6.adr from Opera Mobile) the same way or copy additional bookmarks from your Desktop Opera into this bookmark folder).
  4. Windows Explorer: Make a backup of your original opera6.adr on [mobile device]\application data\opera\ and copy the exported opera6.adr into this folder while Opera Mobile is closed

Index of customizations

Customizing your Opera Mobile is similar (but more limited) to customizing Desktop Opera.

Easy: Settings

  • Some important settings are in Menu - Tools - Settings
  • Help is in Menu - Tools - Help - Using the browser - Settings and History and on the default Opera Mobile startpage: Opera help - Using the browser - Settings and History (both display the same file)
  • ...

Edit your startpage

Even without knowledge of HTML you can add your favorite links to your startpage.

  • location: [mobile device]\Application Data\Opera\startpage\home.html
  • syntax: <li><a href="[link adress]">[shown name]</a></li>
  • example: <li><a href="http://mobile.opera.com/">Opera Portal</a></li>

Open home.html with an text editor (either on the PPC or copy it to your desktop computer and use e.g. notepad) and replace [link adress] (copy and paste from browser adress bar) and [shown name]. For additional links just duplicate a whole line.

Of course you can change the content and design of the whole page.

Edit the skin

You can change the icons in the skin-file like on Desktop Opera. I haven't managed to change the color for the toolbars. The colors are controlled by Windows Mobile (at least on WM2003SE) and I have no idea why there are colors defined in default skin.ini at all.

  • location: [mobile device]\Application Data\Opera\skin\ standard_skin.zip

To make your own skin see the guide for Desktop Opera. The buttons can be smaller to spare room or bigger for easier use without stylus.

More proof of concept than beautiful you can download my gray-scale_standard_skin.zip. Instructions: download and copy the file to \Application Data\Opera\skin, backup the default standard_skin and rename the new file to standard_skin.zip

Edit input.ini (1) - syntax and buttons

The input.ini of Opera Mobile is similar to keyboard.ini on Desktop Opera. The actions are defined in several sections like [Browser Widget] for actions on the web page and [WinCE Application] for actions on browser level.

  • syntax: [button OR key] = [action]
  • example: Left = Navigate left

For most PocketPCs the most useful buttons are the ones on the D-PAD: Left, Right, Up, Down and Enter. Other keys (1...9, A...Z, Tab, Space etc.) can be accessed with virtual or real (external) keyboard.

All default sections are in the handout to this slide (not visible in projection mode).

Sections in input.ini:

[Browser Widget]
for actions on web pages (page has to have focus)
Examples: Navigate down, Scroll up, Page down, Focus form
[WinCE Application]
for actions with the Opera Mobile browser application
Examples: Cycle to next window, Enter fullscreen, Open url
[Widget Container]
for actions in dialog boxes (dialog has to have focus)
Examples: Focus next radio widget, Focus previous widget
[Form]
for actions in form fields (form has to have focus)
Examples: Focus form
[Button Widget]
for actions on buttons (button has to have focus e.g. by clicking on it)
Examples: Click button
[Radiobutton Widget]
for actions on radio buttons (radio button has to have focus)
Examples: Click button
[Checkbox Widget]
for actions on checkboxes (checkbox has to have focus)
Examples: Check item
[Dropdown Widget]
for actions on dropdown lists (dropdown has to have focus)
Examples: Next item, Click button, Unfocus form
[List Widget]
for actions on lists (list has to have focus)
Examples: Next item, Click button, Unfocus form
[Edit Widget]
for actions on editable input fields (input field has to have focus)
Examples: Next character, Next line, Unfocus form

Edit input.ini (2) - actions on the page

section [Browser Widget]

  • Spacial navigation (default for D-PAD): Navigate {left|right|up|down}
  • Scrolling: Scroll {left|right|up|down}
  • Scroll Pages: Page {left|right|up|down}
  • Quick navigation on page: Go to start, Go to end
  • Quick jump to and between buttons, lists, forms etc: Focus next widget, Focus previous widget

Explanation of the syntax used here:

This is a normal notation, just for the case you don't know it:

{required}: within the braces "{" and "}" are required arguments for the function. Actually I use this notation only when there is a choice:

{either use this|or this}: the vertical bar "|" seperates two or more possible values. You can choose which one you like. Within braces you have to select one.

[optional] OR [ini-section] within the square brackets "[" and "]" are usually optional arguments. If you don't need it you just can leave it away, even if there are multiple choices (seperated by the vertical bar "|").
However with editing ini files from the Opera browser there is another meaning of the square brackets. They define sections inside the ini-files to build groups of related settings.

Edit input.ini (3) - actions for the browser

section [WinCE Application]

  • Usefull when Fit to width is active: Left=Back and Right=Forward to browse history with left and right on D-PAD
  • View modes: {Enable|Disable} {mediumscreen mode|handheld mode}, {Enter|Leave} fullscreen
  • Navigation through multiple windows (tabs): Cycle to {next window|previous window}

There are a lot of examples from Munk on aximsite (mirror on joshuateoh.com). For further actions (not all work in Opera Mobile) see this this list of commands in a forum post.

Some keyboard-settings do not work although they should, e.g.
[WinCE Application]
+ = Zoom in, 10
Enter = Enter fullscreen | Leave fullscreen

Very similar things do work like:
Z = Zoom in, 10
- = Zoom out, 10
* = Zoom to, 100.

I have no idea whether this is a bug in Opera or a limitation of Win CE (Windows Mobile).

Edit the language file

It is possible to change the language. I had success to change single words of the menu. Yesterday I didn't manage to have a complete German translation - Opera refused to start with it (I merged lng files from Opera8.54 and Opera Mobile via csv>Calc>Base>Calc>csv and translated the remaining entrys). I will search the bug and put a guide here - and of course the German language file.

  • location: [mobile device]\Application Data\Opera\english.lng

Silvio Iaccarino posted a German language file (he claims it's quick & dirty).

Advanced preferences - edit opera.ini

Some of the settings in opera.ini for Desktop Opera work in Opera Mobile. See Opera's Settings File Explained (for Desktop Opera9).

Maybe you like the suggestions from Joshua Teoh (Munk) in (1) = (2):

  • Location: \Application Data\Opera\opera.ini
  • Change in the section [User Prefs] the number of the entry Max Direct History Lines=10 to your preferred drop-down list size of the adress bar.
  • Change in the section [User Prefs] the number of the path of the entry Download Directory=\My Documents to your preferred download-path first displayed in the download window.

Index of memory topics

The more saving main memory the more tweaking is necessary.

Files (by default installed in main memory)

  • folder Application Data/Opera
    • profile files near 1 MB
      (certificates, help, ini-files, language file, skin, start page, styles, Unicode tables)
    • user files >90 kB, depending on usage
      (bookmarks, cookies, history, visited links)
    • cache default 2 MB
  • folder Program files/Opera
    • opera.exe + dll's > 5 MB

There is a description of the files used by Opera on opera.com.

Alternative storage devices for (Opera) files

internal memory card (iPAQ file store etc)

  • if corrupted they can make your whole PDA unusable
  • have limited write cycles and limited memory size

external storage cards (SD / CF etc)

  • mostly huge amount of memory (compared to built in memorys)
  • can get lost or forgotten & can be replaced easily
  • have limited write cycles

Some thoughts about flash memory are in the handout to this slide (not visible in projection mode).

Some thoughts about flash memory

Internal memory - good for exe+dlls

Internal memory like iPAQ file store is very good for opera.exe + dll's, because it couldn't get lost and its not in danger to get a lot of write cycles. Startup time will be slower compared to fast external storage cards and main memory.

Don't use build in Flash memory for cache if you want to browse on a regular basis. At least I wouldn't risk it anymore after my iPAQ main board was exchanged because of a corrupted (read only) iPAQ File Store.

External memory cards - use it for Opera's cache

Already cheap SD cards should be fast enough for most purposes. Backups and other important data is not very save on external storage devices (neither tiny storage cards nor USB-sticks) - as they easily could get lost.

External cards should be good for big cache (big reduces write cycles to the same memory cells). With slow internet connections it should be even faster than with small cache in main memory. Additionally full main memory and especially a lot of files in main memory will slow down your whole PDA - for Opera and for other applications.

With heavy usage of Opera I advice to have big enough cache and of course enough free memory for this (memory is not reserved by Opera Mobile and some applications including Opera and the OS may run into trouble when trying to write on a full memory card).

Opera Mobile with cache on a storage card and fast internet connection may be somewhat slower for surfing (you'll probably not really notice it).

About write cycles reducing live of flash memory

The granted number of write cycles on flash memory is increasing far above the former 10.000. Additionally there is a better memory management, using the least used memory cells for next write operations (I wouldn't rely too much on this, not only because of Murphy's laws. If there is only little free memory left the write cycles have to be on the reduced number of memory cells). Reaching 10.000 write cycles will take a lot of time - storage cards will be (much) bigger, faster and cheaper then (just for the case).

Where to put the Application Data files (besides cache)

The right storage of Application Data stuff depends on individual usage. There are write cycles in history and maybe cookies etc. for every (new) page visited.

On a fast storage card the data gets lost easier. In main memory on WM2003 not backuped data can be at risk due to an empty battery.

My advise
  1. If you have enough main memory it is the easiest to have Opera in the default location. I'd recommend only to move the cache to an external storage card.
  2. If you have really limited main memory and there is no other more appropriate application to uninstall from main memory I'd advice to install Opera to internal (or external) memory card and relocate the cache to an external memory card. If you want to use Opera as default browser (open local files and links from other applications in Opera) you have to edit the registry.

If you don't need to open local files and links from other applications in Opera number 2 is an about equal choice to 1.

Links

There is a very comprehensive description about optimizing storage card speed and another thread about Installing programs on Storage Card that can further guide your decision where you want to have your Opera (and other applications) store its files.

Easy: Cache settings

Reduce cache size

  • Automatic clear cache on exit (still storing files while running): Menu - Tools - Settings - History - Cache size: 1

Relocate cache (to external memory card)

  • Add in \Application Data\Opera\opera.ini under the section [User Prefs] the line Cache Directory4=[path]

On a storage card you should use a cache size much bigger than the default 2000 (2 MB) to reduce write cycles.

Drawbacks of relocating cache: 1) with a big cache the startup time of Opera Mobile may increase. 2) Do not remove the storage card with the cache while Opera Mobile is running as this may or will require a soft reset.

Starting Opera browser with cache relocated to memory card while there is no memory card in the PDA caused no trouble for me.

I couldn't find the place where the files are stored (please give me a note when you discover it).

Install program files on memory-card

It is pretty easy to install Opera Mobile outside main memory but it causes some problems:

Drawback: if you want to use Opera Mobile as standard browser on your PDA you have to fix the wrong registry entrys. Opera will probably need longer time to startup.

HowTo: 1) Download the MSI version and install it with your connected PDA via ActiveSync - just answer the question "install in default location" with selecting your storage card. Or 2) Download the CAB version and install it directly on your PDA with CabInst where you choose a path for installation on your storage card.

Install Opera completly outside Main memory (nearly)

Besides the steps from the former page you can relocate nearly the complete folder Application Data\Opera by manually moving the files and editing the paths in opera.ini

See guide from Werner Ruotsalainen (Menneisyys) to completely relocate Opera Mobile or just move the complete folder \Application Data\Opera except english.lng, input.ini and the (empty) skins subdirectory to a (subfolder on a) storage card and edit the paths in opera.ini from \Application Data\Opera\ to the new path.

Drawback: you have to do this manually with every reinstall or update of Opera Mobile. Opera may be slower.

Fix registry when Opera is installed outside main memory

Opera Mobile installer has a bug: if it is installed outside main memory there are wrong entries in the registry and you can not open local files and links from other applications in Opera (Opera as default browser).

HowTo: 1) Post with a list of the registry entrys or 2) Guide to completely relocate Opera Mobile (same as on previous page) or 3) After setting Opera as standard browser you can use (free) PHM Registry Editor, search for the string "Opera" and replace the paths (and images).

Tip: you can also reassign PIE bookmarks towards Opera by changing the urlfile entries in the registry.

Caution: you can completly mess your PDA (requires Hard Reset).

Because it is supposed to be only a small change in the installer this behaviour should be changed in the next minor update of Opera Mobile.

Links

official links for Opera Mobile

reviews & comparisons

Free Software for PPC - (I)

Software I use on my iPAQ rx3715 running Windows mobile 2003SE

Hint for the Games Warring States, Viking Saga and Cities: on localized versions the start links are also installed into Windows/Start Menu - you have to move it manually to the proper folder, e.g. German: Windows/Startmenü)

Free Software for PPC - (II) Tools

Opera 8.60 for PPC

Posted by krsuncom
개발이야기2007. 8. 14. 10:10

 

참으로 안타까운 일이다.  설정이 이렇게 독특하다니.  이런건 도데체 누가 알려주는것일까??

어쩄거나 수많은 사람이 쓰는 Gmail 이 설정 가능하다니 다행이긴 하다. 좀전에 해 보았는데 잘 되는듯 보인다.

이건 삼성에서 알려줘야하는건가????  SKT 에서 알려줘야 되는건가???...영 ~~감이 안옴.

Quick Tip: POP Gmail on Blackjack

November 22nd, 2006 by Brandon Steili

Thanks to dre3101 for this — Original post here

Gmail in your inbox … here’s a handy workaround for your Smartphone (and maybe PDA) to have gmail in your inbox… 

  • Setup your Gmail account to allow POP access (this is done in the settings section)
  • Go to Messaging on the Blackjack
  • Click on New Account
  • Select Other POP3/IMAP. Click Next.
  • Enter your Gmail information (name, email address). Click Next.
  • Click Next again to skip the automatic download of settings.
  • Enter your Gmail username like this: recent:username@gmail.com, enter your password. Click next.
  • Click next on the Server Type screen. (POP3 is correct) (You can alternately rename the account name here to make it easy to recognize)   READ ON FOR MORE!!!
  • Type
    in pop.gmail.com for incoming server, smtp.gmail.com for outgoing.
    Make sure that all of the SSL boxes are checked. Click next.
  • On the download the following messages screen, select all messages, and entire message. Click next.
  • Have it check every 15 minutes. Click next.
  • Click finish.
  • Click Yes to confirm.

At
this point, you are good to go. If you use Outlook or the like for an email program, your emails will show up in both places now. Your Blackjack will have the exact same emails.

UNLIMITED DATA IS GOING TO BE IMPORTANT!

Also, just as an FYI - this can run side by side with an Exchange sync!!

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.

Quick Tip: POP Gmail on Blackjack - Just Another Mobile Monday - Mobile News, Views and Reviews

Posted by krsuncom
개발이야기2007. 8. 13. 21:00

 

Other Registry Tweaks

These registry tweaks either need categorizing, or do not fit any of the existing categories.


For further tweaks, see: WM5 Tweaks - Performance and http://www.pocketpctweaks.com/


Note to editors:

When editing, please make sure to disable the "[ ] Use Old Markup" option for display formatting reasons.


EXAMPLE - TRY NOT TO EDIT/DELETE

Tweak to do something

To do this and that, adjust the following registry value:

HKLM\Software\Microsoft\Something\SomeValue = 1 (DWORD decimal)

To do something different entirely, perhaps the opposite, do this:

HKLM\Software\Microsoft\Something\SomeValue = 0 (DWORD decimal)

This is an additional note


UI Modifications

Change the thickness of scrollbars

To change the thickness of the scrollbars at the right/bottom of documents larger than the screen, adjust...
For the horizontal (bottom) scrollbar:

HKLM\System\GWE\cyHScr = 9 (DWORD decimal)

For the vertical (right) scrollbar:

HKLM\System\GWE\cxVScr = 9 (DWORD decimal)

The default thickness is 13. You can set the value to pretty much anything you like

Change the length of scrollbar arrow buttons

To go with changing the thickness of the scrollbars, you may wish to change the length of the scrollbar arrow buttons...
For the horizontal (bottom) scrollbar arrows:

HKLM\System\GWE\cyVScr = 9 (DWORD decimal)

For the vertical (right) scrollbar:

HKLM\System\GWE\cxHScr = 9 (DWORD decimal)

The default length is 13. You can set the value to pretty much anything you like

Enable ClearType in Landscape mode

To enable ClearType in Landscape mode:

HKLM\System\GDI\ClearTypeSettings\OffOnRotation = 0 (DWORD decimal)

To disable:

HKLM\System\GDI\ClearTypeSettings\OffOnRotation = 1 (DWORD decimal)

Note that your PocketPC screen's LCD red/green/blue ordering required for proper ClearType display is only correct for Portrait display. You may or may not prefer to leave ClearType in Landscape mode disabled

Change the display of the clock in the taskbar

The clock in the taskbar can be changed to show not only the time, but also the date, or just the date, or nothing at all.
To show nothing:

HKLM\Software\Microsoft\Shell\TBOpt = 0 (DWORD decimal)

To show just the clock:

HKLM\Software\Microsoft\Shell\TBOpt = 1 (DWORD decimal)

To show just the date:

HKLM\Software\Microsoft\Shell\TBOpt = 2 (DWORD decimal)

To show both the date and the clock:

HKLM\Software\Microsoft\Shell\TBOpt = 3 (DWORD decimal)

Note 1: If you switch to the Analog clock display, the date will remain visible -through- the Analog clock
Note 2: Setting the clock to show 'nothing' will still keep the reserved space, showing the taskbar background, and obscure any icons that will shift to the right.
Note 3: Your date may get obscured by the space reserved for the OK/Close button in the top-right. You can fix this my adding spaces at the end of your 'Short Date Format'. See also the tweak on 'Change the Short Date Format'

Show Edge network indicator instead of GPRS

If your network provider supports the Edge network (and your device does as well), you can use the following to show a little 'E' icon instead of 'G' icon when connected to an Edge network:

HKLM\Drivers\BuiltIn\RIL\EnableDifferGprsEdgeIcon = 1 (DWORD decimal)

To disable again:

HKLM\Drivers\BuiltIn\RIL\EnableDifferGprsEdgeIcon = 0 (DWORD decimal)

Note that your device -and- your network operator need to support Edge, otherwise you won't see it. Also note that if you connect to GPRS, you will still see the 'G' icon.

Add GPS settings icon

If you have a GPS device, you can add a GPS settings icon to your Start > Settings menu using:

HKLM\ControlPanel\GPS Settings\Group = 2 (DWORD decimal)
HKLM\ControlPanel\GPS Settings\redirect <-- delete, or rename, this value

Note that '2' stands for the Connections tab, '1' is System and '0' would be Personal
Note also that this has reportedly disabled one person's USB connectivity. To restore, set "GPS Program Port = None", "GPS Connection Port = None", "Automatic GPS Management = on"

Hide/Show Screen orientation icon

If you wish to hide the Screen orientation icon, shown in the task bar on some devices, you can set:

HKLM\Services\?ScreenRotate\ShowIcon = 0 (DWORD decimal)
HKLM\System\GDI\Rotation\HideOrientationUI = 1 (DWORD decimal)

And to show it again:

HKLM\Services\?ScreenRotate\ShowIcon = 1 (DWORD decimal)
HKLM\System\GDI\Rotation\HideOrientationUI = 0 (DWORD decimal)

If this doesn't work, you can try:

HKLM\Services\screenrotate = 0 (DWORD decimal)

And to show it again:

HKLM\Services\screenrotate = 1 (DWORD decimal)

Note that this icon and its feature may not be available on your device at all.

Hide/Show battery indicator in Task bar

If you wish to hide the battery indicator in the task bar on some devices, you can set:

HKLM\Services\Power\ShowIcon = 0 (DWORD decimal)

And to show:

HKLM\Services\Power\ShowIcon = 1 (DWORD decimal)

Note that this icon and its feature may not be available on your device at all. For example, the HTC Wizard regularly ships with a battery indicator in the Tray instead, governed by "Windows\Startup\Init_Tray.exe"._
_Note also that this reportedly does not work on AKU2 ROMs to remove the new battery indicator

Show slide-out keyboard caps/dot icon next to SIP

If your device contains a file called "capnotify.exe", try running it (most devices that have it will already have it in the Windows\StartUp\ folder), and setting the following value to get a visual presentation of whether you are in caps or dot (alternate key function) mode:
HKCU\ControlPanel\Keybd\EnableIndicator = 1
Please note that if your device has no external keyboard with caps/dot mode, you won't gain anything from this tweak
Please also note that the application "?CapNotify.exe" must be running (normally found in \Windows\?StartUp\ already) for this to work

Put custom text on bottom-right of Today screen

You can set some piece of text on the bottom-right of the Today Screen by setting the following key:

HKLM\Software\Microsoft\Shell\DeviceBeta\Today = "Hello World" (REG_SZ string, no quotes)

Please note that this text won't take up Today item text. It will be obscured by Today items.


File Locations

Change the location of My Documents

Documents are opened in and saved to the device's internal storage by default. You can change this location to, for example, your Storage Card:

HKLM\Software\Microsoft\Windows CE Services\FileSyncPath = "\Storage Card\My Documents" (REG_SZ string, no quotes)

To return to the original location:

HKLM\Software\Microsoft\Windows CE Services\FileSyncPath = "\My Documents" (REG_SZ string, no quotes)

Change the location of email and attachments

When reading and sending email in Pocket Outlook, emails and their attachments are saved in the device's internal storage by default. You can change this location to, for example, your Storage Card:

HKCU\Software\Microsoft\MAPI\PropertyPath = "\Storage Card\Mail" (REG_SZ string, no quotes) HKCU\Software\Microsoft\MAPI\AttachPath = "\Storage Card\Mail\Attachments" (REG_SZ string, no quotes)

To return to the original location:

Just simply delete these Registry settings (since neither is included by default).

Change the location of Temporary Internet Files

When browsing the web, pages and images are saved in the 'Temporary Internet Files' location. You can change this location to, for example, your Storage Card:

HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Cache = "\Storage Card\cacheie" (REG_SZ string, no quotes)

To return to the original location:

HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Cache = "\Windows\Profiles\guest\Temporary Internet Files" (REG_SZ string, no quotes)

Change the location of Ringtone file storage

WM5 will look for Ringtones in \Windows\ or \Windows\Rings by default. You can change this location to, for example, your Storage Card (example given is for ringtones placed on the Storage Card root folder)
HKCU\ControlPanel\SoundCategories\Ring\Directory = "\Storage Card\" (REG_SZ string, no quotes)

To return to the original location:

HKCU\ControlPanel\SoundCategories\Ring\Directory = "\Windows\Rings\" (REG_SZ string, no quotes)

Note the default location may be "\Windows\" or "\Windows\Rings\" depending on your Device provider.

Make WM5 ask where to install a program (1)

If you wish to be able to specify whether to install a program on WM5's Main storage, or your Storage Card, regardless of installer setting set:

HKLM\Software\apps\Microsoft Application Installer\fAskDest = 1 (DWORD decimal)

To disable again:

HKLM\Software\apps\Microsoft Application Installer\fAskDest = 0 (DWORD decimal)

Please note that many applications do not support being installed on the Storage Card and may behave unpredictably, including crashing.

Make WM5 ask where to install a program (2)

An alternative method of making WM5 ask where to install a program is by adding the "/askdest" option to the Windows CE loader:

HKCR\cabfile\Shell\open\command = 'wceload.exe "%1" /askdest' (REG_SZ string, no quotes)

Make WM5 keep CAB files around after installing (1)

If you wish to keep the original .CAB file around after installing the application, set:

HKLM\Software\apps\Microsoft Application Installer\nDynamicDelete = 0 (DWORD decimal)

Or to restore to the default:

HKLM\Software\apps\Microsoft Application Installer\nDynamicDelete = 2 (DWORD decimal)

Make WM5 keep CAB files around after installing (2)

An alternative method of making WM5 keep the original .CAB file around after installing the application is by adding the "/nodelete" option to the Windows CE loader:

HKCR\cabfile\Shell\open\command = 'wceload.exe "%1" /nodelete' (REG_SZ string, no quotes)

Make WM5 prompt before overwriting an existing installation

If you wish to make WM5 prompt you before overwriting an existing installation, set:

HKLM\Software\apps\Microsoft Application Installer\fAskOptions = 1 (DWORD decimal)

To disable again:

HKLM\Software\apps\Microsoft Application Installer\fAskOptions = 0 (DWORD decimal)


Input (keyboard, soft keys, SIP)

Change slide-out keyboard layout

If you have a Device from one country, but would like to use the keyboard layout of another, you can change the keyboard's language setting to do so...

For US layout (QWERTY):
HKCU\ControlPanel\Keybd\Locale = 0409 (String)
For German layout (QWERTZ):
HKCU\ControlPanel\Keybd\Locale = 0407 (String)
For French layout (AZERTY):
HKCU\ControlPanel\Keybd\Locale = 040c (String)
For Spanish layout (QWERTY):
HKCU\ControlPanel\Keybd\Locale = 040a (String)

For other codes, see: http://www.microsoft.com/globaldev/reference/winxp/xp-lcid.mspx

Change the keyboard backlight duration

To change the duration of the keyboard backlight, you can set (example is 30 seconds):

HKCU\ControlPanel\Backlight\QKeyLedTimeout = 30 (DWORD decimal)

Please note that this may not work on some devices. One such notable exception is the HTC Wizard.

Change the application launched by Today screen Soft Keys

To change the application launched by the Today screen Left soft key:

HKCU\Software\Microsoft\Today\Keys\112\Open = "\Windows\Calendar.exe" (REG_SZ string, including quotes)

To change the title of the Left soft key:

HKCU\Software\Microsoft\Today\Keys\112\(Default) = "Calendar" (REG_SZ string, no quotes)

To change the application launched by the Today screen Right soft key:

HKCU\Software\Microsoft\Today\Keys\113\Open = "\Windows\Start Menu\Programs\Contacts.lnk" (REG_SZ string, including quotes)

To change the title of the Right soft key:

HKCU\Software\Microsoft\Today\Keys\113\(Default) = "Contacts" (REG_SZ string, no quotes)

Note that 113 normally doesn't exist by default, and probably needs to be created
Also note that there is at least 1 application that allows you to set these through a GUI, developed by FdcSoft called SoftKeyAppletEx.

Set default SIP

The default SIP (Secondary Input Panel) on practically every device is the Keyboard. You may prefer entry with a different SIP. If so, you can set this to be the default SIP through:

HKCU\ControlPanel\SIP\DefaultIM = |SIP ClassID|

The |SIP ClassID| will depend on the SIP's ClassID, which may vary per-device. You can find the correct ClassID by searching for "IsSIPInputMethod" in HKCR, then going to the top key and checking the name of the SIP that's in the (Default) value.
Please note that this doesn't work with all SIPs. Transcriber/Calligrapher are two examples of this.
You can, however, set Transcriber as the default SIP by starting Transcriber.exe on startup. (This should be moved to, or added to, non-registry Tweaks page)
WARNING: Do not assume that the below ClassIDs would be -as found- on your device! Setting it to a non-existant SIP may prevent your device from booting up!
WARNING: If you set an invalid value in DefaultIM (or apparently if you're running a recent AKU http://forum.xda-developers.com/showpost.php?p=1032402&postcount=800), then you'll probably have to hard reset your device. NOTE: An alternative means of changing the default SIP is by using the SIPChange utility: http://forum.xda-developers.com/showpost.php?p=995883&postcount=16
The following are some of the ClassIDs typically found:

Typical pre-installed:
{42429667-ae04-11d0-a4f8-00aa00a749b9} = Keyboard
{51A2CB38-154E-4C92-A625-A83871C99EC2} = Phone Pad
{42429690-ae04-11d0-a4f8-00aa00a749b9} = Letter Recognizer
{42429691-ae04-11d0-a4f8-00aa00a749b9} = Block Recognizer
{F0034DD0-2AD4-11d1-9CB0-E84BE8000000} = Transcriber
Third Party:
{991A1001-9DCB-11d3-B3C2-000000000000} = AccessPanel
{1E03E205-12D7-4d82-963E-C01889F2EC10} = Claviature
{500AEF94-EBB8-11d4-B1F8-00304F06E973} = Decuma Alphabetic (UNCONFIRMED!)
{95BDB641-772F-11d2-AC6B-204C4F4F5020} = Fitaly
{52429695-AE04-11D0-A4F8-00AA00A749B9} = FleXslide
{4EAD10BD-83AC-44b9-99AE-71958C1B0F0E} = InPad
{C099F78A-924E-4814-A8CF-54E7BD8C2124} = JetKeys
{4128DEE4-EE84-4338-A261-CC704CB32C19} = NanoPad
{42429695-AE04-11D0-A4F8-00AA00A749B9} = NullKB
{025ECAC2-075B-4b82-A972-05E4C17719EA} = PDAMedia Excel
{FA957346-A925-4b68-B9E1-D3D0310F4433} = PDAMEdia KBD
{DE6510EF-6691-401D-B1D3-B9074BFD1555} = PHM Character Map
{81FC2CAD-AD71-4793-9464-36D27630E584} = PHM Clipboard Pane
{9DD23292-0AB3-48F2-A245-0713652A8CEE} = PHM Ext. Keyboard
{FFFD6819-FF21-4e93-B844-A1BBF986B55C} = QuikWriting
{991A1000-9DCB-11d3-B3C2-000000000000} = RapidCalc
{A070BE16-AD56-11d3-BC77-00C06C512035} = Resco Keyboard Pro
{7F0854D9-9ADA-45A9-A3A2-189D9BE8A653} = Smilies Input Panel
{26F56EF0-2CE8-4C46-ADC8-FE0A7DF12DD1} = SPB Fullscreen Keyboard
{5efab5bd-0af5-48f8-abec-6f36e3a0b5af} = TenGo
{8A7968F3-677B-4F64-859C-8A49FCCCB9BF} = TextPlus
{A5304BFA-CC1D-493f-87D3-D9C17147FA32} = TopKey
{4345EA53-B8A5-4E24-A14A-F7C34DD78077} = WordLogic

Add/remove items from the SIP list

If you have a few items in your SIP list which you don't use, they can be removed from the list by setting the IsSIPInputMethod for each item you want removed. To remove the SIP from the list, replace the $SIP_CLSID$ in the example below with a CLSID from the Set default SIP tweak.:

HKEY_CLASSES_ROOT\CLSID\$SIP_CLSID$\IsSIPInputMethod\(Default) = 0 (DWORD decimal)

To add it back to the list:

HKEY_CLASSES_ROOT\CLSID\$SIP_CLSID$\IsSIPInputMethod\(Default) = 1 (DWORD decimal)


Pocket Calendar

Show Calendar event text in Week View

If you wish to see a Calendar event's text in the Week View, set the following:

HKCU\Software\Microsoft\Calendar\ShowTextInWeekView = 1 (DWORD decimal)

To disable it again:

HKCU\Software\Microsoft\Calendar\ShowTextInWeekView = 0 (DWORD decimal)

Please note that your event must have long enough a duration to show the event text, and the week view (with its narrow columns) truncates long words easily
Also note that the key "Calendar" may not exist - just create it if it doesn't

Change Calendar 'working days'

If you wish to change the 'working days' in the calendar, adjust the following:
For a Mon-Fri workweek (default):

HKLM\Software\Microsoft\Calendar\ActiveTimes\ActiveTimes = 2210003E (DWORD hexadecimal)

For a Mon-Sat workweek:

HKLM\Software\Microsoft\Calendar\ActiveTimes\ActiveTimes = 2210007E (DWORD hexadecimal)

For a Tue-Thu workweek:

HKLM\Software\Microsoft\Calendar\ActiveTimes\ActiveTimes = 22100016 (DWORD hexadecimal)

Here's how this works. When editing the value, switch to "Binary" mode. For the default Mon-Fri, you should see:

100010000100000000000000111110

The last 7 numbers are what we're interested in. They stand for the days of the week, in reverse order: Saturday, Friday, Thursday, Wednesday, Tuesday, Monday, Sunday. When the number is "1", it is a working day. If it is "0", it's not a working day. So to look at the above examples again:

Days   : SFTWTMS
Mon-Fri: 0111110
Mon-Sat: 1111110
Tue-Thu: 0011100

Using the above, you should be able to set the working days to whatever you'd like.
Note that this value also adjusts the working HOURS. The examples here all use the default 8am-5pm workday. See the "Change Calendar 'working hours'" tweak to modify this.
Note that the ActiveTimes key and value may not exist. Simply create them first.

Change Calendar 'working hours'

If you wish to change the 'working hours' in the calendar, adjust the following:
For 8am-5pm (default):

HKLM\Software\Microsoft\Calendar\ActiveTimes\ActiveTimes = 2210003E (DWORD hexadecimal)

For 9am-5pm:

HKLM\Software\Microsoft\Calendar\ActiveTimes\ActiveTimes = 2212003E (DWORD hexadecimal)

For 2pm-10pm:

HKLM\Software\Microsoft\Calendar\ActiveTimes\ActiveTimes = 2C1C003E (DWORD hexadecimal)

See here: http://www.pocketpcthoughts.com/index.php?action=expand,47926

XDADeveloperWiki - WM5_Tweaks_Other

Posted by krsuncom
개발이야기2007. 8. 13. 20:59

 

WM5 Registry Tweaks - Performance

These Registry tweaks are typically used to improve performance of Windows Mobile 5. (This content was split off from WM5_Tweaks_Other because that page would no longer accept additional content.)


For further tweaks, see: WM5 Tweaks - Other and http://www.pocketpctweaks.com/


Note to editors:

When editing, please make sure to disable the "[ ] Use Old Markup" option for display formatting reasons.


EXAMPLE - TRY NOT TO EDIT/DELETE

Tweak to do something

To do this and that, adjust the following registry value:

HKLM\Software\Microsoft\Something\SomeValue = 1 (DWORD decimal)

To do something different entirely, perhaps the opposite, do this:

HKLM\Software\Microsoft\Something\SomeValue = 0 (DWORD decimal)

This is an additional note


Disable menu animations

To disable menu animations (sliding in/out) and speed up performance of the UI a bit:

HKLM\SYSTEM\GWE\Menu\AniType = 0 (DWORD decimal)

To change it back to the default:

HKLM\SYSTEM\GWE\Menu\AniType = 6 (DWORD decimal)

Disable window animations

To disable window animations (minimizing/maximizing) and speed up performance of the UI a bit:

HKLM\SYSTEM\GWE\Animate = 0 (DWORD decimal)

And to switch them back on:

HKLM\SYSTEM\GWE\Animate = 1 (DWORD decimal)

Increase font cache

To increase the font cache, speeding up font rendering at the cost of a bit of memory:

HKLM\SYSTEM\GDI\GLYPHCACHE\limit = 16384 (DWORD decimal)

To change it back to the default:

HKLM\SYSTEM\GDI\GLYPHCACHE\limit = 8192 (DWORD decimal)

You can set the value to pretty much anything you like, but suggested values are 4096, 8192, 16384 & 32768.

Enable FileSystem cache

To enable the FileSystem cache, speeding up overall performance at the risk of the cache not being written on a sudden reset:

HKLM\System\StorageManager\FATFS\EnableCache = 1 (DWORD decimal)

To disable again:

HKLM\System\StorageManager\FATFS\EnableCache = 0 (DWORD decimal)

Note that by default, the cache size is zero, and you will see no effect. See "Increase FileSystem cache" below to increase the cache size.

Increase FileSystem cache

To increase the file system cache:

HKLM\System\StorageManager\FATFS\CacheSize = 4096 (DWORD decimal)

To return the file system cache to zero:

HKLM\System\StorageManager\FATFS\CacheSize = 0 (DWORD decimal)

You can set the value to pretty much anything you like.

Increase FileSystem filter cache

To enable the file system filter cache, speeding up overall performance with file mangement:

HKLM\System\StorageManager\Filters\fsreplxfilt\ReplStoreCacheSize = 4096 (DWORD decimal)

To return the file system filter cache to zero:

HKLM\System\StorageManager\Filters\fsreplxfilt\ReplStoreCacheSize = 0 (DWORD decimal)

You can set the value to pretty much anything you like.

XDADeveloperWiki - WM5_Tweaks_Performance

Posted by krsuncom
블랙잭이야기2007. 8. 10. 21:28

 

Samsung Blackjack tips and tricks

The business development team at Vertigo recently standardized on the Samsung Blackjack phone.

It's fantastic hardware. The smartphone has finally shrunk to a pocketable form factor after all these years. Ironically, it's the software that needs to improve -- the Windows Mobile 5.0 OS on the phone leaves a lot to be desired. It's not exactly intuitive.

I dug through a massive tips and tricks thread trying to figure out ways to work efficiently in Windows Mobile on the Blackjack. Here's a summary of the best:

  • Hard reset the phone by holding down UP and POWER to boot. It will ask to confirm.
  • You can adjust the brightness of the screen in Settings under Power (scroll down)
  • Pressing and holding the Home button brings up the task manager
  • Pressing and holding the jog dial brings up a list of apps
  • Pressing the power button brings up the quicklist
  • Hold down message key to turn off backlight on screen.
  • Fn + B = Toggle Bluetooth
  • Press the V key for PAGE DOWN and the T key for PAGE UP.
  • Hold down any key while typing to get its "alternate" character. i.e. Hold down the Q for a moment and you'll get the + symbol. This is nice if you don't like hitting Caps/Shift Q to get it.
  • if you are reading an email, press the center d-pad "action" button... it will take you to the new contact entry with that persons email address already filled in.
  • Apparently the phone doesn't support automatic keylock, you have to hold down the "end call" key for 3-4 seconds and it locks the phone.
  • When you have a URL in the address bar hold down the BACK button above the red hang up button and it will delete the entire URL.
  • In any of the edit fields (contacts, I.E., and others) if you hold down Undo (top right U-Turn with an arrow) it will delete the contents of the field you are in.
  • There is no way to get periodic reminder tones for missed calls or messages. This little app addresses that deficiency.
  • Holding down the back button on the right hand edge of the device launches the Camera app for taking pictures.

If you want to sync data between the phone and the computer, you can use ActiveSync on Windows XP, or Windows Mobile Device Center on Windows Vista. WMDC replaces ActiveSync, but is still in Beta 3 as of right now.

You'll probably want a few apps on your phone. Remember this is Windows Mobile 5.0, not PocketPC, so be sure to pick the right version of the app. I highly recommend starting with a freeware registry editor such as PHM Registry Editor. There are a lot of cool settings that are only exposed through the phone's registry*. I installed "regedit.Stngr_ARM.CAB" on the blackjack and it worked fine for basic registry editing. Once of the first things you'll want to do is turn off the "application lock", either via editing the registry or by downloading and running a small registry edit file named "appunlock.cab" on your phone.

Battery life is OK, but not great. That's probably why it comes with an extra battery and a standalone battery charger out of the box. The phone does trickle charge over USB when it's connected, however, I couldn't get it to charge at all via USB when the battery was very low and the phone wouldn't turn on. There are pictures of the extended battery in action here. This might be a good upgrade if you're running into battery issues.

The phone has a lot in common with the Motorola Q, so often tweaks and files for the Q will work on the Blackjack. You can download new start page designs that work fine from koodezine and qusers. Here's the one I'm using:

And remember, the phone accepts MicroSD cards for additional storage-- they're tiny compared to their SD and MiniSD brethren.

* that's right, there's a Windows Registry on a phone. Depressing but true.

posted on Friday, January 12, 2007 4:50 PM by jatwood

원문 : Jeff Atwood : Samsung Blackjack tips and tricks

Posted by krsuncom
개발이야기2007. 8. 6. 19:08

원문: 요기

HKLM/Software/Microsoft/Bluetooth/A2DP/Settings
Add new dword, Value name=BitPool; Value data=48 (Decimal)
Modify, Value name=UseJointStereo; Value data=0 (Decimal, Originally 1)
For BitPool:
Microsoft suggests the following bitpool values for optimal buffer sizes.
30 - Low audio quality
40 - Medium audio quality
48 - High audio quality
58 - Excellent audio quality
Chose one you like. I think 48 is good enough.
For UseJointStereo: use 0 instead of 1, then you got the real stereo.......
BTW, if you lost your modification after soft reset, you might try to "totally" close the reg editor you use before soft reset.
And chosing an "appropriate" A2DP headset is quite important. Some just don't work well with this device

HowardForums: Your Mobile Phone Community & Resource - Bluetooth Stereo (A2DP) on Qtek 8500

Posted by krsuncom
개발이야기2007. 8. 6. 19:04

원문 :

요기

Lightbulb WM6 A2DP best settings here


After discussions with Sleuth255, I've done some further testing on the registry settings and found some optimum settings for A2DP. These are applicable to the newer releases of WM6.
Finding #1:
ADD/CHANGE the following values from the registry at HKLM\Software\Microsoft\Bluetooth\A2DP\Settings :
Name: UseJointStereo
Value (DWORD): 1
What this does is enable Joint-Stereo for the SBC codec, which is important and makes the biggest significant change to improve sound quality. (Note: In earlier versions of WM5 and WM6, Joint-Stereo was broken and resulted in a mono-output. This is not the case anymore with the newer WM6 ROMS.)
Further note: Sleuth255 found that some of his A2DP headsets could not work with JS turned on. In that case, you have to set the value to 0 to disable JS (resulting in poorer quality sound with more "hissing").
Finding #2:
REMOVE the following values from the registry at HKLM\Software\Microsoft\Bluetooth\A2DP\Settings if they are present:
- BitPool
- MaxSupportedBitPool
These values are used to manually set limits for the BT stack for the A2DP SBC codec. Previously, it was thought that these values should be set between 38 to 86. But if the values are removed, I think that the BT stack automatically chooses the best BitPool values for maximum quality. I've tried removing these values and the sound quality either improved or at least stayed the same.
[ SUMMARY ]
At this point, you should have only one value in the registry at HKLM\Software\Microsoft\Bluetooth\A2DP\Settings:
UseJointStereo = 1
Your A2DP audio should be very good at this point - almost indistinguishable from a wired headset. However, if you are still unsatisfied with the sound (you may notice some very slight "hissing" or "swishing" sounds on high frequencies of certain songs), you may want to try the optional setting below.
[ OPTIONAL ]
Finding #3:
This is optional, and a matter of preference.
ADD the following value to the registry at HKLM\Software\Microsoft\Bluetooth\A2DP\Settings:
Name: SampleRate
Value (DWORD): 48000 (decimal)
This forces the A2DP stack to send the audio to the headset at 48000Hz instead of the default 44100Hz. For some reason, I find that the 48Khz value makes the "hissing" sounds less obvious. Your findings may vary, as some people may prefer the slightly more forward sound of the original setting. But if you are game, give this a try - one thing for sure is that it definitely changes the sound quality.
To reverse the change, just remove the SampleRate value.
If you make this 3rd optional change, you should have the following values in the registry at HKLM\Software\Microsoft\Bluetooth\A2DP\Settings:
UseJointStereo = 1
SampleRate = 48000
[ Note - Quick tip on registry editing ]
Of course, every registry change needs a soft-reset to take effect. And please take the usual proper care when editing the registry or risk damaging your device.
Find that your settings dont "stick" after a reset?
Make sure you reset the phone like this: After making changes to the registry, exit your registry editor. Then press and hold the power button of your phone for about 5 seconds, a window should pop up asking you if you want to shutdown your phone (click Yes). Once the phone has shut down, press and hold the power button for a few seconds until the phone starts up again.
Happy listening! BTW, I find that Mortplayer is an excellent MP3 player to use with A2DP. It works well with the control buttons on my headset.


Last edited by hardcore : 05-06-2007 at 06:48 PM.

WM6 A2DP best settings here - xda-developers

Posted by krsuncom
개발이야기2007. 8. 6. 12:53

 

Windows CE Developers FAQ

Welcome to the CEGadgets Windows CE Developer FAQ page! Here you will find answers to common (and not so common) Windows CE development questions. This FAQ tries to avoid basic Windows CE issues (what is Windows CE, what is activeSync) and instead serves as a technical document discussing Windows CE specific development issues. Also, this FAQ avoids embedded specific issues, and focuses more on application development.

If you have something you want to add, or find a problem, send a note to faq@cegadgets.com explaining the problem or addition. I will update the FAQ ASAP and give you credit for it as well. Thanks!

This FAQ was last updated 27-Mar-01. Also, notice that new and updated items show in a separate section (as well as in the main contents list). Items will remain in the new/updated section for one week.

1. General
1.1 Why should I write software for Windows CE?
1.2 What does the CE in Windows CE stand for?
1.3 I want to learn about Windows CE development. Where should I start?
1.4 What books are available for Windows CE developers?
1.5 What are some other developer related Windows CE websites?
1.6 Where can I find information on DevCon 99?
1.7 I need to learn CE in a hurry - can I take a class?
1.8 Things to consider before you design that new Windows CE application.
1.9 I want to develop using Visual C++. What do I need?
1.10 I want to develop using Visual Basic. What do I need?
1.11 What other development tools are available for windows CE?
1.12 How do I report bugs (or feature requests) in Windows CE development tools?
1.13 Should I get a copy of Platform Builder 2.11/2.12?
1.14 Where can I find a MIPS or SH3 disassembler?
1.15 Can I write DCOM application under Windows CE?
1.16 Is the SH4 binary compatible with the SH3?
1.17 Does Windows CE support COM?

2. Visual C++ Issues
2.1 What do I really need to write C++ apps for Windows CE?
2.2 Do I need to purchase the Windows CE Toolkit for C++ or Basic to develop for CE?
2.3 Can I use Visual Studio SP3 with the Toolkit for Windows CE?
2.4 Can I use Windows 95/98 to build Windows CE applications?
2.5 My MFC app doesn't run on the device the first time I try?
2.6 I keep getting internal compiler errors? How do I make them go away?
2.7 I use a serial connection to debug and use programs like Remote Spy, but the serial connection speed is slow. How can I make it faster?
2.8 How can I copy files to the emulator?
2.9 Can I use C++ exceptions in my Windows CE application?
2.10 Can I use STL in my Windows CE application?
2.11 I populate my combobox using the resource editor, yet when I run my application under CE all I see is garbage. What can I do?
2.12 Is there a way to edit my Visual C++ files on my handheld?
2.13 How does compiler optimization affect Windows CE executables?
2.14 Where is the Windows CE C runtime library? Is source for the runtime available?
2.15 How can I develop applications for Windows CE 1.0?
2.16 I want to port my Windows desktop application to Windows CE.  What issues will I face?
2.17 I can compile for the MIPS and SHx processors, but I don't see an option for the StrongArm.  What can I do?

3. Third Party Tools and Hardware
3.1 Which databases are available on the Windows CE platform?
3.2 Are there any Text-To-Speech engines for the CE platform?
3.3 I want to write an MP3 decoder for Windows CE. Where do I start?
3.4 Are there any printer libraries for Windows CE?
3.5 How can I work with Pocket Outlook data?
3.6 Is there an FTP client API available for Windows CE?
3.7 How can I copy-protect my Windows CE application?
3.8 Where can I find an XML parser for Windows CE?
3.9 Is GCC available for the Windows CE platform?

4. Windows CE Overview
4.1 How many processes can Windows CE support?
4.2 How many threads can Windows CE run?
4.3 What does the basic Windows CE memory map look like?
4.4 What is Execute-In-Place (XIP) and what does it mean for me?
4.5 I want to make my own shell. Where should I start?
4.6 Can I trash my object store by turning off the power during a file operation?
4.7 How much stack space can I use per thread?
4.8 Why does my Windows CE 2.0 stack blow out, even if I allocated it at compile time?
4.9 What kind of limitations will I encounter using the CE Database?

5. General Windows CE Development
5.1 I can't find an API that I need. What should I do?
5.2 How can I insure only one instance of my application?
5.3 How can I make I application startup on system startup?
5.4 How can I prevent other applications from running while my application is active (how can I keep users from accessing the Start Menu)?
5.5 How can I change task bar settings such as Auto Hide?
5.6 How do I keep my device from auto-suspending?
5.7 How do I detect power-on?
5.8 How can I programmatically turn off the device?
5.9 How can I get battery status?
5.10 How can I determine the device type?
5.11 How can I determine the device name?
5.12 How can I initiate a connection to the desktop?
5.13 How can I tell if ActiveSync is currently running?
5.14 How can I programmatically change the display brightness?
5.15 How do I reboot/reset the device?
5.16 How can I change the size of the object store?
5.17 How can I reprogram the buttons on the device? Can I use hardware buttons to initiate application functionality?
5.18 I am writing a dialog based application. Why doesn't an entry appear in the taskbar or in the task list?
5.19 I want to modify the contact database. What is the contact database name or CEOID?
5.20 What is Venus?
5.21 What is Cedar?
5.22 When is MSMQ going to be available?
5.23 How do I get the time under CE - or, what happened to time()?
5.24 How can I convert a pwi to an rtf?
5.25 How can I determine whether the device has been rebooted/reset since the last time the application ran?
5.26 How can I make a resource only DLL under Windows CE?
5.27 How can I determine the current SIP state?
5.28 How can I change the current SIP state?
5.29 How can I enable or disable the Jot SIP?
5.30 I need an ownerdrawn listbox but they are unsupported. What should I do?
5.31 How can I implement a list view with a checkbox next to each item?
5.32 What is POOM and should I use it?
5.33 How can I programmatically launch a dial-up connection (without using the RAS API)?
5.34 How can I write or read a physical memory location?
5.35 How can I enumerate Windows CE databases from the desktop?
5.36 I need to use IrDA to communicate with other devices. Where should I start?
5.37 How can I show the wait cursor, especially from VBCE?
5.38 How can I print from a Windows CE application?
5.39 How do I register a control under Windows CE?
5.40 I am having problems getting CE RAPI to work properly. What can I check?
5.41 I want to create a mail message then send it. Can I do this using the Mail API?
5.42 How can I display GIF, JPG, BMP, or XBM images in my application?
5.43 Why can't I display 16-bit images from my application using imgdecmp.dll?
5.44 What steps can I take to make my software ready for foreign markets?
5.45 How can I open, change and delete mail messages?
5.46 How can I use ATLCE to sink events?
5.47 Do the Pocket Office applications support automation? Can I use them from VCCE, VBCE?
5.48 I am using VBCE and need to call API functions that require structures, but UDT's are not available.  What can I do? What should I watch out for?
5.49 How can I turn on the device when the serial port has activity?
5.50 How can I start applications on device connect/disconnect?
5.51 Do you have any tips on getting more out of HTMLView?
5.52 How do I get the name of a ADOCE table if I only have an Table ID number?
5.53 How can I determine the amount of free space on storage cards, on the device and in memory?
5.54 How can I disable the OK button on my Windows CE dialogs?
5.55 Which common dialogs are supported under Windows CE?

6. Palm Size Development Issues
6.1 If I don't implement an exit menu item, is there anything I can do to make closing the application easier?
6.2 Why should I pay any attention to WM_HIBERNATE?

7. Common Executable Format (CEF)
7.1 What is CEF?
7.2 Can I use CEF in my current applications?
7.3 Can I have a CEF based dll or ocx?
7.4 Why should I use CEF?
7.5 Is CEF as fast as an application compiled for the platform?
7.6 If I am only targeting one specific device should I use CEF?

8. Installation
8.1 What install packages are available?
8.2 How do I programmatically open a cab file on a CE device?
8.3 How do I start an installation from the desktop?
8.4 How can I keep a cab file from being erased after it is installed?
8.5 What command line switches are available for CeAppMgr?
8.6 My install set is having trouble registering controls on Palm-Size PC devices. What am I doing wrong?
8.7 How can I programmatically open a .CAB file?

9. Help
9.1 What format is Windows CE Help in?
9.2 How should I create help files?
9.3 How can I programmatically launch help?

10. Internal/Undocumented/Hack Corner
10.1 Ways to explore windows CE.
10.2 Hack while you can - it will be harder soon.

10.3 BinaryCompress/BinaryDecompress - built in compression for windows ce

10.4 SetProcPermissions - give your process access to other processes!
10.5 RegFileCopy - make an instant copy of the registry
10.6 GetFSHeapInfo - pointer to object store in physical memory
10.7 Predict.dll offers access to word prediction on Palm Size PC's
10.8 Inspect ROM on the Casio E-100 and find interesting things.
10.9 SetWindowsHookEx really does work, sort of.

10.10 Calstore.dll can be used to access the task database API set.
10.11 How can I reformat a compact flash card?

11. Known CE bugs
11.1 Createprocess on pspc devices doesn't work
11.2 MFC CE 6.0 - Gettime with city set to foreign city. Returns 7/22/1863.
11.3 The voice control will not write recordings to any filename except the default.
11.4 The 6.0 StrongArm compiler creates buggy code.

12. Windows CE Gossip Corner
Note: These are all unverified and included just because they are interesting.
12.1 PPTP will be available in 3.0 but not 2.12.
12.2 A new grid control will be released soon.

12.3 The 2.12 version of Imgdecmp.dll supports 24-bit bitmaps.
12.4 When will VCCE 6.5 be released?

1. General

1.1 Why should I write software for Windows CE?

PDA's are booming! Marketing research organizations like IDC project 40% annual growth in handheld device through 2001. Handheld's are also taking off in the enterprise, and are predicted to be the next big enterprise computing platform.

IDC predicts that consumer 'info appliances' will surpass PC sales in 2001, reaching almost 20 million units.

Windows CE is poised to capitalize on this rapid growth. Microsoft is positioning Windows CE to be an easy choice for enterprise development and use, and is working with many OEM's to promote general consumer use and acceptance of Windows CE.

If you have any experience developing for the Windows platform, you can develop for Windows CE. Other platforms cause you to learn new tools and API's, and do not have the broad support of Microsoft and it's partners. Leverage your knowledge and Microsoft's marketing muscle and start coding for CE!

1.2 What does the CE in Windows CE stand for?

While Microsoft claims the CE does not represent any particular meaning, it has been said that it stands for Consumer Electronics (for the devices CE targets) or Compact Edition. When you are really frustrated with a particular problem or shortcoming you can refer to it as Windows CE (Crippled Edition).  I also like Caveat Emptor.

1.3 I want to learn about Windows CE development. Where should I start?

There are many excellent development resources for Windows CE. First, check out the Windows CE related newsgroups:

Microsoft.public.win32.programmer.wince
Microsoft.public.vb.vbce
Microsoft.public.windowsce
Microsoft.public.vc.vcce
Microsoft.public.ado.wince
Microsoft.public.windowsce.developer.betas
Microsoft.public.windowsce.embedded

Also, check www.deja.com for a nice archive of Windows CE posts going back years. This is probably my number one Windows CE resource.

I also really like the windowsce-dev mail list.  It probably has the purest technical Windows CE content of any source, and is monitored by some of the best CE developers I've seen.  It contains a mix of embedded and application development questions.  I also tend to see issues pop up on this list before they show up on the regular newsgroups.  For example, I read about the Platform Builder price increase 3 weeks before it started being discussed on the newsgroups.  To join, send an email to WindowsCE-Dev@Lists.WindowsCE.com

Check out some of the books mentioned in this FAQ, and visit some of the other Windows CE developer websites.

Finally, there is nothing like experience. If you can afford it, purchase the Microsoft development tools, NSBasic or one of the other development tools available for the platform. Try building a few applications. If you have previous Windows development experience you will find Windows CE development to be only mildly painful ;-)

1.4 What books are available for Windows CE developers?

Here is a list of some of the Windows CE development books available, in no particular order:

  • Inside Windows CE - John Murray
  • Programming Embedded Systems for Microsoft Windows Ce - Jeff McLeman
  • Professional Visual Basic Windows CE Programming - Larry Roof
  • Programming Windows CE - Douglas Boling
  • Windows CE 2 Programming for Dummies - Nick Gratten
  • Essential Windows CE Application Programming - Robert Burdick
  • Windows CE Developers Handbook - Terence Goggin
  • Windows CE from the Ground Up - Jean Louis Gareau (annabooks web site).
  • Sams Teach Yourself Windows CE Programming in 24 Hours - Bsquare
  • Windows Ce : Application Development - Keven Millsap, Marshall Brain

1.5 What are some other developer related Windows CE websites?

Here are some CE developer websites:

Samples, SDK's and other tools.

Information and advice on Visual C++ for CE.

Information and advice on Visual Basic for CE. Home of the vbceUtils control for Visual Basic for Windows CE.

Cool API samples and demoware applications for Windows CE.

Samples from DevCon 99.

Some MFC based Windows CE samples.

ActiveX controls for Windows CE developers.

Used to be RoadCoders.com - general Windows CE articles and other development info.

1.6 Where can I find information on DevCon 99?

Take a look at this excellent site. Microsoft has posted video for all of the sessions at DevCon 99 in Denver. Go to http://events.microsoft.com/isapi/events/pages.asp?s=63814&p=620 for more information.

1.7 I need to learn CE in a hurry - can I take a class?

Let's say you need to learn Windows CE ASAP! Depending on your budget and time constraints you could attend a class or conference. The following companies offer beginning and advanced Windows CE training:

David Solomon Expert Seminars www.solsem.com
Annabooks www.annabooks.com
The Paul Yao Company www.paulyao.com

Also, Microsoft has an annual Windows CE developer's conference, usually somewhere between April and June.

Finally, if you really want to learn now (or have no budget), go to http://events.microsoft.com/isapi/events/pages.asp?s=63814&p=620 and check out the video samples. Doug Boling gave did a one-day "Windows CE for application developer's" seminar at DevCon and it is available here.

If you know of others, or want to add your seminar, class or conference, send an email to faq@cegadgets.com and we'll get you added to the list.

1.8 Things to consider before you design that new Windows CE application.

Click here to read the entire article.

1. Read the logo requirements before you design your application.
2. Make life easy for your users - design for your device.
3. Remember power issues - polling, serial port waste power
4. Handle WM_HIBERNATE
5. Think about internet connectivity.
6. Check GNU for portable source code - your app may already be written.
7. Remember, you can't use VB on Palm Sized PC's running Windows CE 2.0 - 2.11 only.
8. Write a help file for your application
9. Plan to write an installer - it's easy
10. Test on actual devices. The emulator is nice but it is not a true Windows CE device.
11. Don't use floating point operations on if you can help it.
12. Buy a Socket Communications ethernet card - it is worth the money.

1.9 I want to develop using Visual C++. What do I need?

Developing using Visual C++ is nice because it will work on any CE platform.

  • The Visual C++ Toolkit for Windows CE 5.0

This is an older version of the Windows CE development environment. It is missing some nice features offered by 6.0, and does not have support for the PSPC 1.2 SDK, ethernet debugging, etc. Interestingly, it does offer an object store browser that was removed in version 6.0. The 5.0 toolkit also lets you target Windows CE 1.0. The 6.0 product does not.

To develop using Visual C++ 5.0 you will need the following:

Visual C++ 5.0, Professional or Enterprise edition
Visual C++ Toolkit for Windows CE 5.0
HPC or PSPC SDK, downloadable for free from the Microsoft web site.

  • The Visual C++ Toolkit for Windows CE 6.0

The current C/C++ development environment for Windows CE.

To develop using Visual C++ 6.0 you will need the following:

Visual C++ 6.0, Professional or Enterprise edition
Visual C++ Toolkit for Windows CE 6.0
Any of the CE SDK's, downloadable for free from the Microsoft web site.

1.10 I want to develop using Visual Basic. What do I need?

First, you need to have an HPC, HPC Pro or a Palm Size PC running 2.11! Many people have purchased the Visual Basic toolkit, written an application and attempted to copy it to a Nino or some other 2.01 device. It does not work! Below is a list of valid Palm Size devices:

Casio E-15, E-100, E-105
HP Jornada 420 and 428
Compaq Aero A2xxx
Philips Nino 520
Everex FreeStyle 540
Any new Palm Size device released after 9/11/99.

Take a look at the official Microsoft statement http://msdn.microsoft.com/cetools/platform/ppcfeatures.asp under the heading of "Visual Basic Runtime in ROM".

Below are descriptions of the available Visual Basic toolkits.

  • The Visual Basic Toolkit for Windows CE 5.0

The first version of basic that supported Windows CE. It was a challenging and generally unpleasant experience developing software for Windows CE using this tool. While version 6.0 has shortcomings, it is worth the upgrade price to make the switch to the Visual Basic toolkit for Windows CE 6.0. To develop using the Visual Basic, you will need:

Visual Basic 5.0, Professional or Enterprise edition
Visual Basic Toolkit for Windows CE 5.0
The HPC SDK

  • The Visual Basic Toolkit for Windows CE 6.0

The current version of Visual Basic for CE. To develop using the Visual Basic, you will need:

Visual Basic 6.0, Professional or Enterprise edition
Visual Basic Toolkit for Windows CE 6.0
The HPC SDK, HPC Pro SDK or the PSPC SDK v. 1.2.

1.11 What other development tools are available for windows CE?

Check out the full article, with comments and pricing on each tool.

1.12 How do I report bugs (or feature requests) in Windows CE development tools?

Microsoft has a couple of useful email addresses:

Windows CE development tools feature suggestions:
wcetwish@microsoft.com

Windows CE Development Tools Bug Reporting:
wcetbug@microsoft.com

1.13 Should I get a copy of Platform Builder 2.11/2.12?

As an application developer you may think Platform Builder doesn't apply to you. While this is mostly true, Platform Builder includes a wealth of information on the internals of Windows CE, including prototypes for functions not documented in the SDK. The Platform Builder help files also contain great information about the workings of the operating system. While this isn't necessarily going to help you make a better list control, you can find interesting little features like RegCopyFile, which copies the entire registry to a file, or PowerOffSystem.

Unfortunately, Platform Builder is a little pricey, and rumor has it PB will be more so when 2.12 is released. Microsoft will charge up to $3000 for Platform Builder and also require a purchase of 250 Windows CE licenses, putting the total price around $13,000! Not to worry, though.  If you really want to get a copy of Platform Builder 2.12 for evaluation purposes, you can purchase the Universal MSDN subscription (which is roughly $2500 I believe).  MSDN Universal not only comes with PB 2.12, but it also contains all the toolkits, SDKs, development tools, and operating system you will need to develop Windows CE software (or any other software for that matter). 

A 60-day trial edition of Platform Builder 2.12 is included with a subscription to MSDN Universal. You can also obtain a trial edition from a distributor for a small fee, ~ $25. See http://www.microsoft.com/embedded/distributors/distrib.asp for a list of distributors.

1.14 Where can I find a MIPS or SH3 disassembler?

Check out http://www.datarescue.com/idawindowsce.htm for a Windows CE code disassembler.

Delosoft also produces a disassembler for MIPS and SH3 executables. Check out www.delosoft.com for more information.

1.15 Can I write DCOM application under Windows CE?

Windows CE 2.11 and earlier do not contain a DCOM implementation - only inproc servers are allowed at this time. However, is has been mentioned that Microsoft does have DCOM for CE in beta (as of 9/99). Perhaps it will be included with CE 3.0 (Cedar) if everything goes as Microsoft plans.

Intrinsyc has a "DCOM" implementation for CE 2.XX+. While not identical to Microsoft's desktop DCOM implementation, it offers similar functionality. More info can be found at http://www.intrinsyc.com.

1.16 Is the SH4 binary compatible with the SH3?

I found this interesting exchange on the windowsce.com developer mailing list:

When I run any SH3 applications on an SH4 device the program starts to load, but the busy icon freezes and never returns.

Response:

Some folks from Hitachi were here Tuesday promoting their new CE unit, which uses an SH4 chip. I asked whether I would have to recompile my app, and they said YES. In other words, the SH3 and SH4 are not binary compatible.

So in other words, according to the post the SH4 is not backwards compatible with the SH3. I have seen other posts mentioning similar problems; the SH3 application will run on an SH4 but crash in peculiar places, for no apparent reason. These same people say that recompiling their app for SH4 seemed to resolve the problems. Also, the compiler warns if an SH3 app is being downloaded to an SH4 machine.

1.17 Does Windows CE support COM?

Windows CE only supports in-process COM object.  There is talk of extending COM functionality in the next major release of Windows CE.  Here are a few references for getting started with COM and CE:

  • "How to Write and Use ActiveX Controls for Microsoft Windows CE" from the MSDN
  • "The Tools You'll Need to Build Embedded Apps: Windows CE Toolkit for Visual C++ 6.0" from MSJ July 1999. There's a section called "Desktop ActiveX Controls".

I have used ATL quite a bit on the CE platform, and aside from one minor problem with connection points, everything works well.  All of the controls available on the CEGadgets.com main page are written using ATLCE.

See Can I write DCOM applications for Windows CE for information on DCOM and CE.

2. Visual C++ Issues

2.1 What do I really need to write C++ apps for Windows CE?

To develop using Visual C++ 6.0 you will need the following:

  • Visual C++ 6.0
  • Visual C++ Toolkit for Windows CE 6.0
  • Any of the CE SDK's, downloadable for free from the Microsoft web site.

You will also need to be running Windows NT 4.0 with SP3 or greater installed.  You can develo using Windows 95/98 as well, but won't be able to use the emulator (which requires a UNICODE operating system).

2.2 Do I need to purchase the Windows CE Toolkit for C++ or Basic to develop for CE?

Yes, you do need to purchase the C++ or Basic Toolkit. Microsoft gets about $200 for it, but there are third party software vendors that will sell it to you for less. buy.com has it for $167.

The toolkit contains the compilers and linkers needed to create executables for Windows CE.  It contains support for the various processor types supported by Windows CE.

The "SDKs" contain the various header and library files used in actually writing the application.  Each SDK contains any customizations to the Win32 API needed by a particular platform, such as the addition of the SIPINFO APIs for Palm-size PCs.

The Windows CE SDKs are free and readily downloadable at: http://msdn.microsoft.com/cetools/downloads/devkits.asp

You can also use tools like NSBasic ($99) to develop directly on the device...

2.3 Can I use Visual Studio SP3 with the Toolkit for Windows CE?

Microsoft states that SP3 is incompatible with WCE toolkit at this time (9/2/99).

2.4 Can I use Windows 95/98 to build Windows CE applications?

You can run VC 5.0 under Windows 95/98 but you will not be able to use the emulator.

You may be able to run VC 6.0 under Windows 95/98 (but you will not be able to use the emulator). It was mentioned on one of the CE newsgroups that as of 6.0, the Windows CE Toolkit will not allow installs to 95/98, but I have only seen this comment once. I haven't tried this (I did use the 5.0 toolkit on 95 and 98 without trouble). However, several other people have written stating that the 6.0 Toolkit does install under 95/98, so I'd bet that there really isn't any problem with this approach.

2.5 My MFC app doesn't run on the device the first time I try?

Some files (like mfcce20d.dll) are not copied properly during the installation of the toolkit. Check the following page for more info:

http://support.microsoft.com/support/kb/articles/q187/6/16.asp

2.6 I keep getting internal compiler errors? How do I make them go away?

The Windows CE compiler is a little finicky when it comes to code. If you get an error like:

myfile.cpp(234): fatal internal error CBE7002:
try changing your code around a little. Move your declarations, remove extra spaces, etc. Basically just change the code style a little bit and try to compile again. This usually fixes the problem.

2.7 I use a serial connection to remotely debug my x86 applications, but the serial connection speed is slow. How can I make it faster?

Contact MS support for a fix to the TCP/IP stack to increase the speed of Apps debugging with DevStudio Add-in. Note that this applies to remote debugging on x86 based platforms (CEPC, etc).

2.8 How can I copy files to the emulator?

After successfully installing your SDK, look for the Windows CE Platform SDK menu item under Start, Programs. Launch 'Emulation Environment for [platform name]'. This will launch a console window. At this point, type empfile -? for options, or type empfile -c [source filename] wce:[taregt location in object store].

For example, empfile -c e:\CEproject\myapp.exe wce:\windows\start menu\myapp.exe will copy myapp.exe into the emulator object store.

2.9 Can I use C++ exceptions in my Windows CE application?

C++ exceptions are not supported on Windows CE. But Win32 exceptions are. You can use the __try and __except keywords (and also the __try and __finally keywords). MFC exceptions are also supported (TRY, CATCH, etc.)

However, the key words for C++ exceptions (try, catch, and throw -- with *no* leading underscores) are not supported.

2.10 Can I use STL in my Windows CE application?

STL relies on exceptions, and since exceptions are not supported under Windows CE, STL cannot be fully implemented. There are a few ports of STL to CE that do not rely on exceptions. Take a look at:

Search www.deja.com for information on STL and CE for more information. If you have information on other STL ports let me know.

2.11 I populate my combobox using the resource editor, yet when I run my application under CE all I see is garbage. What can I do?

Apparently the resource editor treats the text as ANSI, not UNICODE. You have to populate the listbox programatically.

2.12 Is there a way to edit my Visual C++ files on my handheld?

Logical Sky has produced a syntax highlighting C++ editor for use on HPC and HPC/Pro platforms. Here's a recent press release:

Logical Sky is proud to announce the release of CEdit for Windows CE!

CEdit is a color syntax hilighting C++ editor for Windows CE. CEdit is designed for C++ developers who need to work with their source code when they are away from their desks. CEdit is compatible with Microsoft Visual C++. It allows you to open a Visual C++ project file on your handheld, so that you will have quick access to all of your C++ files.

CEdit is designed for MIPS and SH3 based H/PCs. CEdit will not run on a palm-sized CE device.

A free fully functional 30 day demo is available from: http://www.LogicalSky.com.

CEdit is $49.95.

2.13 How does compiler optimization affect Windows CE executables?

I came across the following interesting post in the windowsce-dev digest:

I've been working on a project targeted to the SH3 processor and I noticed that the Release mode EXE for the SH3 was actually larger that the Debug version with symbols!  After a little thought I remembered an article in MSJ a year or so ago or so discussing the various optimizations of the x86 compiler in DevStudio.  IT said that often the default optimization for speed can be slower that the optimizations for size and that it can get worse for RISC processors.  So I compiled for Size instead of speed and there were MAJOR differences in EXE size.

X.EXE CPU Debug Opt Size Opt Speed
SH3 176K 131K 187K
x86 189K 120K 136K

Additionally I couldn't detect any difference in the speed of the code in a relatively GUI intensive app.

Just thought I share that it's actually worth the time spent trying different optimizations, at least on the RISC processors.

2.14 Where is the Windows CE C runtime library? Is source for the runtime available?

Starting with Windows CE 2.01, Microsoft folded the C runtime directly into coredll (in other words, Windows CE 2.0 for the HPC is the only version that did not do this).  One reason for doing this is to help executables stay as small as possible.  With the runtime and API set in ROM, user applications will stay very small.

Microsoft has not released source to the Windows CE C runtime.

2.15 How can I develop applications for Windows CE 1.0?

If for some reason you are stuck doing development for Windows CE 1.0, you will need the Visual C++ 5.0 and the Windows CE Toolkit for Visual C++ 5.0. VC++ 6.0 does not support the WCE 1.0 platform.

2.16 I want to port my Windows desktop application to Windows CE.  What issues will I face?

There are many issues to consider when porting your application to Windows CE.  You will face many obvious issues, like interface changes, power and memory constraints.  However, you will find many not-so-obvious issues to contend with, as well.

Perhaps the largest issue you will face is making your application UNICODE compliant.  Windows CE is a UNICODE operating system, and all strings used in API calls must be UNICODE.

You may  also need to deal with the following issues: missing API's, thread issues, floating point use, sockets, etc.

Check out the full article, Common Windows CE Porting Issues, for more information.

2.17 I can compile for the MIPS and SHx processors, but I don't see an option for the StrongArm.  What can I do?

Download and install the HPC/Pro SDK from http://msdn.microsoft.com/cetools/downloads/hpcprosdk.asp. This SDK  contains what you need to generate executables for the StrongArm using your Windows CE Toolkit.

3. Third Party Tools and Hardware

3.1 Which databases are available on the Windows CE platform?

Check out the full article, Third Party Database Tools for Windows CE, here!

There are a phenomenal amount of database tools available for the Windows CE platform.  Here is the short list of available CE databases:

3.2 Are there any Text-To-Speech engines for the CE platform?

The are a few text to speech (TTS) engines for Windows CE.

Check out Lernout and Hauspie's TTS engine for Windows CE. This is the same speech engine used in the AutoPC. Unfortunately, it is only available for SH3 processors at the current time. See http://www.lhsl.com/ssyn/tts3000wince.asp for more information.

You should also check out the Dectalk TTS engine for Win CE. Apparently, Dectalk was purchased by Fonix Corp.  See http://www.fonix.com/products/dectalk/ for more information.

Another entry to the Windows CE TTS field is from Elan. The Elan TTS toolkit was released 1-Nov-99 and was $495US at that time. It will support the MIPS and SH processors, and will cover the following languages: US English, UK English, French, German, Spanish, Brazilian and Russian.

Note: $495US covers the developer license. The toolkit also requires distribution royalties, which depend on the number of units you ship. Contact Elan for more information - info@elan.fr, or see their web site at www.elantts.com.

3.3 I want to write an MP3 decoder for Windows CE. Where do I start?

There are currently two MP3 players for the Windows CE platform, and both use the Xaudio SDK to actually do MP3 decoding/playback. The Xaudio SDK is easy to use, well documented, and FREE for personal use (you have to license Xaudio for commercial distribution).

Support for Xaudio development is good as well. Check www.xaudio.com for more information and to download the SDK.

If you really want to "roll your own", there is source for mp3 decoders around on the internet. Try www.mpeg.org for more information.

3.4 Are there any printer libraries for Windows CE?

Check out FieldSoftware's PrinterCE ActiveX control. It provides basic print output routines for CE. FieldSoftware offers a barcode package as well.  PrinterCE is license based, with prices ranging from 19.95 for the basic library, up to $1000 for PrinterCE Plus with barcode support, including 500 licenses.

From a FieldSoftware newsgroup post:

PrinterCE makes sophisticated printing from VBCE simple (no worries about device contexts and BitBlits and DIBsections, etc). Plus, PrinterCE goes beyond just plain printing by adding support for printing from Palm-sized PCs!!! as well as printing barcodes, using specialized label printers, and much more.

Get more information at: www.fieldsoftware.com

3.5 How can I work with Pocket Outlook data?

You should definitely check out the POOM SDK. POOM stands for Pocket Outlook Object Model, and represents a standard, easy to use interface into Contacts, Calendar and Tasks on your Windows CE device. Use this in place of modifying the contact, calendar or task databases directly, or even the AddressCard API.

You can download the POOM SDK at msdn.microsoft.com/cetools/platform/poomsdk.asp.

Along with offering basic access to Pocket Outlook, POOM offers some cool features like ReceiveFromInfrared and SentToInfrared, which will squirt the selected object(s) in/out the infrared port. It also allows you to work with cities on the device.

3.6 Is there an FTP client API available for Windows CE?

While an FTP client is documented in the Windows CE help, no FTP client actually ships with OEM devices.  I have heard two explanations for this.  One, given at CE DevCon 99, was that it was up to the OEM to ship or leave out FTP support, and most left it out.  The other is mentioned in the CE documentation.  While FTP functions are documented, there is a statement in the remarks section: "Inetftp.dll is available only for Intel x86 processors."

Here are two third-party sources for Windows CE FTP controls:

Ruksun makes an FTP client, and has packaged some of their code into a simple to use ActiveX control for developers. Contact komal@ruksun.com for information on the control and licensing.

Dev-soft has a massive set of internet controls for Windows CE developers, including support for HTTP, FTP, IMAP, LDAP, NNTP, SMTP, etc. Here's a snippet from their site re: FTP functionality.

FTP - Used to transfer files using the FTP protocol. Very easy to use with a 'plug and play' interface. Supports most corporate firewalls, and has an extensible architecture, enabling access to non-standard FTP server features (mostly found in mainframes).

The toolkit is also royalty-free.

3.7 How can I copy-protect my Windows CE application?

DESkey sells a dongle that plugs into a PCMCIA or compact flash card slot.  Take a look at http://www.des.co.uk/ for more information.  A free developer's kit is available at www.des.co.uk <http://www.des.co.uk>.

Here's some information about DESKey sent to me by the company:

Manufactured to CompactFlash Standard Type I, this device will allow you to protect your Windows CE 2.x applications against unlicensed use / piracy. In addition to this the DESkey API provides the means for your application to encrypt and decrypt data through the DESkey CF Card.

Features:

CompactFlash Design
Random Number Generator
Code or data from your application may be fed through the DESkey for encryption.
Unique 8 Byte Password
Memory - 1,024 bytes of memory as standard. Up to 32K is available on request.
Anti-Emulation Algorithm
The DK3CF+ supports all popular processors including MIPS, SH3 etc.

Also, take a look at R.I.A. TerraSystems (www.mappad.com).  They offer a key-ring device that works by sending a unique ID to the CE device's infrared port.

There are various software-only based protection mechanisms as well, like creating secret entries in the registry, computing a unique ID based on the user and device characteristics, or requiring a valid serial number (supplied by the author) before allowing the application to run.

3.8 Where can I find an XML parser for Windows CE?

On October 13, 1999, mov Software announced a port of EXPAT to Windows CE.  From the post:

EXPAT is a conforming and non-validating XML 1.0 parser, originally written by John Clark. More information about EXPAT can be viewed at http://www.jclark.com/xml/expat.html

EXPAT is distributed via the GPL or MPL 1.1 licenses. To download the source code for EXPAT for Windows CE please visit http://www.movsoftware.com/devres.htm

EXPAT has been verified to work on the following platforms:
CE2.11
    SH3, SH4, ARM, MIPS
CE2.0
    SH3, MIPS

Take a look at http://www.movsoftware.com/expatxml.htm for more information.

3.9 Is GCC available for the Windows CE platform?

Take a look at http://www.innonet.at/~wisi/index.html. There is a GCC MIPS compiler currently under development, although it still is not ready for release.  From the page:

I am trying to finish a port of GCC to WinCE which I found on the page  http://hyperion.clc.cc.il.us/~arty/. The work there was stopped on September 98 and actually I can't find the page any more.  This guy has already done the most work. I tried just to fix some problems.

At the moment the compiler is still in a pre-alpha state. Simple demo programs are working on my VELO500(e.g.: opening a Message Box).

4. Windows CE Overview

4.1 How many processes can Windows CE support?

Windows CE maps the bottom section of memory into 33, 32Mb slices referred to as 'slots'. The lowest slot is used for the currently running process (the process is mapped into slot 0, not copied!), and other low slots are used for system processes as follows (this is how it appears on my casio e-100):

Slot 0: current running process
Slot 1: NK.EXE (kernel)
Slot 2: Filesys.exe (file system - object store, registry, ceDB etc)
Slot 3: Device.exe (device manager)
Slot 4: Shell32.exe (Windows CE shell)

5 slots are used, leaving 28 remaining slots for user processes.

4.2 How many threads can Windows CE run?

While theoretically there are no limits to the number of threads per process, you will eventually run out of memory and virtual address space. Windows CE 2.x has eight priority levels (default is 3). Foreground threads retain the same priority as all other threads at their level.

Threads in Windows CE are referred to as follows:

  • Time Critical (runs until complete)
  • Highest
  • Above Normal
  • Below Normal
  • Lowest
  • Above Idle
  • Idle

One of the new features in Windows CE 3.0 will be support for 256 priority levels.

4.3 What does the basic Windows CE memory map look like?

The Windows CE address space is 4GB. The bottom 2Gb are used for processes and application shared space. The operating system uses the top 2Gb - hardware, object store and ROM are mapped here (Note that some locations may be different on your device). Have any additional info - please send it to me and I'll add it to the list.

FFFF FFFF: top of memory
BF00 0000: Beginning of ROM area
AB00 0000: I/O Registers on a MIPS R4xxx
AA00 0000: Beginning of screen memory
A000 0000: Beginning of DRAM area
8000 0000: Beginning of kernel memory space
[.]
4200 0000: begin shared app memory (memory mapped files)
4000 0000: slot 32 space
[...]
0400 0000: slot 2 - filesys.exe
0200 0000: slot 1 - nk.exe
0000 0000: slot 0 - current process space

4.4 What is Execute-In-Place (XIP) and what does it mean for me?

Execute In Place is the ability for Windows CE to run applications (or operating system code) right in ROM. There is no need to copy the executable from ROM to RAM and run it - that would just waste time and memory.

As an application developer you should keep this in mind - who knows, Casio or HP might buy your application and, burn it into their next device, and sell it to the masses! So, don't write back to your executable or do anything else that would prevent your application from being ROM'd.

4.5 I want to make my own shell. Where should I start?

Try to beg, borrow or steal the Platform Builder v. 2.12. There is source for a simple Windows CE shell on CD 1. This code is an excellent starting point. Your shell will need to handle the battery monitor, resource checking and WM_HIBERNATE message generation.

BSquare has introduced a new development tool, Interface Composer, which allows the developer to create his own shell.  While I believe this product targets the embedded developer looking to implement a cool shell, it can also be used by the developer to create new, custom shells and skins for distribution to OEM device users.

4.6 Can I trash my object store by turning off the power during a file operation?

The Windows CE development team worked very hard to prevent this. The object store is based on a transactional model, complete with a transaction log tracking the most recent object store operations. If any catastrophe occurs, Windows CE can roll back the log to the last good point. In the case of an interruption during database or file delete, Windows CE can actually roll forward, continuing the operation.

See Inside Windows CE, chapter 4, for a good look at the design philosophy behind the object store.

4.7 How much stack space can I use per thread?

In Windows CE 2.0 the limit was 58K per thread. This was changed in 2.1 to be up to 1Mb (that's a big stack!) per thread. 2.1 also allows setting the stack size at compile time, but all threads in your application will have the same stack size.

4.8 Why does my Windows CE 2.0 stack blow out, even if I allocated it at compile time?

Unlike the desktop, Windows CE 2.0 only allocates application stack space as it is needed. This can cause problems if memory is nearly full and you are allocating on the stack. This was changed in CE 2.1.

4.9 What kind of limitations will I encounter using the CE Database?

Windows CE 2.11 and earlier are limited to 4 indexes. Wince 3.0 is increasing the limit to 8.

I assume you could technically have up to 2^32 records, since records are identified by CEOIDs, and since CEOID's are currently DWORDS. I did see a post online showing that the limit was around 16K records, but I have not verified this. 

However, if you are going to be dealing with more than 1500 records do not use the CE database system - it is really slow.

5. General Windows CE Development

5.1 I can't find an API that I need. What should I do?

When writing Windows CE applications, try to keep in mind the Win CE development team philosophy.  They took a look at the entire Win32 API and included only API's they felt they needed - for example, they would leave out an API if the same thing could be accomplished using three other existing API's.  In other words, if you find that an API is missing, first look around and say to yourself "how could I accomplish the same thing using other API's", since for the most part the Win CE team left out an API if they thought it could be implemented in another way.

Another thing to do is dumpbin /all coredll.lib in your sdk lib directory. There are plenty of API functions (over 2400 on the 2.11 pspc) and one may be just what you need. If you have Platform Builder you have access to the prototypes as well. For example, I just found SetWindowsHookEx, which appears to be similar to the desktop SetWindowsHookEx. The documentation says that SetWindowsHookEx is unavailable, but there it is in coredll.lib.

Also, if you want an API for the HPC 2.00 that isn't documented until 2.11, check the 2.00 coredll.lib anyway. It may be in there. Of course, there may be a reason it is undocumented (ie. it does not work!) so, again, use undocumented functions with care and test, test, test.

And finally, if the API is undocumented it may not be there in future versions. Rumor has it that Microsoft is making big changes to 3.0, and even if they are making little changes, you might get left out.

5.2 How can I insure only one instance of my application?

There are a few methods - the registry, FindWindow(), and CreateMutex().

You can store a value in the registry when your application starts, and remove it when your application terminates.  Unfortunately, if your application crashes is abnormally terminates, your registry value will not be removed.  When you go to run the first instance of your application again, it will see the registry entry and stop running. 

The FindWindow() method is the easiest to implement. In your InitInstance search for another instance of your application name, ie.

HWND hWnd=FindWindow(YOUR_WINDOW_CLASS, YOUR_WINDOW_TITLE);
if(NULL!=hWnd) {

SetForegroundWindow(hWnd);
return 0;

}

Here's some sample VB code you can use to find a window.  This sample assumes the window title is SampleForm.

Public Declare Function FindWindow Lib "Coredll" Alias "FindWindowW" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function GetLastError Lib "Coredll" () As Long

On Error Resume Next
Dim hWndX As Long

hWndX = FindWindow("Form1", "SampleForm")
If (hWndX <> 0) Then MsgBox "found it!"    '

If you are a VBCE user, you may want to consider creating a c++ launcher that checks for a previous instance of your application and changes focus to it if found.  You can then launch the vb application if it is not running.  As a side benefit, you can also create an icon to go with your vb application.   

Another technique is to use CreateMutex(). You first need to attempt to create a mutex and make sure it does not already exist. If the mutex does exist, you would post a registered message to all the top level windows to tell the application to move itself to the foreground, then close the current instance.

HANDLE hMutex=CreateMutex(NULL, TRUE, _T("YOUR_MUTEX_NAME_HERE"));

if(hMutex && ERROR_ALREADY_EXISTS==GetLastError()) {

// The app is already running
CloseHandle(hMutex);
return 0;

}

5.3 How can I make I application startup on system startup?

KEY_LOCAL_MACHINE\Init contains executables to run during device startup. Executables are listed under LaunchXX keys, where XX determines the run order to use. Another key, DependXX, allows specifying dependencies (ie. Launch50 can't run unless Launch40 was successful).

Create a new key under HKEY_LOCAL_MACHINE\Init named Launch60 (or anything greater than Launch50) , and supply the executable name to run. If you want the exe to launch only if the shell successfully started, create Depend60 and set the value to 32h (hex for 50).

An easier way to start an application on system startup is to put a link to your application in the \Windows\StartUp folder.

5.4 How can I prevent other applications from running while my application is active (how can I keep users from accessing the Start Menu)?

One technique is to disable the taskbar. Using FindWindow, get the handle to the taskbar window and disable it. When your program exits, make sure you enable it though! Also, a disabled taskbar makes it difficult to use the SIP. You may have to manually show/hide the SIP to work around this problem.

Here's an example:

HWND hTaskBarWnd = ::FindWindow(_T("HHTaskBar"), NULL);

if (hTaskBarWnd) {

::EnableWindow(hTaskBarWnd, FALSE);
::ShowWindow(hTaskBarWnd, SW_HIDE);

}

Note that this approach may cause the desktop to not redraw properly. If this is a problem, grab the desktop window and manually resize that as well, as follows:

HWND hDesktopWnd = ::FindWindow(_T("DesktopExplorerWindow"), NULL);

If (hDesktopWnd)

::SetWindowPos(hDesktopWnd, NULL, 0, 0, GetSystemMetrics(SM_CYSCREEN), GetSystemMetrics(SM_CYSCREEN) - 26, SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOMOVE);

Note that 26 is the task bar height. I suppose this could change so it may be a good idea to compute the taskbar height prior to resizing the desktop window.

5.5 How can I change task bar settings such as Auto Hide?

AutoHide and other task bar settings are contained in the registry key HKEY_LOCAL_MACHINE\Software\Microsoft\Shell in a value called TBOpts. TBOpts is a DWORD bitfield containing four entries:

#define MENUOPT_SHOWTIME 0x0001
#define MENUOPT_SHOWDATE 0x0002
#define MENUOPT_SHOWBANNER 0x0004
#define MENUOPT_AUTOHIDE 0x0008

Once you change the TBOpts value to show or hide various task bar settings you need to notify the task bar. The following:

SendMessage(hTaskBarWnd, WM_COMMAND, 0x3EA, 0)

Will notify the taskbar that changes were made and cause it to update accordingly.

5.6 How do I keep my device from auto-suspending?

One way to keep your device from auto-suspending is to issue a keyboard event every n minutes, such as:

keybd_event(VK_F24, 0, KEYEVENTF_KEYUP | KEYEVENTF_SILENT, 0);

If you are using VBCE, try the following:

Public Declare Sub keybd_event Lib "coredll.dll" (ByVal bVK As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)

In the timer control event, type (7B is VK_F12 - you could use any character you like):

keybd_event &H7B, 0, 0, 0
keybd_event &H7B, 0, &H2, 0

Another suggestion is to open a socket and keep it open as long as you want the system to stay awake.

Finally, you can use SystemParametersInfo to set the timeout to 0, disabling it. For example,

SystemParametersInfo(SPI_SETBATTERYIDLETIMEOUT, 0, NULL, TRUE);

The problem I see with this approach is that if your application crashes or somehow manages to exit without putting it back to its previous value, the device will no longer timeout when idle. Even soft resetting the device would not fix the problem, so use this approach with care. When using this approach, the power settings in the control panel show the default settings, but the timeout never occurs.

There is also an undocumented API SetPowerOffHandler, but I have had no luck getting it to work. I can make the device start doing weird power related things, but not exactly what you would want to ship!

5.7 How do I detect power-on?

You can detect power on using WaitCommEvent and the EV_POWER mask. Open a serial port and wait for an EV_POWER event. When the event occurs send your application window a message letting it know that the power was turned back on.

SetCommMask(comportHandle, EV_POWER);
WaitCommEvent(comportHandle, &eventValue, NULL);
SendMessage(hwnd, WM_POWERON, 0, 0);

One caveat - opening the serial port turns on the serial hardware, which takes additional battery power. I don't have any hard numbers on the effect this technique has on battery life (yet).  Another caveat - this may interfere with other applications use of the serial port. Test carefully after implementing this power-on detection technique.

Another way to detect power on was discussed in the Windows CE Tech Journal, September 1999 issue. In the article, Jeff Spurgat described how device drivers receive power state change notifications, and how application developers can latch on to this functionality to receive power on notifications.

Basically, device drivers receive a powerup and powerdown message. Typically, a device driver will power up or power down their hardware based on this notification and return as quickly as possible without calling the kernel or any function that can cause a paging operation. In the article, Jeff simply sets a few global variables when the power state changes. He has a worker thread monitor the state of these variables once per second, and do a PostMessage if the poweron flag is true. Jeff provides sample code as well - both a working power detection driver and a sample application that works with the driver. You can download it here.

Finally, another interesting suggestion is to create an application thread with that fires a timer once every n seconds. Every time the timer fires, compare the current system time (GetSystemTime) with the last (saved) system time value. If the difference exceeds the timer interval the device has been suspended during the interval.

5.8 How can I programmatically turn off the device?

Windows CE treats the power button just like a keyboard key. Because of this, you can simply send a VK_OFF keystroke to the system and it will power off, just like you pressed the off button!

void SuspendDevice()
{

keybd_event(VK_OFF, 0, 0, 0); // down
keybd_event(VK_OFF, 0, 2, 0); // up

// code execution resumes on the next line...
MySampleFunction(); // runs when the device wakes back up...

}

By the way, VK_OFF is defined as 0xDF.

You can also use the PowerOffSystem function. This function is undocumented, so it may change or disappear at any time.

The undocumented function void PowerOffSystem(void) is declared in coredll.dll. It places the CE device in suspend state. However, when power is restored the user password dialog is not shown and the desktop and other windows are not redrawn. Code execution continues at the next line after the PowerOffSystem call.

You can invalidate all windows to get around the redraw problem, and you can also detect the 'prompt for password' state, and if required, display your own password dialog, and use CheckPassword to check the entered password against the user's password.

GwesPowerOff is another power API.  The GWES calls GwesPowerOff when suspending the device.  This may be a better approach than calling PowerOffSystem directly.   Check out http://support.microsoft.com/support/kb/articles/Q207/9/88.ASP for more information. [Thanks to Mike Burch for this tip].

Finally, see Suspending Your Device Programatically for an article and code samples discussing power off APIs.

5.9 How can I get battery status?

Use the GetSystemPowerStatusEx API, available under WCE 2.0 and greater.

5.10 How can I determine the device type?

Use SystemParametersInfo. There is an option SPI_GETPLATFORMTYPE which returns a string containing the platform.

BTW, HPC Pro devices return 'Jupiter'.

5.11 How can I determine the device name?

Note: This key may not be valid on all platforms. Check your platform

Check the registry key HKEY_LOCAL_MACHINE\Platform for a value named 'Name'. The value corresponds to the OEM specified device name. For example, on the casio e-100 it is Casio Jx530 CE2.11. One the Nino 312 it is Philips Version 1.

5.12 How can I initiate a connection to the desktop?

Do a CreateProcess or ShellExecuteEx using \windows\repllog.exe. ReplLog will start an activesync session with the desktop.

5.13 How can I tell if ActiveSync is currently running?

One hack is to do a FindWindow looking for repllog. If you find it, activesync is either running or attempting to connect.

5.14 How can I programmatically change the display brightness?

There is no standard API to change brightness (that I know of). Each OEM implements brightness controls in their own way. If you are interested in modifying brightness check with the OEM or if you can, inspect the OEM display driver.

5.15 How do I reboot/reset the device?

OEM's can optionally handle the IOCTL_HAL_REBOOT in OEMIoControl. However, applications cannot call OEMIoControl directly, but they can call KernelIoControl, which in turn calls OEMIoControl.

#include "winioctl.h"

BOOL KernelIoControl(DWORD dwIoControlCode, LPVOID lpInBuf, DWORD nInBufSize, LPVOID lpOutBuf, DWORD nOutBufSize, LPDWORD lpBytesReturned);
#define IOCTL_HAL_GET_DEVICE_INFO CTL_CODE(FILE_DEVICE_HAL, 1, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_HAL_REBOOT CTL_CODE(FILE_DEVICE_HAL, 15, METHOD_BUFFERED, FILE_ANY_ACCESS)

KernelIoControl(IOCTL_HAL_REBOOT, &inVal, 4, outBuf, 1024, &bytesReturned);

If implemented by the OEM this function would perform a soft reset of the device. If you want to perform a hard reset, first call SetCleanRebootFlag.

Note that this did not work on the Casio E-100. Also, future versions of CE will implement SetCleanRebootFlag as a restricted function.

5.16 How can I change the size of the object store?

Note: these functions are documented only in Platform Builder, and are likely to be restricted in future versions of Windows CE.

The functions GetSystemMemoryDivision and SetSystemMemoryDivision allow you to change the relationship between memory and the object store.

The prototypes are:

BOOL GetSystemMemoryDivision(LPDWORD storePages, LPDWORD ramPages, LPDWORD pageSize);

DWORD SetSystemMemoryDivision(DWORD storePages);

The function returns SYSMEM_CHANGED if executed successfully.
The function returns SYSMEM_FAILED if storePages is out of range.
If SYSMEM_FAILED is returned, you can get further information by calling GetLastError.
If a reboot is necessary for the change to take effect, the function returns SYSMEM_MUSTREBOOT.
If a previous call returned SYSMEM_MUSTREBOOT, the function returns SYSMEM_REBOOTPENDING. In this situation, the boundary cannot be adjusted further until the reboot occurs.

You cannot shrink system memory or the object store memory beyond 256K each, including space for existing files and records.

5.17 How can I reprogram the buttons on the device? Can I use hardware buttons to initiate application functionality?

Check out the following API's:

RegisterHotkey
UnregisterHotkey
UnregisterFunc1 (undocumented)

Also, check out http://www.conduits.com/ce/dev/wince.htm and take a look at the keytest example - it contains code to actually do this.

5.18 I am writing a dialog based application. Why doesn't an entry appear in the taskbar or in the task list?

The taskbar only contains buttons for visible, top-level windows that have the WS_OVERLAPPED style. By default, dialog boxes have the WS_POPUP style and thus do not get taskbar buttons. The workaround is to change your dialog box style in the resource editor from WS_POPUP to WS_OVERLAPPED.

There was an interesting report from someone using PB 2.12. They did not want a taskbar button, and did not use WS_OVERLAPPED, but the taskbar button still appeared! Perhaps the default dialog/taskbar behavior has been changed in 2.12.

5.19 I want to modify the contact database. What is the contact database name or CEOID?

You should not attempt to modify the contact database directly, but instead use the API set supplied by Windows CE.

Check out OpenAddressBook, CreateAddressBook, CloseAddressBook, as well as AddressCard, GetAddressCardProperties, ModifyAddressCard, etc.

You may also want to check out the Pocket Outlook Object Model SDK, aka POOM SDK. POOM offers a simple interface into the contact, calendar and task database. You can download the POOM SDK at msdn.microsoft.com/cetools/platform/poomsdk.asp.

5.20 What is Venus?

Venus is produced by Chinese television manufacturer TCL. The Venus computer comes with a 56kb modem and a television interface, and runs the Windows CE OS. Venus provides easy internet access through the user's television. TCL plans to start selling Venus in October, and hopes to sell 300,000 units by the end of the first year.

5.21 What is Cedar?

Cedar is the codename for Windows CE 3.0. It should be release sometime around 2Q 2000. Cedar will contain lots of cool stuff, including more DirectX support, MSMQ, CEF.

5.22 When is MSMQ going to be available?

It will be released as part of Windows CE 3.0. MSMQ is ideal for wireless communications - think of it as transaction based messaging. If some of you information gets lost or mangled on the way to the server you can rollback to the beginning of the transaction.

Rumor has it you should expect Windows CE 3.0 out around 2Q 2000, so I guess you can expect MSMQ around the same time.

5.23 How do I get the time under CE - or, what happened to time()?

Use SYSTEMTIME and GetLocalTime instead, ie.

SYSTEMTIME st;
::GetLocalTime(&st);

5.24 How can I convert a pwi to an rtf?

For VCCE there is a document on MSDN named "Converting Rich Ink Data" that provides code for converting between .pwi and .rtf.

5.25 How can I determine whether the device has been rebooted/reset since the last time the application ran?

Check the registry key HKEY_LOCAL_MACHINE\Comm for the value BootCount. This value is incremented every time the device is soft-reset. If the device is hard reset the value is set back to one.

I received a report that this key isn't found on an HP620LX.  Perhaps it was not implemented in the HPC 2.0 OS.

5.26 How can I make a resource only DLL under Windows CE?

You need to define the entry point to the DLL. Just declare DllMain and have it return TRUE.

#if defined(UNDER_CE) && !defined(_WIN32_WCE_EMULATION)
#include <windows.h>
extern "C"
BOOL WINAPI DllMain (
HANDLE /*hInstance*/, // @parm handle of instance
DWORD /*dwReason*/, // @parm reason
LPVOID /*lpReserved*/ // @parm reserved
)
{
return TRUE; // ok
}
#endif

5.27 How can I determine the current SIP state?

GetSIPInfo allows you to determine the current SIP show state. Unfortunately, GetSIPInfo requires a UDT which is not available in VBCE 6.0. If you need to get the SIP show state from VBCE 6.0, get the vbceSoftKey control from www.cegadgets.com.

5.28 How can I change the current SIP state?

You can control the state of the SIP either using SipShowIM or by filling out the SIPINFO structure and using SetSIPInfo.

SipShowIM is handy because it can be used from VBCE 6.0. The prototype for SipShowIM is BOOL SipShowIM( DWORD dwFlags ), where dwFlags is either of the following:

#define SIPF_OFF 0x00000000
#define SIPF_ON  0x00000001

If you need to retrieve the current SIP display state from VBCE 6.0, get the vbceSoftKey control from www.cegadgets.com.  It is a good idea to query the current SIP state prior to showing it - you don't need to show it if its already up, and you do not want to hide it later if the user has chosen to show it.

SetSIPInfo is more robust - you can also determine the current show, hide state of the SIP, get the SIP rectangle size or the visible rectangle size.  Unfortunately, it is only availble from vcce (until the vbceSoftKey control is updated).

Another approach to showing and hiding the SIP involves finding the SIP window and manually showing or hiding it.  Note that this approach does not rely on aygshell.lib, which is nice if you want the same code to run on an hpc and pspc device.

// created by Dennis Berditchevsky
void UL_RaiseSIP(BOOL bRaise)
{
     // Find window class: "SipWndClass"
     CWnd *pWndKeyb ;
     if( pWndKeyb = CWnd::FindWindow(_T("SipWndClass"),NULL) ) {
          if( bRaise ) {
               if( !pWndKeyb->IsWindowVisible() ) {
                    pWndKeyb->ShowWindow(SW_SHOW);
                    bSipUp_Glob = TRUE; // show it. And not manually.
               }
          } else {
               if( bSipUp_Glob ) {
                    pWndKeyb->ShowWindow(SW_HIDE);
                    bSipUp_Glob = FALSE;
               }
          } //endif(bRaise)
     } //endif(pWndKeyb)
}

5.29 How can I enable or disable the Jot SIP?

You can enable/disable jot via the registry.

There is a registry entry under the Jot registry CLSID key called IsSIPInputMethod. Set this to 0 to hide the method, set it to 1 to show it. Apparently the SIP list displayer checks the registry entries every time it displays the list of available SIP because once you change the registry, the change automatically appears in the list.

The keyname is: HKEY_CLASSES_ROOT\CLSID\{6f311f80-4b14-11d1-ab08-006097490b17}\IsSIPInputMethod.

This method works with other SIPs as well. Just find the CLSID for the SIP you are interested in, change the IsSIPInputMethod to 0, and it will be disabled.

5.30 I need an ownerdrawn listbox but they are unsupported. What should I do?

Ownerdrawn listboxes are not supported under Windows CE. However, use can use a listview control to accomplish the same thing. The listview control can be ownerdrawn, can be set to checkbox style, and has a variety of display modes.

If you are using MFC, create a CListCtrl (either on a dialog via the resource editor or manually using create). Make sure you specify the LVS_OWNERDRAWFIXED style, then handle the DrawItem method. Check out CListCtrl for more information.

Also, if you want to add additional listview functionality, see ListView_SetExtendedListViewStyle. You can see styles like LVS_EX_FULLROWSELECT, which cause the entire row to be highlighted when selected, or LVS_EX_CHECKBOXES, which activates checkboxes on each line of the list view.

5.31 How can I implement a list view with a checkbox next to each item?

Create the listview control normally, then specify:

ListView_SetExtendedListViewStyle(hWnd, LVS_EX_CHECKBOXES);

This causes checkboxes to be displayed in the list control. To set and clear the checkboxes, use:

LVITEM lvi;
lvi.stateMask = LVIS_STATEIMAGEMASK;
lvi.state = UINT((int(isChecked) + 1) << 12);
::SendMessage(m_hWnd, LVM_SETITEMSTATE, nItem, (LPARAM)&lvi);

or if you are using MFC, use:

m_listCtrl.SetItemState(index, UINT((int(isChecked) + 1) << 12), LVIS_STATEIMAGEMASK);

5.32 What is POOM and should I use it?

POOM stands for Pocket Outlook Object Model, and represents a standard, easy to use interface into Contacts, Calendar and Tasks on your Windows CE device. Use this in place of modifying the contact, calendar or task databases directly, or even the AddressCard API.

You can download the POOM SDK at msdn.microsoft.com/cetools/platform/poomsdk.asp.

Along with offering basic access to Pocket Outlook, POOM offers some cool features like ReceiveFromInfrared and SentToInfrared, which will squirt the selected object(s) in/out the infrared port. It also allows you to work with cities on the device.

5.33 How can I programmatically launch a dial-up connection (without using the RAS API)?

Launch \windows\rnaapp.exe using CreateProcess or ShellExecuteEx. For example:

SHELLEXECUTEINFO shInfo;
memset(&shInfo, 0, sizeof(SHELLEXECUTEINFO));
shInfo.cbSize = sizeof(SHELLEXECUTEINFO);
shInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
shInfo.lpFile = _T("rnaapp.exe");
shInfo.lpParameters = _T("-e\"work\" -m");
shInfo.lpDirectory = _T("\\windows");
ShellExecuteEx(&shInfo);

This will start the dial-up connection named work. If you need more control over the connection, use the RAS API.

5.34 How can I write or read a physical memory location?

Use VirtualAlloc and VirtualCopy to read or write to physical memory. VirtualAlloc is documented in the CE SDK help, and VirtualCopy is documented in the Platform Builder docs. The prototype for VirtualCopy is BOOL VirtualCopy ( LPVOID lpvDest, LPVOID lpvSrc, DWORD cbSize, DWORD fdwProtect ). VirtualCopy is defined in coredll.dll.

For example:

// PHYSADDR is the physical address of the peripheral registers
#define PHYSADDR ((PVOID)0x10000000)

#define SIZE (4800*4)
LPVOID lpv;
BOOL bRet;
lpv = VirtualAlloc(0, SIZE, MEM_RESERVE, PAGE_NOACCESS);
bRet = VirtualCopy(lpv, PHYSADDR, SIZE, PAGE_READWRITE | PAGE_NOCACHE);

// At this point lpv is a virtual address which maps the memory at PHYSADDR for SIZE bytes

I have had difficulty using this for access to other process slots - one suggestion was to use SetProcPermissions(0xFFFF) but I did not notice a difference. It may be that SetProcPermissions allow you to access other process slots using regular pointers, as opposed to VirtualAlloc/VirtualCopy.

There are a few quirks with VirtualCopy (ie. shifting bits of address, being on a page boundary). Check the docs for more information.

You could also investigate ReadProcessMemory/WriteProcessMemory.

Note that VirtualCopy, SetProcPermissions, ReadProcessMemory/WriteProcessMemory may  become restricted in future CE versions.

5.35 How can I enumerate Windows CE databases from the desktop?

Enumerating your windows ce device databases from the desktop is fairly straightforward.  Simply initialize the rapi interface, grab a handle to the first database and call CeFindNextDatabase until it returns zero.  Use CeOidGetInfo to retrieve information about the currently selected database. Don't forget to include rapi.h and make sure to link rapi.lib into your project.

Here's an example:

CString message;
CString workString;

m_listboxCtrl.ResetContent();

HANDLE dbHandle = CeFindFirstDatabase(0);    // find all db's
CEOID curDB;
CEOIDINFO ceInfo;
while (curDB = CeFindNextDatabase(dbHandle)) {

  ceInfo.wObjType = OBJTYPE_DATABASE;
  CeOidGetInfo(curDB, &ceInfo);
  workString = ceInfo.infDatabase.szDbaseName;

  message.Format("%s\t%i", workString, ceInfo.infDatabase.wNumRecords);
  m_listboxCtrl.AddString(message);

}

There is also an MFC example, wcedbtst, that covers much of the CEDatabase functionality, including reading/writing database records, so I didn't bother covering that here.  The CE RAPI functions I used above are available as part of the Win32 API.

And for more documentation, take a look at the source files shipped with MFC, even if you aren't using MFC .  There is quite a bit of code showing how to implement Win32 API functions, since that is how MFC is built.

5.36 I need to use IrDA to communicate with other devices. Where should I start?

Check out the IrDA article at: http://www.microsoft.com/mind/0599/wince/wince.htm. It gives a detailed explanation if IrDA and some interesting things you can do with it.

5.37 How can I show the wait cursor, especially from VBCE?

If you are using VBCE and want to show a waitcursor, try this code I found in the microsoft.public.vbce newsgroup, posted by Piet De Booser:

Following code works on a PPC but only on the device not in emulation.

Declare Function LoadCursor Lib "coredll.dll" Alias "LoadCursorW" (ByVal
hInstance As Long, ByVal lpCursorName As Long) As Long
Declare Function SetCursor Lib "coredll.dll" (ByVal hCursor As Long) As Long
Const IDC_WAIT = 32514

Function WaitCursor(bOnOrOff As Boolean) As Long

    If bOnOrOff = True Then
        hCursor = LoadCursor(0, IDC_WAIT)
    Else
        hCursor = LoadCursor(0, 0)
    End If
    WaitCursor = SetCursor(hCursor)
End Function

If you are using VCCE you can using the MFC CWaitCursor class, which works nicely, or just the straight SDK function:

SetCursor(SetCursor(LoadCursor(NULL, IDC_WAIT)); // set wait cursor
SetCursor(NULL); // remove wait cursor

You do not need to call DestroyCursor on the wait cursor. It is a shared cursor, and DestroyCursor is only used on cursors created with CreateCursor.

5.38 How can I print from a Windows CE application?

This code was posted online by Tim Fields of Field Software. Fieldsoftware produces an ActiveX print control. See www.fieldsoftware.com for more information. Note: I have not had a chance to try this code.

PAGESETUPDLG pgs;
memset((void*) &pgs,0,sizeof(PAGESETUPDLG));
pgs.lStructSize = sizeof(PAGESETUPDLG);

// pop up page setup dialog box
int rval=PageSetupDlg(&pgs); //fills pgs structure with current settings
if (rval==0) {
     // handle error..
}

// You can now get margin setting values from pgs structure

LPDEVNAMES lpDev;
lpDev=(LPDEVNAMES) GlobalLock(pgs.hDevNames);
BYTE *tbyte(BYTE *) lpDev;
TCHAR *pDeviceName, *pPort, *pDriverName;
pDriverName=(TCHAR*)(tbyte + lpDev->wDriverOffset);
pDeviceName=(TCHAR*)(tbyte + lpDev->wDeviceOffset);
pPort=(TCHAR*)(tbyte + lpDev->wOutputOffset);

// Get the printer DC!! This may pop up an additional printer dialog box
HDC hdc;
hdc=CreateDC(pDriverName,pDeviceName,pPort,NULL);
GlobalUnlock(pgs.hDevNames);

if (hdc==NULL) {
// handle error
}

// You now have your HDC...

// Lets get some values from the page dialog box
LPDEVMODE lpDevMode;
lpDevMode=(LPDEVMODE) GlobalLock(pgs.hDevMode);
if (lpDevMode==NULL) {
// handle error
}

// Get whatever DEVMODE info needed (orientation, paper size, etc)
CurOrientation=(lpDevMode->dmOrientation==DMORIENT_PORTRAIT);
CurIsColor=(lpDevMode->dmColor==DMCOLOR_COLOR);
CurPaperSize = lpDevMode->dmPaperSize;
CurHighPrintQuality = (lpDevMode->dmPrintQuality==DMRES_HIGH);

GlobalUnlock(pgs.hDevMode);

5.39 How do I register a control under Windows CE?

The easy way to register a control is to use regsvr2.exe, a GUI based registration tool. 

If you want to use regsvrce.exe, do the following:

Copy your control into the \windows directory on your device, run regsvrce passing the path and filename of the control as an argument.

For example, to register vbceSoftKeyboard.dll on a Palm Sized PC, you would do the following:

  • type run23 using the keyboard SIP. This will bring up the Run dialog (note- you may have to type run23 a couple of times before it comes up). Sometimes it helps to make the keyboard show, click on the taskbar, then type 'run23'.
  • Type 'regsvrce \windows\vbceSoftKeyboard.dll' and press OK.  Your control is now registered!

You may have to copy regsvrce.exe from your sdk 'target\mips' (or whichever processor you use) directory. 

5.40 I am having problems getting CE RAPI to work properly. What can I check?

Here's a few basic things you can check:

1. Are you sure RAPI is initialized properly?
2. Try to do a simple command, like cecopyfile, to make sure you've got communications working in your app.
3. Are you converting your strings to unicode?
4. Do you have vcce 5.0? under samples\win32 there is ceinvoke - both a client and server demo, that shows how to do this in block and stream mode.
5. Are you converting your strings to unicode? I mention this twice because it appears to be the leading cause of RAPI problems.  See the RAPI example mentioned below for an example of how to use UNICODE strings.

Finally, check Using CE RAPI to Communicate with Windows CE from the Desktop for more information and a few examples.

5.41 I want to create a mail message then send it. Can I do this using the Mail API?

The Windows CE Mail API allows you to add, modify and delete mail messages and mail folder names.  Using the Mail API you can enumerate all messages in any mail folder, change the recipient, subject, body or attachments, and update the entry in the mail store.

The Mail API does not allow for sending or receiving mail at this time. The documentation says that the Inbox acts as a mediator, which means that you can manipulate messages, but it is up to the Inbox application itself to send and retrieve mail.

While I have not tried this, one thing I can suggest is to look at the mail transport functionality. Check out the svcsampl example in  the HPC Pro SDK. It shows (in code) how a simple mail transport service is implemented.  You can also check the SDK documentation for functions like TransportInit, TransportConnect and TransportSend. It appears that pmail loads smtp.dll (the transport service dll) and calls these functions, using TransportSend to send one message at a time.

5.42 How can I display GIF, JPG, BMP, or XBM images in my application?

The easiest way to display images from your (VC) application is by using imgdecmp.dll. Unsupported Software has an article discussing imgdecmp along with some sample source code.

5.43 Why can't I display 16-bit images from my application using imgdecmp.dll?

Well, it turns out that it can!

Many people have difficulty getting 16-bit jpg images to display properly.  Apparently, the trick is to specify dii.iBitDepth = 24.  Imgdecmp.dll does not like 16 as the value.  The S309 control uses imgdecmp.dll and manages to produce 16 bit color images.

It does appear that SHLoadDIBitmap will display 16bit .bmp images. I believe this is what the shell (hence the SH once the front of the API) uses to load the desktop image.

5.44 What steps can I take to make my software ready for foreign markets?

First, take a look at the internationalization session video from the Windows CE DevCon 99, http://events.microsoft.com/isapi/events/pages.asp?s=63814&p=622. There are a lot of great tips on how to make your applications ready for foreign markets. Some of the suggestions include:

  • Place your strings, images, etc in a resource file and make this resource file a .dll. When you want to build an application for another market you will only need to include the new dll and will not have to recompile your application. 
  • Remember that English is a very compact language. Other language strings average 35% longer, with some string more than 2 to 3 times as long.
  • Not all currency symbols are one character (ie. KR for Swedish Krona)
  • Try to avoid culturally specific images. Images acceptable in your country may be embarassing/insulting in another culture.
  • Consider writing all of your strings in Pig-Latin. Pig-Latin is longer than English, so you will encounter string length issues sooner rather than later (and we all know the sooner you find a problem the easier/cheaper it is to fix).

Also, take a look at the NLS API set. It is easy to use and offers functions like GetDateFormat, GetTimeFormat, GetNumberFormat and GetCurrencyFormat.

Finally, if you are a Visual Basic developer you will notice that many of the NLS API functions use UDTs, which are not supported under VBCE 6.0. Take a look at vbceNLS, available on this site for free. vbceNLS allows the VBCE developer to access several NLS functions.

5.45 How can I open, change and delete mail messages?

Windows CE supplies a mail API that allows the Visual C++ developer to add, change and delete mail messages. If you want to work with the inbox under Windows CE you will need to use this API, since at this time POOM does not work with email.

Below is some sample code - it walks through the inbox mail messages and renames the subject line for any that start with 123, and delete the rest:

CString workString;
HANDLE hMail;
MailMsg curMsg;

if (MailOpen(&hMail, FALSE)) {

memset(&curMsg, 0, sizeof(MailMsg));
curMsg.dwFlags = MAIL_FOLDER_INBOX | MAIL_GET_BODY | MAIL_FULL;

BOOL status = MailFirst(hMail, &curMsg);
while (status) {

workString = MailGetField(&curMsg, _T("Subject"), FALSE);
if (workString.Left(3) == "123") {

workString = workString.Mid(4);
MailSetField(&curMsg, _T("Subject"), workString);
MailUpdate(hMail, &curMsg, TRUE);

   } else

MailDelete(hMail, &curMsg);

// prepare to read next message
MailFree(&curMsg);
curMsg.dwFlags = MAIL_FOLDER_INBOX | MAIL_GET_BODY | MAIL_FULL;
status = MailNext(hMail, &curMsg);

  }
  MailClose(hMail);

Make sure to free each mail message you open, and do a MailClose when you are done with mail. 

5.46 How can I use ATLCE to sink events?

Take a look at Ken Rabold's article Sinking COM Events with ATL CE for information on implementing connection points via ATL CE.

5.47 Do the Pocket Office applications support automation? Can I use them from VCCE, VBCE?

Pocket Office does not support OLE Automation, since Windows CE only supports in-process COM objects at this time.

5.48 I am using VBCE and need to call API functions that require structures, but UDT's are not available.  What can I do? What should I watch out for?

Antonio Paneiro has written an article showing how you can use strings to work around the lack of UDT support in VBCE.  Basically, you can populate the string in such a way to make its memory image match the reuired structure definition.  Take a look at http://www.vbce.com/articles/udt/index.asp

One thing to keep in mind: structure in C are often aligned to specific boundaries, for example:

typedef struct
{
    char c;
    short h;
    int n;
} TheHorror;

The internal representation of c = 0x77, h = 0x8899, n = 0xaabbccdd might be (assuming little endian): 77 00 99 88 dd cc bb aa, if aligned on 2byte boundaries or 99 00 00 00 99 88 00 00 dd cc bb aa, if aligned on 4byte
boundaries. [thanks to Russell Harper for this tip, posted on the windowsce vbce newsgroup].

5.49 How can I turn on the device when the serial port has activity?

You can use CeRunAppAtEvent to cause your device to wake up and run an application based on various events, including:

  • When data synchronization finishes
  • When a PC Card device is changed
  • When an RS232 connection is made
  • When the system time is changed
  • When a full device data restore completes

5.50 How can I start applications on device connect/disconnect?

See registry FAQ entry 3.1 How can I start applications on device connect/disconnect?

5.51 Do you have any tips on getting more out of HTMLView?

I personally have suffered at the hands of this dll.  While the dll works great for simple html rendering, you quickly run into trouble when trying to use it for more complicated purposes.  For example, I once attempted to implement a book reader using the html control.  It worked very well, but basic features like setting cursor position were not implemented.  I considered programmatically placing anchors in the HTML to allow navigation but ended up writing my own simple HTML parser/renderer instead.

Anyway, here is an excellent post from Craig Rairdin:

Download our free demo at www.laridian.com to see what we do with the HTML control. We use it for lots of stuff. The next version handles embedded images (.bmp, .jpg, .gif), sounds, and (soon) forms. That version isn't out yet.

Here are some code snippets from our class wrapper around htmlview.dll. You've messed with this enough to fill in any details I might accidentally leave out. You've discovered enough to catch some of the subtleties (some messages have to go to the child window, etc.) 

Here's the Copy operation:

// But, how to copy from the HTML window?  Experimentation has
// shown that if there is a child window, the WM_COPY should be
// sent to the child window.  If there is not a child window,
// the WM_COPY should be sent to this window.
HWND hwnd = GetWindow(m_hWnd, GW_CHILD);
if (hwnd != NULL)
  {
  SendMessage(hwnd, WM_COMMAND, 0x000156BA, 0);
  }
else
  {
  // On the PPC, there's no child window and this window seems
  // to accept WM_COPY
  SendMessage(m_hWnd, WM_COPY, 0, 0);
  }

Note: Copy does goofy things if you display text then resize the window then do a copy. It drops spaces out of the output.

Next, here's CopyAll (I don't think/remember if the getsel and setsel operations really work)

// If there is a current selection, remember it.
// LOWORD(selection) = start position
// HIWORD(selection) = stop position
DWORD selection = SendMessage(m_hWnd, EM_GETSEL, 0, 0);
// Select and copy all contents.
SelectAll();
BOOL CopiedSomething = Copy();
// Restore the prior selection.
SendMessage(m_hWnd,
  EM_SETSEL,
  (WPARAM)(INT) LOWORD(selection),
  (LPARAM)(INT) HIWORD(selection));
// Here's scroll up a line. Up, down, and moving by pages are similar:
HWND hwnd = GetWindow(m_hWnd, GW_CHILD);
if (hwnd != NULL)
  {
  SendMessage(hwnd, WM_VSCROLL, SB_LINEUP, NULL);
  }
else
  {
  // On the PPC, there's no child window.
  SendMessage(m_hWnd, WM_VSCROLL, SB_LINEUP, NULL);
  }

Some other things we learned is that you can't capture Alt+Tap like the docs say you can. On some platforms you even get a menu of some kind when you do Alt+Tap but you can't do anything with it.

Handling the notification messages is pretty much just like the docs say. Like I said above, we handle hotlinks, pics, sounds and are working on forms.

We've talked to Microsoft at length about this .dll. We've concluded that they are embarrassed about it and don't want to talk about it. They have plans to do this better in 2.12 (they've ported IE4 to that platform). You'll be able to have lots more flexibility if/when any devices ship with that version of the browser. Htmlview.dll will go away and you'll have a much more powerful dll to work with.

5.52 How do I get the name of a ADOCE table if I only have an Table ID number?

This helpful post comes from Sandra Walters:

CDB files created with Pocket Access have several 'hidden' tables, among them are MSysTables and MSysFields, just like the Win32 version of Access. MSysTables includes a TableID and a TableName field in each record, which is
how Access relates the two together.

The readme that comes with ADOCE discusses this in detail with lists of fields in each.  I've had to write code to look up table names as well as field names and this document was very helpful.

5.53 How can I determine the amount of free space on storage cards, on the device and in memory?

Use GetDiskFreeSpaceEx to get information about storage card free space. For memory, check out GlobalMemoryStatus.

5.54 How can I disable the OK button on my Windows CE dialogs?

Try the following code in your dialog box:

ModifyStyleEx(WS_EX_CAPTIONOKBTN,0);
RedrawWindow();

5.55 Which common dialogs are supported under Windows CE?

Paul Yao (www.paulyao.com) is an author and Windows CE development instructor.  Below, Paul gives a list of supported and unsupported common dialogs.

There are eight common dialog boxes in Win32.  The File Find is not supported on CE (and therefore the MFC wrapper, CFileFind, would also not be supported).

Here are the eight. Y= supported on CE (at least on HPC); N= Not supported. Note that support for PsPC doesn't include File|Open, File|SaveAs - at least for version 1 of PsPC.

Dialog
HPC/HPC Pro
PSPC

File Open
Y
Y*

File Save
Y
Y*

Print
Y
Y

Print Setup
N
N

Find
N
N

Replace
N
N

Color Picker
Y
Y

Font Picker
N
N

* The PSPC platform displays a modified version of the file open and save as dialogs.  This version does not let you browse the entire file system, but restricts you to the storage card MyDocuments directory and the object store MyDocuments directory.

6. Palm Size Development Issues

6.1 If I don't implement an exit menu item, is there anything I can do to make closing the application easier?

While the Windows CE Pocket applications do not have an exit item, they do close based on the Ctrl-Q keyboard accelerator. Users can close applications by issuing Ctrl-Q from the input panel. It's not a standard or anything (at least I haven't heard about it) but it's easy to do and some people will try it.

6.2 Why should I pay any attention to WM_HIBERNATE?

Ahhh, the neglected WM_HIBERNATE message. The Windows CE shell sends this message when it sees resources running low, and applications are supposed to free resources, memory, and everything else possible short of closing. The shell actually can close applications if things get bad enough.

The WM_HIBERNATE message is actually part of a larger mechanism. The Windows CE shell watches resources based on a timer (the sample shell checks every 5 seconds). Every so often it will check the available resource level, and if the available memory drop below 224K it will send hibernates to all applications. If memory drops below 160K it will attempt to close background applications via WM_CLOSE. In the sample shell shipped with Platform Builder 2.12, the shell nicely sends a WM_CLOSE then waits 8 seconds. If the application still is not close it kills its process (not so nice)! Windows CE actually relies on the shell to close unused applications by sending WM_CLOSE.

Your application should be a good Palm Size Citizen. Free up lists, close files, etc when you receive WM_HIBERNATE. If you receive a WM_CLOSE message, don't show dialogs or other messages - close silently. And definitely do close, because as mentioned above, if you are not closed in 8 seconds the shell will kill you.

7. Common Executable Format (CEF)

7.1 What is CEF?

CEF stands for Common Executable Format. CEF is Microsoft's solution to the problem of multiple processor types.

CEF provides a single target format for Windows CE executable files. The first time a CEF file is executed on a CE device, CE converts the CEF file to native code. This conversion only occurs once and happens very quickly. The resulting code is native to the processor.

Microsoft's goal is to have the executable's performance be at least 80% of native, fully optimized code, and to be only about 20% larger than a native executable.

7.2 Can I use CEF in my current applications?

Get the Visual C++ Toolkit for Windows CE v. 6.01. One of the features added to this version is generation of CEF output.

7.3 Can I have a CEF based dll or ocx?

Yes. CEF will convert dll's and ocx's as well as exe's.

7.4 Why should I use CEF?

CEF's benefit is it's ability to run on any CE device, even ones that didn't exist at compile time.

Microsoft is (currently) committed to handling CEF on each new platform that comes into existence, so if you have an application built for CEF, that application will run on all current processors as well as new processors that come into existence after the product is shipped.

CEF greatly simplifies installation issues. Instead of producing a cab file for each platform type, produce one install set. Executables are converted on the platform once, prior to running.

7.5 Is CEF as fast as an application compiled for the platform?

No. Applications targeting the CEF format are not as heavily optimized as compilations targeting true native code. Microsoft engineers tried to make performance be at least 80% that of a native application.

7.6 If I am only targeting one specific device should I use CEF?

If you are certain that your application will only be run on one type of device (say a Casio PA2400) you should compile to produce native code for that platform. Compiling for native code produces a better optimized and smaller executable.

8. Installation

8.1 What install packages are available?

Windows CE installation packages usually automate the building of cab files, and provide a desktop CEAppMgr launcher. They hide the issues surrounding building ini files, processor codes, etc from you and let you focus on generating an install set.

Here is info on two installation toolkits:

InstallShield CE is a commercial installation package from the same company that dominates the desktop installation world. Their product is straightforward and easy to use, and they offer excellent support. They have a dedicated newsgroup installshield.ce.general which offers prompt support.

They also have a no questions asked return policy, or at least they did for me.

I returned the product because the CE toolkit is only half of what you will need to build a CE installer. You will also need the desktop version of Installshield. The CE version is $495, and the desktop version is between 600-700 dollars. So to build a CE installer using InstallShield be prepared to spend over $1100.

You can find out more about InstallShield CE here.

  • CuteInstall - download here!

Produced by AcerSoftTech in Shanghai, China, CuteInstall is a simple, easy to use install wizard for Windows CE. CuteInstall allows building install sets for all platforms and processor types.

CuteInstall is not as nice as InstallShield, and does not have the support. You are on your own if you need to produce setup dll's, etc.  Also, take a look at the following list, compiled by Nathan Lewis over at InstallShield. This is a list of CuteInstall's shortcomings:

1.  No localization capabilities.
2.  Does not support the "file flags" used for WinCE installations.
3.  Desktop-to-device installer does not provide any kind of scripting capabilities.
4.  Desktop-to-device installer does not provide access Win32 APIs.
5.  Has limited support for H/PC and P/PC devices.
6.  Does not support HPC Professional devices.
7.  Very little error checking done before compiling the INF file.

On the other hand, you should consider CuteInstall in the following situations:

1. shareware/freeware developer - low budget projects
2. someone that needs a simple installer
3. someone that wants to learn about inf/ini files

You will be able to produce an install more quickly using InstallShield than CuteInstall. However, I personally believe that developers should at least try CuteInstall before plunking down the cash for ISCE.  It's freeware, so the only thing they lose is a little time if it turns out not to be helpful.

You can download CuteInstall here.

This installation toolkit will not automatically build your cab files, but it does take care of building an installation tool, and it comes with source code. 

From the web page:

If you are a WinCE author and are looking for an inexpensive way to create / obtain a setup program, look at EZSetup! Once you have created your .cab files (as described in the WinCE SDK), you are ready to use EZSetup. EZSetup takes your .cab files and *outputs* a compressed, self-contained, self-extracting Windows setup program that will set up your WinCE software.

EZ-Setup is freeware and is released under the GNU Public License.

8.2 How do I programmatically open a cab file on a CE device?

Call \windows\wceload.exe using the .cab filename as the parameter, ie.

Wceload myapp.cab

8.3 How do I start an installation from the desktop?

If you are planning on writing your own installation package, you will need to launch the windows ce services application manager, CEAppMgr.exe. To do this, open the registry key

[SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\CEAPPMGR.EXE]

to get the application manager location, then launch the exe providing the installer .ini file as a parameter.

8.4 How can I keep a cab file from being erased after it is installed?

Cab files allow installations to be run directly from the device. The .cab file extension is associated with wceload, which unpacks and installs files contained in the .cab file. Unfortunately, wceload deletes the .cab file after the installation is complete.

You can set your .cab files to read-only to prevent this behavior. While this does not work on HPC 2.0 devices it does work on Palm Size and HPC Pro devices.

Installshield provides a workaround for the HPC problem for their registered users.

8.5 What command line switches are available for CeAppMgr?

With the help of a hex editor I took a look inside of CeAppMgr.exe.  I found the following possible command line switches:

/report - generates dialog boxes reporting the current install step status
/askdest
/noaskdest
/SilentInstall

Unfortunately, except for /report none of them appear to work. Perhaps the next version of CeAppMgr will implement this functionality. 

8.6 My install set is having trouble registering controls on Palm-Size PC devices. What am I doing wrong?

Many people have reported problems with their installation programs. Usually the installer would crash during registration of controls. Apparently wceload.exe on palm-size devices was not calling CoInitializeEx before starting the registration process. Microsoft has issued a fix for the problem, available at: http://support.microsoft.com/support/kb/articles/Q240/4/35.asp

8.7 How can I programmatically open a .CAB file?

Nathan Lewis of InstallShield posted this note regarding .cab files:

You're developing an embedded system, and since Microsoft doesn't provide WCELOAD for embedded systems you're wanting to roll your own, right?  If that is the case, you can start by looking at the "Wotsit's Format" web site (http://www.wotsit.org/  ) in the Windows section.  They have the source to a program that will extract the various files from the CAB.  But that's the easy part...

When CabWiz builds the CAB files, it does two things:  It compiles the INF into an undocumented format, and it renames all of the files in the CAB using the 8.3 format.  Any filenames that are shorter than 8 characters are padded with leading zeros, and any that are longer than 8 characters are converted to short filename format.  The extension for each file is also changed to use exactly three characters, from "000" to "999".  The compiled INF file is stored in the CAB with the "000" extension, and it contains the original filenames for all the other files.  The last file in the CAB always has the "999" extension, which seems to mean that you can never have more than 1,000 files in the CAB (including the compiled INF).

So the basic steps would be:

    1.  Extract the CAB to a temporary directory.
    2.  Parse the compiled INF (*.000)
    3.  Rename the files to their original names and install them.

The compiled INF is the only problem since it's not documented.  I guess you'll have to reverse engineer the file format.  You could start by creating a bunch of simple CAB files using CabWiz, then examine the "*.000" files to try and figure out how they're stored.

9. Help

9.1 What format is Windows CE Help in?

Windows CE help files are simple html files. There are two file extension types for windows CE help; .htc and .htp. The first, .htc, is the main link into your applications help system. Typically, this help file should be named myapp.htc, where myapp is the name of your application. You can use only one help file, or have links into other files. Other files can be named whatever you like, but is it probably a good idea to use a name related to your application, like myapp_config.htp, myapp_usage.htp.

9.2 How should I create help files?

The simplest way I have found is to enter text in Word for Windows, creating links using bookmarks and hyperlinks, then save it as an html file.

9.3 How can I programmatically launch help?

Call \windows\peghelp %1, where %1 is the name of the help file to open.

10. Internal/Undocumented/Hack Corner

10.1 Ways to explore Windows CE.

The Visual C++ Toolkit for Windows CE includes remote spy, remote registry editor and remote process viewer. Use these tools to find system window names, explore and tweak the registry, etc.

Here's a list of ways you can learn more about Windows CE:

  1. Use dumpbin on SDK library files to find out about exported functions
  2. Use dumpbin on emulator dll's to find out about hidden functions
  3. Use loadlibrary to load executable images from ROM into RAM, then write them out to a file and inspect them.
  4. Get Platform Builder - lots of cool stuff here!
  5. Use virtualalloc, virtualcopy to copy process spaces to disk then inspect.
  6. Download CCMemory and inspect memory directly on the device.
  7. Don't bother with GetROMFileBytes - it only works on files that are not XIP (as far as I can tell).

One other thing I found in the docs

"Most miscellaneous files are compressed (with the exception of a few fonts). Code and read-only sections for the executables and DLLs are uncompressed to enable execute-in-place. The read-write sections are compressed because they are destined for RAM, where they will be [de]compressed."

This means that you can dump the ROM to disk and files will be readable (non-compressed).  If you can figure out the ROM file structure you can have access to the entire system. Not only could you disassemble device drivers, but you could copy pocket office to the pspc and try it out.  I'll keep you posted on my progress.

10.2 Hack while you can - it will be harder soon.

Microsoft plans to tighten up security in its operating system by Windows CE 3.0. Certain functions, including VirtualCopy, SetProcPermissions, and other will be restricted to trusted applications only. Here's a brief list of functions that will be restricted:

AddEventAccess, CeSetThreadPriority, CeSetThreadQuantum, CreateAPISet, ForcePageout, GetKPhys, GiveKPhys, GwesPowerOffSystem, LocalAllocInProcess, LocalFreeInProcess, LocalSizeInProcess, LockPages, PowerOffSystem, RegisterAPISet., RemoteLocaleAlloc, RemoteLocalFree, RemoteLocalRealloc, RemoteLocalSize, SetExceptionHandler, SetGwesPowerOffHandler, SetInterruptEvent, SetKMode, SetPowerOffHandler, SetProcPermissions, SetRAMMode, SetSystemMemoryDivision, SetWDevicePowerOffHandler, SystemStarted, ThisIsGwes, UnlockPages, VirtualCopy, VirtualSetPageFlags.

10.3 BinaryCompress/BinaryDecompress - built in compression for windows ce

You can use BinaryCompress and BinaryDecompress to perform buffer compression. BinaryCompress will take a buffer and return a compressed buffer. BinaryDecompress will take a compressed buffer and turn it back into the original. BinaryCompress and BinaryDecompress are defined in coredll.

I assume the compression API uses the same compression as the object store. That compression is comparative - Windows CE compresses the buffer using several methods and takes the winner.

Remember that all files kept in the object store are compressed, so this is redundant if you are just storing data in a file on your device.

Here's an example:

DWORD BinaryCompress(LPBYTE bufin, DWORD lenin, LPBYTE bufout, DWORD lenout);
DWORD BinaryDecompress(LPBYTE bufin, DWORD lenin, LPBYTE bufout, DWORD lenout, DWORD skip);

TCHAR string[] = _T("The quick brown fox jumps over the lazy man who did not come to the aid of his country in time.");
BYTE buffer[1024];
BYTE inpBuffer[1024];

int length = BinaryCompress((BYTE*)string, wcslen(string) * sizeof(TCHAR), buffer, 1024);
BinaryDecompress(buffer, length, inpBuffer, 1024, 0);

AfxMessageBox((TCHAR*) inpBuffer);
CString message;
message.Format(_T("%i, %i"), wcslen(string), length);
AfxMessageBox(message);

In this example, the uncompressed buffer is 188 bytes and the compressed buffer is 148 bytes. Not the best, but it is free.

10.4 SetProcPermissions - give your process access to other processes!

This command will allow you to access memory in other process slots. It currently is available to all processes, but in future versions of CE it will be a restricted function.

The prototype is void SetProcPermissions(WORD procFlag). Each bit in the procFlag refers to a process. To get access to process slot 0, 1, 2 and 3 then procFlag would be 0x000F. To allow access to all processes set the flag to 0xFFFF.

10.5 RegFileCopy - make an instant copy of the registry

This is a great little command. RegFileCopy(filename) will write the registry out to the specified filename. It takes about 1 second on my Casio e-100. There is also a command RegRestoreFile that will restore a .reg file to the registry. I have not used this one yet (as of 9/6) so I cannot comment on its use, but you may want to check it out.

Unfortunately, the output file is not exactly text based. It does look pretty easy to parse, so you could write an application to convert it to text.

10.6 GetFSHeapInfo - pointer to object store in physical memory

Want to have some real fun, and possible really screw up your device? Try this little piece of code:

DWORD objStoreLoc = GetFSHeapInfo();
SetProcPermissions(0xFFFF);
#define SIZE (1024*1024*4)
BYTE* lpv;
BOOL bRet;
lpv = (BYTE*) VirtualAlloc(0, SIZE, MEM_RESERVE, PAGE_NOACCESS);
bRet = VirtualCopy(lpv, (void*)objStoreLoc, SIZE, PAGE_READWRITE | PAGE_NOCACHE);
if (bRet) {

CFile output(_T("\\outputImage.bin"), CFile::modeCreate | CFile::modeWrite | CFile::typeBinary);
output.Write(lpv, SIZE);

}
VirtualFree(lpv, 0, MEM_RELEASE);

This writes 4Mb of raw object store out to a file, which you can copy to your pc and proceed to inspect with a hex editor. Remember, all Windows CE buffers will be little endian. The file system is FAT based, too, so search for directory entries and proceed from there.

10.7 Predict.dll offers access to word prediction on Palm Size PC's

Palm Size PC devices use soft keyboards. The standard keyboard also uses a moderate dictionary to try and guess you next word. You can also use the prediction routines and access the dictionary.

Check out Predict dll and the following exported functions:

PredictGetTables
TrieIndexToWord
TrieInit
TriePrefixToRange

I do not have the prototypes yet.

You may also want to check out statdict.dat and dictprob.dat, two files apparently associated with the SIP dictionary gadget. I will post more info as I find it.

10.8 Inspect ROM on the Casio E-100 and find interesting things.

Curious about the internal workings of Windows CE? Want to see weird messages left by the developers, like Woo-hoo! Keyboard type is:  and discover hidden DLL exports like the ones used in jotcore1.dll - ZorroClose, ZorroOpen, ZorroTrain.

It is pretty simple once you know where to look. Lucky for us, EXE's in ROM are not compressed, since they are run in place (Note that they are not in PE format either, but in .bin format.  Check the PB docs for info on .bin format). I made a little program that grabs 4Mb chunks of memory and writes them out to files. I then copy the files to the desktop and read them with a hex editor, like HEdit or Hackman. The ROM image in combination with Platform Builder is a great insight into the working of CE.

Here's some sample code:

#define PHYSADDR ((PVOID)((0xbf000000)))
#define SIZE (1024*1024*4)

BYTE* lpv;
BOOL bRet;

lpv = (BYTE*) VirtualAlloc(0, SIZE, MEM_RESERVE, PAGE_NOACCESS);
bRet = VirtualCopy(lpv, (void*)PHYSADDR, SIZE, PAGE_READWRITE | PAGE_NOCACHE);
if (bRet) {

CFile output(_T("\\outputImage.bin"), CFile::modeCreate | CFile::modeWrite | CFile::typeBinary);
output.Write(lpv, SIZE)

}
VirtualFree(lpv, 0, MEM_RELEASE);

This code will write 4 Mb of ROM to a file in the root directory on your device. Simply copy this file to your desktop machine and use your favorite hex editor to review the contents of ROM.

10.9 SetWindowsHookEx really does work, sort of.

If you believe the Microsoft documentation, SetWindowsHookEx does not work under Windows CE. However, if you have read this FAQ you know that SetWindowsHookEx can be found in coredll (2.11 PSPC and HPC Pro versions only). The question is, what does it do, and is it a full implementation.

I have been wanting to write an ATL control that passes messages (like WM_HIBERNATE) to VBCE. One way to do this is to create an ATL control, implement a connection point, and install a windows hook that monitors the message queue, and whenever a relevant message appears, fires an event off to VB. Unfortunately, every combination of

gHook = SetWindowsHookEx(WH_CALLWNDPROC, (HOOKPROC) MyWndProc, gInstance, 0);

returned an error 87 (incorrect parameter). Further searching through the PB header files reveals only three hook-related defines: 

#define WH_JOURNALRECORD 0
#define WH_JOURNALPLAYBACK 1
#define WH_KEYBOARD_LL 20

So I stopped using WH_CALLWNDPROC and tried WH_KEYBOARD_LL, and found that it worked quite well. I actually implemented a hook callback that watched for VK_OFF, and when detected, waited 2 seconds before returning. Whenever I pressed the power button the device would indeed wait before turning off. I also attempted to abort the power off by returning a non-zero number from the hook callback. While this does prevent the power button from powering off the device, it also causes the device to crash. Besides, VK_OFF is only generated when the off button is pressed, and not when a device time-out occurs, so the code was of marginal use. However, if you need to trap other low-level keyboard commands (ctrl-esc, etc) SetWindowsHookEx might be for you.

While I imagine journal record and playback are implemented as well, I have not tried them.

10.10 Calstore.dll can be used to access the task database API set.

Calstore.dll manages access to various task database functionality. I could not find any documentation on the API offered by calstore on the device, but did find the list of exported functions in my Casio E-100 ROM.

ReplAppointmentFromOid
ReplDeleteAppointment
ReplDeleteTask
ReplGetCalendarObjectStore

ReplReleaseAppointment
ReplReleaseCalendarStore
ReplReleaseTask
ReplTaskFromOid

APPTGetMonthData
AdjustForBias
AdvanceRecurNoClone
AppointmentFromOid

CompleteTask
ConvertRenTzToSchedPlus
ConvertSchedPlusToRenTz
CreateAppointment

CreateTask
DeleteAppointment
DeleteTask
EditException

EnumAppointments
EnumExceptions
EnumRecurAppointments
EnumRecurAppointmentsEx

EnumRecurPattern
EnumTasks
ExceptionFromOriginal
FExceptions

FindAppointmentFromGlobj
FreeARI
GetAppointmentData
GetCalendarObjectStore

GetExceptionInfo
GetMinimumPeriod
GetMonthData
GetMonthDataEx

GetPatternStartTime
GetStartAndEndDate
GetTaskData
GetYearData

IsActiveTask
IsApptOid
IsException
IsMeetingUpToDate

IsOccurrenceSameDay
IsOidApptDbase
IsOidTaskDbase
IsOverlappingException

IsRecurring
IsRecurringTask
IsTaskOid
IsToday

MapPMailtoRenRecur
OidFromAppointment
OidFromTask
ReleaseAppointment

ReleaseCalendarStore
ReleaseTask
RenFromStdTimeZoneInfo
ReplSetApptAlarm

ReplSetTaskAlarm
ResetCache
SendAttendeesUpdate
SetAppointmentData

SetAttendeeCriticalChange
SetNextAlarms
SetSnapDate
SetTaskAlarms

SetTaskData
StartTasksEnum
StdTimeZoneInfoFromRen
StopTasksEnum

TaskFromOid
UpdateResponseEntry
WriteLastAlarmDate

The functions don't really do much good without the prototypes, but they are a starting place.

Another way to access calstore functionality is using the Pocket Outlook Object Model, or POOM. See 3.5 How can I work with Pocket Outlook data? for more information.

10.11 How can I reformat a compact flash card?

Formatting a compact flash card from your CE device is fairly straightforward, once you know a couple of key pieces of information.  First, you need to open the compact flash device using:

CreateFile(szVolume, GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);

Next, you need to actually issues a format command to the device, as follows:

// hVolume is the file opened with createFile
// fv is FMTVOLREQ struct, which contains a DWORD
DeviceIoControl(hVolume, IOCTL_DISK_FORMAT_VOLUME, &fv, sizeof(fv), NULL, 0, &cb, NULL);

See Ben Beasley's source for a full compact flash formatter.

11. Known CE bugs

11.1 Createprocess on PSPC devices doesn't work

For some reason CreateProcess does not appear to work on palm-sized devices. Try ShellExecuteEx instead.

11.2 MFC CE 6.0 - Gettime with city set to foreign city. Returns 7/22/1863.

I came across this post and verified it on my e-100 as well.

The following code fails that worked previously in CE2.00 MFCs: (for Home
Cities outside the US).


CTime t = CTime::GetCurrentTime( );
int y = t.GetYear( ) // returns 1863 instead of 1999
I have traced it to CTime::GetLocalTm( ) returns a structure with tm_year
= -37
Likewise month, day and time information is incorrect in the structure.
It works for a Home City set in the World Clock to US Cities and a few
others in the world but fails when you choose cities in Australia and some
other countries. My guess is that some of the TimeZone information is not
stored for these cities and is causing GetLocalTm to fail. GetLocalTm did
not exist in previous versions of the CE MFCs. GetCurrentTime and GetYear
would previously work directly with the time value and not use GMT and time
zones.
Stephen Whitcher
Mobile Technologies Pty Ltd
Brisbane Queensland Australia (GMT+10:00 - no daylight saving)

11.3 The voice control will not write recordings to any filename except the default.

A recent post on microsoft.public.win32.programmer.wince discussed the fact the the voice recorder would not write the recording out to a user specified name, but always used the default. He was using the Casio E-100. He did the following:

::SendMessage(m_hWndVoice, VRM_RECORD, 0, (LPARAM) (LPTSTR)_T("\\myfile.wav") );

but the resulting filename was always "\\_tmp_file0.wav" (or incremented file1, file2, etc). Another person confirmed the problem and said he had given up using the voice control and gone straight to using the wave API's.

11.4 The 6.0 StrongArm compiler creates buggy code.

"Roman" posted this on the microsoft.public.windowsce newsgroup on 9/30/99:

The ARM compiler included with SDK version 12.00.8274.0 produces buggy code.  The ARM compiler included with 6.01 preview 12.10.8414 works well, and all bugs that found in (12.00.8274.0) appeared to be FIXED...

We compiled the SHA HASH algorithm - it failed with the old ARM compiler, but SH3, SH4, MIPS worked fine.  The CAST algorithm simple crashed the application. We tried with preview 6.01 compiler and found that it worked perfectly!

12. Windows CE Gossip Corner
12.1 PPTP will be available in 3.0 but not 2.12.

From Sebastion in the public.windowsce newsgroup, on 9/30/99: "PPTP support should come with Windows CE 3.0, but not with version 2.12. That's what I have heard yesterday from Microsoft."

12.2 A new grid control will be released soon

01/14/00 - I have heard that the grid control is nearly complete, and that a update for HPC/Pro users is available.  Microsoft is working on an HPC update as well, but it  is not quite ready yet.  If you are having problems with the grid control and are desperate, try sending a note to wcetwish@microsoft.com explaining your situation and asking for the update.

02/13/00 - Apparently an updated, more reliable grid control will be released within the next week or two, if things go as planned.  Finally!

12.3 The 2.12 version of Imgdecmp.dll supports 24-bit bitmaps.

I received a couple of comments suggesting that CE 2.12 version of imgdecmp.dll supports 24-bit color. The current imgdecmp.dll on OEM devices supports 8-bit color only.

12.4 When will VCCE 6.5 be released?

From Steve Maillet in the win32.programmer.wince group on 10/9: "[VCCE 6.5 is] not officially announced as of yet. but based on time frames in the past it was 6-8 weeks after PB was released. SO a couple months is what I expect."

SP3 support should be supported in the forthcoming VC++ toolkit for Windows CE V6.5.

Copyright CEGadgets.com 1998-2001. All rights reserved.
Microsoft and Windows are registered trademarks of Microsoft Corporation
No guarantee or warranty of any kind is offered for information, controls and software on this or any other CEGadgets page. Use at your own risk.

Windows CE Developers FAQ

Posted by krsuncom
개발이야기2007. 8. 3. 13:09

Making A2DP work on your PPC-6700 is very simple. All you have to have are the file attached below, your PPC-6700, and a A2DP compatible headset.
1. Download the attached .zip file on your ppc. Either directly or activsync it over. And extract files. NOTE: if you have the new ROM, if not your gonna have to activsync all the files over after extracted on your desktop.
2. Copy Avrcp_MPplugin.dll, bta2dp.dll, & sbc.dll to windows directory on phone.
3. Install the Tornado_A2DP.CAB and then install the Tor_A2DP_cert.CAB
4. Soft reset the device.
5. Pair your headset with the phone, making sure you select the set as wireless stereo option, and your DONE!
--------------------------------------------------------------------------
If you have an Axim X51v or X50v running Windows Mobile 5 and a Bluetooth Headphone you'd like to use with it, try this:
1. Extract the A2DP.ZIP file to a folder and copy the contents to your Axim:
A) tor_a2dp.cab
B) tor_a2dp_cert.cab
C) 3 DLLs avrcp_mpplugin.dll, bta2dp.dll, sbc.dll
D) a2dp.reg
2. Copy the three DLL files to \My Device\Windows and put the cabs and reg file into one directory.
3. Click on tor_a2dp.cab to install.
4. Click on tor_a2dp_cert.cab to install.
5. Turn power off completely or soft reset to register the changes.
6. Turn unit on. Go to:
Bluetooth > Devices> New partnership
7. After your BT stereo client is ready to pair, select "Wireless Stereo".
You may have to use a passkey if your headphone specifies, ie: "0000".
8. Tap and hold the client, and set it as Wireless Stereo
DONE.
If you are successful, please post back and include:
A. The device (e.g. X51v) and the BT headphone model that you used.
B. How you made it work if you encountered difficulty.
Credits:
Thanks to everyone involved at the XDA-Developers.com and the pdaphonehome.com forums.
References:
1. A2DP support on 818pro - xda-developers
2. A2DP on Tornado!! - xda-developers
3. A2DP on Tornado!! - xda-developers
4. http://www.pdaphonehome.com/forums/s...ad.php?t=71436
Edit
When you download the attached file "attachment.php", don't forget to rename it to "a2dp.zip".
--------------------------------------------------------------------------------
If you have a blackjack is very simple.
1. Download the attached .zip file on your phone. Either directly or activsync it over. And extract files. NOTE: if you have the new ROM, if not your gonna have to activsync all the files over after extracted on your desktop.
2. Copy the file to windows directory on phone.
3. Install the A2DP.exe and select the set as A2DP on option.
4. Soft reset the device. your DONE!
That simple now you can listen to your favorite music with stereo quality!

Attached Files

File Type: zip
ppc6700_a2dp.zip (83.3 KB, 0 views)

File Type: zip
Tor_A2DP.zip (43.0 KB, 0 views)

File Type: zip
blackjack_A2DP.zip (63.4 KB, 6 views)

 

Bluetooth (A2DP)

Posted by krsuncom
개발이야기2007. 8. 1. 15:09

 

Wireless DevCenter: Microsoft Smartphone Tips and Tricks

Microsoft Smartphone Tips and Tricks

by Wei-Meng Lee
05/14/2004

There is so much an excellently designed smartphone can do. But without the software to power it, it's virtually useless. Since the launch of the first Orange SPV Microsoft smartphone in October 2002, there have been a host of new applications designed to run on this platform. In this article, I will show you some of the cool things you can do with your Microsoft smartphone.

Installing Applications

One point about installing an application for the smartphone: you can either use ActiveSync to install the application from your PC to your smartphone, or you can install it directly from the vendor's web site. Figure 1 shows how you can install an application using Pocket Internet Explorer. Simply go to the vendor's web site and click on the relevant link to download the file. Once you confirm the download, it will be installed on your smartphone automatically.


Figure 1. Installing an application through the Web

Easy, right? Now let's move to file transfer.

Transferring Files onto Your Smartphone

Sometimes you just need to transfer files (such as MP3 music files) onto your smartphone. There are a few easy ways to do that. You can either use the infrared port or use ActiveSync to do the job. I use ActiveSync most of time, as it is the most flexible method. Simply hook up your smartphone to your PC through ActiveSync and at the ActiveSync window, click on the Explore button (see Figure 2). You will then be able to explore the file system on your smartphone and drag and drop files as required.


Figure 2. Exploring the file system of your smartphone through ActiveSync

Photo Contacts

One application that is useful for your smartphone is the Photo Contacts application from PocketX Software. Using Photo Contacts, you can assign photos to your contacts in your address book (see Figure 3).


Figure 3. Assigning photos to your contacts

If your service provider supports caller identification, the photo of the caller will be displayed when your smartphone rings (see Figure 4).


Figure 4. Displaying the photo of the caller

World Time

Another useful application is the World Time application by The MadBeetle. Using the World Time (see Figure 5), you can view the time of 400 cities worldwide. City data includes:

  • Sunrise\sunset
  • GMT offset
  • Daylight savings
  • Analogue clock
  • The moon phase
  • Airport code
  • Dial Code
  • Longitude and Latitude

The World Time application is useful if you do a lot of travelling and need to check out the different time zones.


Figure 5. Using World Time to check on different time zones

System Utilities

If you constantly install applications and move files into and out of your smartphone, then you need an effective way to view the various resources on your smartphone. I've found Resco SystemToys for Smartphone to be a good choice.

Resco SystemToys allows you to check on your battery status, as well as the amount of memory remaining (see Figure 6). So the next time you want to install that favorite MP3 on your smartphone, check out the amount of available memory first.


Figure 6. Use Resco SystemToys to check the battery and memory status

Pocket TV

If you spend a significant amount of time on the road, then you will be glad that PocketTV allows you to play MPEG movies on your smartphone (see Figure 7).


Figure 7. Watching movies using PocketTV

You can download some free video clips from pocketmovies.net. I downloaded snippets of The Return of the King and played them on the MPx200. The playback was smooth and the sound of acceptable quality. So the next time you hit the road, be sure that you load your smartphone with the latest movie hits.

Media Player on Your Smartphone

Envy those people who have an iPod or a digital video player? Fret not; with a little investment, you can turn your smartphone into a music player. In fact, your smartphone already comes with the required software to play your music and video files (MP3s and WMA are supported). The only constraint that you probably face is storage. While the iPod supports storage of 4GB and above, your smartphone comes with a paltry storage space of about 10MB (this depends on your phone model). So you can literally forget about storing your music files on your smartphone.

Fortunately, this problem can be solved by buying an external storage card. For music- and video-playing purposes, I suggest you invest in at least a 128MB SD card. If budget allows, go for the largest in capacity -- 1GB (see Figure 8).


Figure 8. Invest in a large-capacity SD memory card

To copy CD music or videos onto your smartphone, you can use Media Player 9 (see Figure 9).


Figure 9. Using Windows Media Player 9 to copy your music or video onto your smartphone

Playing music on the smartphone is cool -- the sound quality is good and crisp. However, video playback using the smartphone Windows Media player is not fantastic -- screens tend to be jerky. The sound track of the video is good, but the video does not synchronize well with the sound. Even so, watching videos while you are on the train is still a good way to spend your time (see Figure 10).


Figure 10. Watching a video on my smartphone

Final Thoughts

One of the success factors for a platform is the amount of applications available for it. In my upcoming articles, I am going to dive more deeply into how to get more out of your smartphone. In the meantime, do share with us on your favorite applications on the smartphone.

'개발이야기' 카테고리의 다른 글

WM6 A2DP best settings here - xda-developers  (0) 2007.08.06
Windows CE Developers FAQ  (9) 2007.08.06
Bluetooth (A2DP)  (0) 2007.08.03
RegistryNotifyCallback  (4) 2007.07.31
The State and Notifications Broker Part I  (4) 2007.07.31
HTC Application Unlock Guide  (0) 2007.07.30
Posted by krsuncom
개발이야기2007. 7. 31. 16:46

원본 : 요기

RegistryNotifyCallback

Windows Mobile

Windows Embedded CE

6/12/2007

This function registers a transient notification request. It is used to request that the caller be notified by a specified callback when a specified value has been changed.

SyntaxSyntax

Copy Code

HRESULT WINAPI RegistryNotifyCallback(
  HKEY hKey,
  LPCTSTR pszSubKey,
  LPCTSTR pszValueName,
  REGISTRYNOTIFYCALLBACK pfnRegistryNotifyCallback,
  DWORD dwUserData,
  NOTIFICATIONCONDITION * pCondition,
  HREGNOTIFY * phNotify
);

ParametersParameters

hKey

[in] Handle to a currently open key, or a predefined root value.

pszSubKey

[in] The key under which the value is stored. If this value is NULL, pszValueName is assumed to be under hKey.

pszValueName

[in] The name of the value on which change notifications are requested. If this value is NULL, it indicates the default value.

dwUserData

[in] User data that will be passed back to the user with the notification.

pfnRegistryNotifyCallback

[in] A pointer to a function that will be called back when a notification arrives. For a prototype for this function, see REGISTRYNOTIFYCALLBACK.

pCondition

[in] Condition that determines when to send the notification. When the comparison between pCondition and the new registry value is TRUE, then a notification is sent. If this value is NULL, any change results in a notification.

phNotify

[out] Receives the handle to the notification request. This handle should be closed using RegistryCloseNotification when notifications on this key are no longer needed. Resetting the device also stops the notification.

Return ValueReturn Value

Value
Description

S_OK

Request for change notification is registered.

E_INVALIDARG

Invalid hKey, phNotify, or pfnRegistryNotifyCallback.

An error value returned.

Error value wrapped as a FACILITY_WIN32 HRESULT.

RemarksRemarks

The client will be notified of changes via the callback, which is executed on private thread separate from the thread that called RegistryNotifyCallback.

If the value does not exist at the time of the call to RegistryNotifyCallback, the client will be notified when the value is added.

To stop notification and to close the notification handle, the caller must call RegistryCloseNotification. However, this type of notification is transient. Resetting the device stops the notification.

This function can be used to monitor any registry key in the system. The header file snapi.h contains definitions for the registry keys, paths, values, and bitmasks for all the base notifications that are provided by the system.

If the notification to the callback function fails, the notification will be removed.

If the key specified by hKey and pszSubKey doesn't exist, then hKey is monitored until pszSubKey is created, after which pszSubKey is monitored and changes to the key will trigger notifications as requested. To minimize possible performance degradation stemming from a large nuimber of subkeys being monitored, it is a best practice to pass (as hKey) the handle to a key that's as close as possible to pszSubKey rather than passing a root key. For example, if the client is a game and it is monitoring the key structure HKEY_CURRENT_USER\...\MyCoolGame\Player1 and the game could later create HKEY_CURRENT_USER\...\MyCoolGame\Player2, two possible ways to approach notification of changes to the Player2 key include:

Potential performance degradation
Fewer potential problems

hKey = handle to HKEY_CURRENT_USER andpszSubKey=the full path to Player2

hKey = handle to HKEY_CURRENT_USER\...\MyCoolGame\ andpszSubKey=Player2

Code ExampleCode Example

The following code example demonstrates how to use RegistryNotifyCallback.

Note:

To make the following code example easier to read, security checking and error handling are not included. This code example should not be used in a release configuration unless it has been modified to include them.

Copy Code

void AdjustPowerConsumption(HREGNOTIFY hNotify, DWORD dwUserData, const PBYTE pData, const UINT cbData);
// Register to be notified of changes to the eighth bit
// in SN_POWERBATTERYSTATE_VALUE. The eighth bit is set to one when 
// the battery is critically low (and set to zero and when it is not).
HRESULT RegistryNotifyCallbackExample()
{
    NOTIFICATIONCONDITION nc;
    HRESULT hr         = S_OK;
    HREGNOTIFY hNotify = NULL;
    // Initialize the notification structure.
    // The mask for the eighth bit.
    nc.dwMask = 0x8;
    // Receive a notification whenever that bit toggles.
    nc.ctComparisonType = REG_CT_ANYCHANGE;
    // dw is ignored for REG_CT_ANYCHANGE.
    nc.TargetValue.dw = 0;
    
    hr = RegistryNotifyCallback(SN_POWERBATTERYSTATE_ROOT, 
                                SN_POWERBATTERYSTATE_PATH, 
                                SN_POWERBATTERYSTATE_VALUE, 
                                AdjustPowerConsumption, 
                                0, 
                                &nc, 
                                &hNotify);
    // Close the notification using RegistryCloseNotification when done.
    // Note that it is alright to call RegistryCloseNotification from the callback function.
    // hr = RegistryCloseNotification(hNotify);
    return hr;
}
// This is the callback function.
void AdjustPowerConsumption(HREGNOTIFY hNotify, DWORD dwUserData, const PBYTE pData, const UINT cbData)
{
    DWORD dwCritical;
    HRESULT hr = S_OK;
    // pData contains the new value for SN_POWERBATTERYSTATE_VALUE.
    dwCritical = (*(DWORD*) pData);
    // Extract the eighth bit.
    dwCritical = dwCritical & 0x8; 
critically low.
    {
 your statements for preserving energy, here.
    }
    // The battery level was critically low, but it is not now.
    else
    {
        // Add your statements for returning to the normal battery state, here.
    }
}

Code ExampleCode Example

The following code example demonstrates how to register transient notification requests for phone StatStore values.

Note:

To make the following code example easier to read, security checking and error handling are not included. This code example should not be used in a release configuration unless it has been modified to include them.

Copy Code

#include <regext.h>
#include "snapi.h"
const TCHAR c_szPhoneRegistryRootkey[]      = TEXT("System\\State");
const TCHAR c_szPhoneRegistrySubkey[]       = TEXT("Phone");
const TCHAR c_szPhoneSignalStrength[]       = TEXT("Signal Strength");
const TCHAR c_szPhoneIncomingCallerNumber[] = TEXT("Incoming Caller Number");
const TCHAR c_szPhoneStatus[]               = TEXT("Status");
#define MAX_NOTIF 3
enum NotifType
{
      SignalStrength = 0,
      IncomingCallerNumber,
      PhoneRoaming
};
HREGNOTIFY g_hRegNotify[ MAX_NOTIF ] ;
// The call-back function for Registry Notifications.
void RegistryNotifyCallbackFunc(HREGNOTIFY hNotify, DWORD dwUserData, const PBYTE pData, const UINT cbData)
{
    TCHAR szOutput[MAX_PATH];
    // Identify the Notification received, based upon the User Data passed in, while registering for the notification.
    switch( dwUserData )
    {
        case SignalStrength:
            StringCchPrintf(szOutput, MAX_PATH, _T("The Signal Strength is %d"), (DWORD) *pData);
            break;
        case IncomingCallerNumber:
            StringCchPrintf(szOutput, MAX_PATH, _T("The Incoming Caller Number is %s"), (TCHAR*)pData);
            break;
        case PhoneRoaming:
            {
                  DWORD dw = 0;
                  // Copy the data sent to us into a local buffer.
                  memcpy(&dw, pData, cbData);
                  // Find out if the roaming status has been set by logically ANDing the data with the value 512 (the bitmask for roaming).
                  StringCchPrintf(szOutput, MAX_PATH, _T("The Roam Status of the Phone is %s"), ( dw & SN_PHONEROAMING_BITMASK ) == SN_PHONEROAMING_BITMASK  ? _T("TRUE") : _T("FALSE")  );
            }
            break;
        default :
            break;
    }
    OutputDebugString( szOutput );
    return;
}
void RegisterForPhoneNotifications()
{
    HKEY hKey;
    // Let us open the registry to get a handle to the Phone Registry key.
    if (S_OK == RegOpenKeyEx(HKEY_LOCAL_MACHINE, c_szPhoneRegistryRootkey, 0,  KEY_QUERY_VALUE, &hKey))
    {
    // Since we are registering for multiple notifications, let's pass some unique User Data for each notification ( 5th param ), 
    // which will help us identify the notification in the Call Back.
     // Let us register for Signal strength notifications.
     HRESULT hr = RegistryNotifyCallback(hKey, 
                                         c_szPhoneRegistrySubkey,
                                         c_szPhoneSignalStrength,
                                         RegistryNotifyCallbackFunc,
                                         SignalStrength,
                                         NULL,
                                         &g_hRegNotify[ SignalStrength ] );
        
    // Let us register for Incoming Caller Number notifications.
            hr = RegistryNotifyCallback(hKey, 
                                        c_szPhoneRegistrySubkey,
                                        c_szPhoneIncomingCallerNumber,
                                        RegistryNotifyCallbackFunc,
                                        IncomingCallerNumber,
                                        NULL,
                                        &g_hRegNotify [ IncomingCallerNumber ] );
    //  Let us register for Roaming status change notifications.
            hr = RegistryNotifyCallback(hKey, 
                                        c_szPhoneRegistrySubkey,
                                        c_szPhoneStatus,
                                        RegistryNotifyCallbackFunc,
                                        PhoneRoaming,
                                        NULL,
                                        &g_hRegNotify [ PhoneRoaming ] );
        RegCloseKey(hKey);
      
    }
}
void  CloseAllNotifications ()
{
     for (int i = 0; i < MAX_NOTIF; i++)
    {
            RegistryCloseNotification(g_hRegNotify[i]);
    }
}

RequirementsRequirements

Header
regext.h

Library
aygshell.lib

Windows Embedded CE
Windows Embedded CE 6.0 and later

Windows Mobile
Pocket PC for Windows Mobile Version 5.0 and laterSmartphone for Windows Mobile Version 5.0 and later

See AlsoSee Also

Reference
REGISTRYNOTIFYCALLBACK Structure
RegistryBatchNotification
State and Notifications Broker Functions
State and Notifications Broker Reference
Concepts
Using the State and Notifications Broker in Native Code
Other Resources
State and Notifications Broker

 

RegistryNotifyCallback

Posted by krsuncom
개발이야기2007. 7. 31. 16:03

원본 : 요기

The State and Notifications Broker Part I

Jim Wilson
JW Hedgehog, Inc.

February 2006

Applies to:
   Microsoft .NET Compact Framework version 2.0
   Microsoft Visual Studio 2005
   Windows Mobile 5.0

Summary: In this month's column, Jim introduces the State and Notifications Broker and its role in enabling applications to work more closely with the Windows Mobile platform. The discussion covers the underlying architecture of the State and Notifications Broker, the use of the State and Notifications Broker API to retrieve more than 100 different state values, and how an application can cooperate with the State and Notifications Broker to receive notifications about changes to important state values, such as a change in network availability. This column covers both native and managed code usage of the State and Notifications Broker API.

This month's column is part one of a two-part examination of the State and Notifications Broker and is the first in a series of many deep-dive discussions about the new features Windows Mobile 5.0, the .NET Compact Framework 2.0 and Visual Studio 2005 provide. (20 printed pages)

Contents

Introduction
Getting Started with the State and Notifications Broker
Retrieving Windows Mobile State Information
Receiving Notifications
Conclusion

Introduction

As I mentioned in my previous column, A View of Windows Mobile 5.0 from 10,000 Feet, we are going to spend the next several months taking a detailed look at the new features that Windows Mobile 5.0, Visual Studio 2005, and the .NET Compact Framework version 2.0 offer developers. This first article in the series provides a detailed look at the Windows Mobile 5.0 State and Notifications Broker API.

I have to say that choosing the first feature to investigate was actually easier than I thought. I'm not saying that Windows Mobile 5.0, Visual Studio 2005, and the .NET Compact Framework 2.0 don't offer a lot of great new features—they certainly do. But the State and Notifications Broker API is one of those APIs that literally opens up a whole world of opportunities. Common situations that have historically been difficult to deal with programmatically become quite easy to manage—such as detecting changes in network connectivity, locating the Pocket Outlook contact that corresponds to the incoming caller, or determining that the device battery has become critically low. Similarly, situations where you have an application that needs to publish changes in the application's state or share data with other applications become significantly easier with the State and Notifications Broker API.

The State and Notifications Broker API offers too many features to cover in a single edition of this column, so I'm going to divide this discussion about the State and Notifications Broker API into two parts. In part I, we'll look at using the State and Notifications Broker API to more closely integrate your applications with the device and built-in Windows Mobile applications. In part II, we'll discuss using the State and Notifications Broker API in some more advanced situations, and we'll also look at how to expose state information from your own applications.

Getting Started with the State and Notifications Broker

As the name implies, the State and Notifications Broker provides two services. First, it acts as a central repository for state information without regard for the source of that information. Second, it provides a standard architecture for monitoring those state values for changes and distributing change notifications to the list of interested parties. Fundamentally the State and Notifications Broker is a data store that provides a standardized publish-subscribe model for distributing data change notifications. Don't let this simple definition fool you. The State and Notifications Broker is a very powerful tool.

With the State and Notifications Broker, Windows Mobile 5.0 changes a smart device from a device that simply runs a bunch of independent applications to a holistic platform where applications can easily share information and respond to changes in the device's state and to the state of other applications. The State and Notifications Broker provides the user with a high degree of continuity between individual applications and creates a device that, in a sense, runs a single meta-application made up of the best features of the individual applications that run on the device.

Remember that the State and Notifications Broker and the corresponding API, the State and Notifications Broker API, are part of the Windows Mobile 5.0 platform and, therefore, require you to install Visual Studio 2005 and the Windows Mobile 5.0 SDK for Pocket PC or Smartphone on your desktop computer.

Note   See the Windows Mobile 5.0 Developer Tools section in last month's column for the complete list of downloads and installations that are required to develop Windows Mobile 5.0 applications.
Locating the State and Notifications Broker API SDK Files

The exact location of the Windows Mobile 5.0 SDK on your desktop computer depends on which Windows Mobile 5.0 SDK you've installed. If you install the Windows Mobile 5.0 SDK for Smartphone and accept the default installation path, the SDK files are installed in \Program Files\Windows CE Tools\wce500\Windows Mobile 5.0 Smartphone SDK\. If you install the Windows Mobile 5.0 SDK for Pocket PC, you need to substitute Pocket PC for Smartphone in the previous path. With the Windows Mobile 5.0 SDK installed on their desktop computers, both managed-code and native-code developers have everything they need to use the State and Notifications Broker API.

The classes that are contained in the Microsoft.WindowsMobile.Status assembly expose the State and Notifications Broker API to managed-code developers. With the Windows Mobile 5.0 SDK installed, you can add a reference to the assembly by simply selecting it from the Add Reference dialog box in Visual Studio 2005, as shown in Figure 1.

Note   The Microsoft.WindowsMobile.Status assembly relies on types that are defined in the Microsoft.WindowsMobile assembly; therefore, anytime you add a reference to Microsoft.WindowMobile.Status to a project, you must also add a reference to Microsoft.WindowsMobile. Failing to do so will result in build errors.

Click here for larger image

Figure 1. Adding a reference to the Microsoft.WindowsMobile.Status assembly. Click the thumbnail for a larger image.

If you want to spelunk through the contents of the assembly by using a tool like ildasm or Reflector (for more information, see the Lutz Roeder's Programming.NET Web site), you need to open the assembly file directly, which you can find in the Designtimereferences subfolder of the Windows Mobile 5.0 SDK installation folder. All classes that are contained in the Microsoft.WindowsMobile.Status assembly are part of the "Microsoft.WindowsMobile.Status" namespace.

Native-code developers access the State and Notifications Broker API functions and structures by including the regext.h header file. This header file and other Windows Mobile 5.0 header files are located in the \Include\Armv4i subfolder of the Windows Mobile 5.0 SDK installation folder. The State and Notifications Broker API functions are all implemented in the aygshell.lib library. Visual Studio 2005 generated projects that target the Windows Mobile 5.0 platform automatically link to this library, so in most cases, you won't have to add the aygsell.lib file to the project libraries—because it will already be there.

Retrieving Windows Mobile State Information

As I mentioned previously in this article, one role of the State and Notifications Broker API is to provide unified access to state information. This information provides one-stop shopping for all of your system state needs. The Windows Mobile 5.0 platform ships with over 100 state values that the State and Notifications Broker tracks. These values relate to both the state of the device itself and the state of standard Windows Mobile 5.0–based applications such as Pocket Outlook.

Examples of system-wide state values include the following:

  • ActiveSync status
  • Whether a camera is present
  • Number of Bluetooth connections
  • List of current network connections
  • Whether a headset is connected
  • Whether a keyboard is connected
  • Display orientation
  • Battery strength
  • Outlook Mobile contact that corresponds to the current caller on the phone

Examples of per-user state values include the following:

  • Names of the currently active and previously active applications
  • Next calendar appointment
  • Media player information including current track title, artist, and album
  • Name of the Outlook Mobile e-mail account and number of unread e-mail messages
  • Name of short message service (SMS) account and number of unread SMS messages
  • Number of missed phone calls
  • Number of active tasks and number of overdue tasks

As you can see, the list of state information that the State and Notifications Broker tracks is quite comprehensive. In addition to more than 100 standard state values, original equipment manufacturers (OEMs) are free to add more values.

If you've been working with Windows Mobile–based devices for a while, you might notice that several of the listed state values are available from other APIs. For example, you can determine the current display orientation by calling the GetSystemMetrics function or by checking the Screen.PrimaryScreen.Bounds property if you are using managed code. Similarly, you can retrieve the current battery strength by calling the GetSystemPowerStatusEx method. And of course, information regarding the Calendar and Tasks is available through the Pocket Outlook API.

With these existing APIs, you may wonder why the State and Notifications Broker API has been added. As you'll see, there are a number of reasons, but one of the most notable is that the State and Notifications Broker API provides a single source for retrieving all state information. It is no longer necessary to hunt down a separate function or API for each individual state value. Also, prior to the introduction of the State and Notifications Broker API, determining a specific state value often required several function calls—and sometimes additional logic. With the State and Notifications Broker API, each state value is available through a single function call (in the case of native code) and as a single property value (in managed code).

The underlying implementation of the State and Notifications Broker uses the registry as the data store. All system-wide state values are stored under the HKEY_LOCAL_MACHINE\System\State registry key, and per-user state information is stored under the HKEY_CURRENT_USER\System\State registry key.

Under each of these registry keys, there are multiple child keys. Each child key has one or more values. These values hold the actual state information. Figure 2 shows the contents of the HKEY_LOCAL_MACHINE\System\State registry key on the Windows Mobile 5.0 Smartphone emulator.

Click here for larger image

Figure 2. State registry keys on the Windows Mobile 5.0 Smartphone emulator. Click the thumbnail for a larger image.

Accessing State Values from Native Code

With the information for the State and Notifications Broker being stored in the registry, you can easily access the information by using standard registry functions like RegOpenKeyEx and RegQueryValueEx. The following code example shows how to retrieve the name of the phone's service operator with native code by using these functions.

Copy Code

HKEY hPhone;
TCHAR tszOperatorName[1024];
DWORD dwType;
DWORD dwSize = sizeof(tszOperatorName);

RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("System\\State\\Phone"),
             0, 0, &hPhone);
RegQueryValueEx(hPhone, _T("Current Operator Name"), 0, &dwType,
               (BYTE*)tszOperatorName, &dwSize);

This code uses the RegOpenKeyEx function to open the HKEY_LOCAL_MACHINE\System\State\Phone registry key and then retrieves the operator name from the key's Current Operator Name value using the RegQueryValueEx function.

If you've done some work with the registry, you know that this pattern of opening a key and then accessing a value is common. With the introduction of the State and Notifications Broker, this pattern of access will likely become even more common. As a result, to simplify accessing registry values, the State and Notifications Broker API introduces two new functions: RegistryGetString and RegistryGetDWORD. Each function encapsulates both opening a key and accessing a value. The two functions behave exactly the same; they are just specialized for retrieving either string or DWORD values. The following example retrieves the phone service operator this time by using the RegistryGetString function.

Copy Code

TCHAR tszOperatorName[1024];
RegistryGetString(HKEY_LOCAL_MACHINE, _T("System\\State\\Phone"), 
    "Current Operator Name", tszOperatorName, sizeof(tszOperatorName));

As you can see, this code example is much simpler than the previous code example because it requires only a single function call and avoids the need to declare the extra variables that the RegOpenKeyEx and RegQueryValueEx functions require.

One of the biggest challenges in working with the State and Notifications Broker API in native code is keeping track of all of the registry key and value names. With more than 100 standard state values in the State and Notifications Broker, there are also more than 100 registry key and value name combinations. You also need to keep track of whether the registry key that corresponds to the state value of interest is located under the HKEY_LOCAL_MACHINE or HKEY_CURRENT_USER registry key. Thankfully, you can find the list of standard state values that the State and Notifications Broker API tracks and the corresponding registry information in the State and Notifications Broker Base Properties help topic within the mobile5sdk.chm help file, which is located in the Help subfolder of the Windows Mobile 5.0 SDK installation folder.

Note   The easiest way to locate the help topic is to open the mobile5sdk.chm file and search for the string "State and Notifications Broker Base Properties". At the time I wrote this article, there is a version of the State and Notifications Broker Base Properties help topic located in the MSDN Library, but it didn't include the registry key and value names.

The documentation is a great help, but with the registry key names and value names being strings, there's no way to know about any error that might exist in the registry key or value name strings at compile time. Instead, the program will fail at run time. To avoid this failure, the State and Notifications Broker API provides a header file, snapi.h, that provides a complete list of #define values for the standard State and Notifications Broker API state values. The #define values include the root key, the key name, and value name for each state value. The following code example is the portion of the snapi.h header file that corresponds to the phone service operator state value.

Copy Code

///////////////////////////////////////////////////////////////////////
// PhoneOperatorName
// Gets the name of the mobile operator (i.e., the mobile phone 
// company, or carrier).
#define SN_PHONEOPERATORNAME_ROOT HKEY_LOCAL_MACHINE
#define SN_PHONEOPERATORNAME_PATH TEXT("System\\State\\Phone")
#define SN_PHONEOPERATORNAME_VALUE TEXT("Current Operator Name")

The following code example shows accessing the phone service operator, this time by using the provided #define values instead of the literal strings.

Copy Code

TCHAR tszOperatorName[1024];
RegistryGetString(SN_PHONEOPERATORNAME_ROOT, SN_PHONEOPERATORNAME_PATH, 
    SN_PHONEOPERATORNAME_VALUE, tszOperatorName, 
    sizeof(tszOperatorName));

Using the #define values rather than literal strings makes the code easier to read and, in the event that there are any errors in the #define value names, the compiler reports them.

Working with DWORD Values and Bitmasks in Native Code

When accessing DWORD state values you use the RegistryGetDWORD function rather than the RegistryGetString function of course, but there's also a little more to it. Let's take a look at the #defines values for two state values in the snapi.h header file: Phone Multi-Line and Phone Radio Present.

Copy Code

///////////////////////////////////////////////////////////////////////
// PhoneMultiLine
// Gets a value indicating whether the phone supports multiple lines.
#define SN_PHONEMULTILINE_ROOT HKEY_LOCAL_MACHINE
#define SN_PHONEMULTILINE_PATH TEXT("System\\State\\Phone")
#define SN_PHONEMULTILINE_VALUE TEXT("Multiline Capabilities")

///////////////////////////////////////////////////////////////////////
// PhoneRadioPresent
// Gets a value indicating whether the mobile device has a phone.
#define SN_PHONERADIOPRESENT_ROOT HKEY_LOCAL_MACHINE
#define SN_PHONERADIOPRESENT_PATH TEXT("System\\State\\Phone")
#define SN_PHONERADIOPRESENT_VALUE TEXT("Status")
#define SN_PHONERADIOPRESENT_BITMASK 32

In the case of Phone Multi-Line, a single function call accesses the DWORD value very much like accessing a string state value, as shown in the following code example.

Copy Code

DWORD dwPhoneMultiLine;
RegistryGetDWORD(SN_PHONEMULTILINE_ROOT, SN_PHONEMULTILINE_PATH, 
    SN_PHONEMULTILINE_VALUE, &dwPhoneMultiLine);

By looking at the Phone Multi-Line #define values, you can see that the state value is stored in the MultiLine Capabilities value of HKEY_LOCAL_MACHINE\System\State\Phone. A quick look at Figure 3 shows that the state value is 1. As a result, the call to the RegististryGetDWORD function in the previous code example returns 1, indicating that the phone on the current device—in this case is the Windows Mobile 5.0 Smartphone emulator—supports multiple lines.

Click here for larger image

Figure 3. The Phone state values viewed with regedit.exe. Click the thumbnail for a larger image.

Note   In the case of the Windows Mobile 5.0 Smartphone emulator, the radio is a fake radio with service provided by Fake Network. From a programming standpoint, this emulator provides all of the characteristics of having a phone radio, so attempts to make a phone call or to check the status of the radio appear to succeed when, in reality, no phone actually exists. This fake radio is very useful for developing and initial testing of phone-related applications without incurring the cost of placing a mobile phone call or acquiring a device.

For the Phone Radio Present state value, the #define values show that it is stored in the registry value Status under the same key as Phone Multi-Line. If you look at Figure 3 again, it shows that the value stored in the registry for Status is 9437344. This value may look strange and certainly doesn't seem to apply to whether or not the device has a radio.

Unlike the registry value MultiLine Capabilities, which stores a single state value, Status actually stores multiple state values, and each state value is represented as a separate bit. To access the specific state value of interest, you must apply a bitmask. In the case of the Phone Radio Present state value, that bitmask is contained in the #define value SN_PHONERADIOPRESENT_BITMASK. The following code example shows using the bitmask to determine if the current device has a phone radio.

Copy Code

DWORD dwValue;
RegistryGetDWORD(SN_PHONERADIOPRESENT_ROOT, SN_PHONERADIOPRESENT_PATH, 
                 SN_PHONERADIOPRESENT_VALUE, &dwValue);
  BOOL bPhoneRadioPresent = dwValue & SN_PHONERADIOPRESENT_BITMASK;

As you can see, the initial value is still retrieved from the registry by using the RegistryGetDWORD function, but the additional step of applying the bitwise AND operator to the returned value is required to see if the bit corresponding to the state value Phone Radio Present is set.

Not all DWORD state values that require a bitmask are Boolean values. In some cases, a single DWORD is used to store two smaller ranged state values—as in the case of the Main registry value under HKEY_LOCAL_MACHINE\System\Status\Battery. This one registry value represents both the battery strength level and the battery state. These two state values also demonstrate another important issue: these values are enumerations. As enumerations, they each represent a finite set of values. The thing that I find frustrating is that the current implementation of the State and Notifications Broker API doesn't provide any corresponding C/C++ enum declarations or #define values. So you can either place the literal values in your code—leaving anyone who must later support that code to figure out what they mean—or you can provide your own #define declarations. The mobile5sdk.chm help file topic, State and Notifications Broker Base Properties, that I mentioned previously in this article contains the list of possible values for these two state values. The following code example contains #define values that you can use with the battery state and battery strength level state values.

Copy Code

#define BATTERYLEVEL_VERYLOW    0
#define BATTERYLEVEL_LOW       21
#define BATTERYLEVEL_MEDIUM    41
#define BATTERYLEVEL_HIGH      61
#define BATTERYLEVEL_VERYHIGH  81

#define BATTERYSTATE_NORMAL     0
#define BATTERYSTATE_NOTPRESENT 1
#define BATTERYSTATE_CHARGING   2
#define BATTERYSTATE_LOW        4
#define BATTERYSTATE_CRITICAL   8

Using these #define values, the following code example demonstrates accessing the battery state and battery strength level state values.

Copy Code

DWORD dwBatteryMain;
RegistryGetDWORD(SN_POWERBATTERYSTRENGTH_ROOT, 
                 SN_POWERBATTERYSTRENGTH_PATH, 
                 SN_POWERBATTERYSTRENGTH_VALUE, 
                 &dwBatteryMain);

int batteryLevel = (dwBatteryMain & SN_POWERBATTERYSTRENGTH_BITMASK) >> 16;
int batteryState = dwBatteryMain & SN_POWERBATTERYSTATE_BITMASK;

TCHAR tszBatteryLevel[256];
// Build a string description of the battery strength level
switch(batteryLevel)
{
    case BATTERYLEVEL_VERYLOW :
        _tcscpy(tszBatteryLevel, _T("Battery Level: Very Low"));
        break;
    case BATTERYLEVEL_LOW :
        _tcscpy(tszBatteryLevel, _T("Battery Level: Low"));
        break;
    case BATTERYLEVEL_MEDIUM :
        _tcscpy(tszBatteryLevel, _T("Battery Level: Medium"));
    case BATTERYLEVEL_HIGH :
        _tcscpy(tszBatteryLevel, _T("Battery Level: High"));
    case BATTERYLEVEL_VERYHIGH :
        _tcscpy(tszBatteryLevel, _T("Battery Level: Very High"));
        break;
}

TCHAR tszBatteryState[256];
// Build a string description of the battery state
_tcscpy(tszBatteryState, _T("Battery State: "));
if (batteryState & BATTERYSTATE_NORMAL)
    _tcscat(tszBatteryState, _T("Normal "));
if (batteryState & BATTERYSTATE_NOTPRESENT)
    _tcscat(tszBatteryState, _T("Not Present "));
if (batteryState & BATTERYSTATE_CHARGING)
    _tcscat(tszBatteryState, _T("Charging "));
if (batteryState & BATTERYSTATE_LOW)
    _tcscat(tszBatteryState, _T("Low "));
if (batteryState & BATTERYSTATE_CRITICAL)
    _tcscat(tszBatteryState, _T("Critical "));

This code example demonstrates several simple—but important—points. The first point is the opportunity to optimize the retrieval of state values when they share a single registry value. After the RegistryGetDWORD function is called to retrieve the registry value Main for the HKEY_LOCAL_MACHINE\System\State\Battery registry key, applying the respective bitmasks determines both the battery state and battery strength level state values. Reusing the registry value is obviously more efficient than making a second call to the RegistryGetDWORD function by using the SN_POWERBATTERYSTATE_XX #define values, which would return the same registry value that the call using the SN_POWERBATTERYSTRENGTH_XX #define values returned. This optimization is especially helpful in cases where the registry value represents a large number of state values. For example, the Status registry value for the HKEY_LOCAL_MACHINE\System\State\Phone registry key I discussed previously in this article actually holds 25 different state values—meaning that a single call to the RegistryGetDWORD function can retrieve one DWORD value that contains the 25 individual values. Each individual value is determined by simply using the bitwise AND operator to apply the appropriate #define value for each.

The second point demonstrated in the code example is the importance of knowing the value of the bitmask used to access the state value. In the case of battery strength level, the bitmask SN_POWERBATTERYSTRENGTH_BITMASK is 0xFFFF0000, indicating that the value is stored in the upper two bytes of the registry value. To make the result of the bitwise AND operator meaningful, you must shift the value 16 bits (two bytes) to the right. For example, if the result of the bitwise AND is 0x150000 (1,376,256 decimal), shifting the value 16 bits produces 0x15 (21 decimal). Checking the battery strength level #define values tells us that a battery strength level of 21 decimal means that the battery strength level is low.

The third point from the code example has to do with the knowing whether the state enumeration values are simple values or if these values also require the use of a bitmask. In the case of the battery strength level, the state value is a simple value, meaning that of the five #defines values, the battery strength level matches exactly one. With this being the case, the easiest way in the code example to check the current value is to simply use a switch statement. In the case of the battery state, you must use a bitmask to determine the state value itself because multiple battery states may be true at the same time; for example the battery may be charging, but it may still be low. As a result, the code example explicitly checks for each battery state by using a bitwise AND operator.

Accessing State Values from Managed Code (or Managed Code is Bliss)

As is usually the case, using C or C++ gives a developer the most direct access to the behaviors and capabilities of the platform. As is also usually the case, the cost of this direct access is that the C/C++ developer is responsible to handle the details involved in interacting with the platform. On the other hand, managed code puts a greater focus on developer productivity by choosing to encapsulate details within class libraries. I don't know that I've ever seen a case where the difference between these two philosophies is more evident than in the State and Notifications Broker API.

For managed-code developers, static properties in the SystemState class provide access to the standard State and Notifications Broker state values. Whether you are accessing the State and Notifications Broker API from native or managed code, the underlying implementation is identical and the same registry structure and values are being used. The one important difference is that all of the details of interacting with the registry including specific registry locations and the required bitmasks are completely encapsulated in the SystemState class. Managed-code developers simply access the SystemState static property that corresponds to the state value of their interests. The following code example demonstrates accessing the Phone Service Operator Name, Phone Multi-Line Capabilities, and Phone Radio Present state values.

Copy Code

using Microsoft.WindowsMobile.Status;
// …string operatorName = SystemState.PhoneOperatorName;
bool phoneMultiLine = SystemState.PhoneMultiLine;
bool phoneRadioPresent = SystemState.PhoneRadioPresent;

As you can see by the code example, the SystemState properties completely encapsulate the registry and bitmask details. Each property simply accesses the corresponding state value.

In addition to encapsulating the details of accessing the state values, the managed State and Notifications Broker API also makes interpreting the returned state values easier by providing .NET Compact Framework enumerated types for those properties that have enumerated return values, as demonstrated by the following code example.

Copy Code

BatteryLevel batteryLevel = SystemState.PowerBatteryStrength;
BatteryState batteryState = SystemState.PowerBatteryState;

string batteryLevelText;
switch (batteryLevel)
{
    case BatteryLevel.VeryLow:
        batteryLevelText = "Battery Level: Very Low";
        break;
    case BatteryLevel.Low:
        batteryLevelText = "Battery Level: Low";
        break;
    case BatteryLevel.Medium:
        batteryLevelText = "Battery Level: Medium";
        break;
    case BatteryLevel.High:
        batteryLevelText = "Battery Level: High";
        break;
    case BatteryLevel.VeryHigh:
        batteryLevelText = "Battery Level: Very High";
        break;
}

string batteryStateText = "Battery State: ";
if ((batteryState & BatteryState.Normal) == BatteryState.Normal)
    batteryStateText += "Normal";
if ((batteryState & BatteryState.NotPresent) == BatteryState.NotPresent)
    batteryStateText += "Not Present";
if ((batteryState & BatteryState.Charging) == BatteryState.Charging)
    batteryStateText += "Charging";
if ((batteryState & BatteryState.Low) == BatteryState.Low)
    batteryStateText += "Low";
if ((batteryState & BatteryState.Critical) == BatteryState.ChargCriticaling)
    batteryStateText += "Critical";

As you can see, the type of the SystemState.PowerBatteryStrength property is BatteryLevel, and the type of the SystemState.PowerBatteryState property is BatteryState making it very clear what to expect from each property. Notice that the way the enumeration values are tested in managed code is consistent with the same tests in native code; the BatteryLevel values are tested against specific values, whereas the BatteryState values are tested with a bitwise AND operator.

By encapsulating the details of the registry representation, the managed implementation of the State and Notifications Broker API makes accessing the standard state values extremely easy. This doesn't mean that managed-code developers never need to understand the registry structure. When we look at some of the more advanced uses of the State and Notifications Broker API next month, you will find that solidly understanding the State and Notifications Broker registry structure is just as important for managed-code developers as native-code developers.

Receiving Notifications

Acting as a central repository, the State and Notifications Broker certainly makes retrieving system and application information much easier than it was before the State and Notifications Broker API. Centralized state information is a great start, but for our applications to effectively cooperate with the device and the other applications running on those devices, we need to be able to do more than simply retrieve state values; we also need to be notified of changes to the state values. It's these notifications that transform the Windows Mobile platform from a bunch of independent applications into a holistic and cooperative platform of applications that work together as a single meta-application.

Note   The notifications feature of the State and Notifications Broker is extremely rich and flexible; however, I've just about used up all of the space I have for this month's column, so we'll focus on notification basics for now. In next month's column, we'll dig deep into the different notification features and capabilities.
Receiving Notifications in Native Code

change notifications, your application must perform three distinct steps:

  • Register to be notified about changes in one of the state values.
  • Handle the notification event.
  • Retrieve the new state value.

We'll look at how receiving notifications works by using one of the most important notifications to a mobile device application—the number of network connections. If the value is greater than zero, the device has a network connection and, therefore, can perform network-based communications.

The RegistryNotifyWindow function is the simplest way in native code to register for change notifications. The function accepts the registry key and value name of the monitored state value in addition to a window message identifier (ID) and a window handle. As the monitored state value changes, the State and Notifications Broker sends the specified message ID to the window identified by the handle.

The window message ID can be any valid message ID, but it is usually an ID value that is created by calling the RegisterWindowMessage function or by defining a constant based on the WM_USER #define value. For simplicity, we'll define a constant as shown in the following code example.

Copy Code

const DWORD WM_CONNECTIONSNETWORKCOUNT = WM_USER + 1;
Note   If you are new to creating custom window messages or haven't created one in a while, you can find more information about the importance of the WM_USER #define value from the MSDN documentation.

With the message defined, we are now ready to call the RegistryNotifyWindow function. You can call the RegistryNotifyWindow function at almost any point in the application you like—as long as the window represented by the window handle has been created. In this case, we want the notification sent to the main application window, so we can register in either the create (WM_CREATE) message handler or the InitInstance function.

The following code example shows calling the RegistryNotifyWindow function from the InitInstance function.

Copy Code

// Global Notification Handle
HREGNOTIFY g_hNotify = NULL;

BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
    // ...
    // ...

    g_hWnd = CreateWindow(szWindowClass, szTitle, WS_VISIBLE,
        CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 
        NULL, NULL, hInstance, NULL);
    ShowWindow(g_hWnd, nCmdShow);
    UpdateWindow(g_hWnd);

    // Register for changes in the number of network connections
    HRESULT hr = RegistryNotifyWindow(SN_CONNECTIONSNETWORKCOUNT_ROOT,
        SN_CONNECTIONSNETWORKCOUNT_PATH, SN_CONNECTIONSNETWORKCOUNT_VALUE, 
        g_hWnd, WM_CONNECTIONSNETWORKCOUNT, 0, NULL, &g_hNotify);

    return TRUE;
}

Notice that the last parameter to the RegistryNotifyWindow function is a returned handle to the notification. The handle is used to close the notification when it is no longer needed. For easy access later, the application stores the handle in a global variable.

To handle the notification, we simply modify the switch statement that is contained in the window's WndProc function, so the switch statement includes a case condition for the notification's registered message ID. Depending on the data type of the value being monitored, the new data value may or may not be included in the message. For values that are stored in the registry as the REG_DWORD data type (which include all numeric and enumeration values), the new value is passed in the message WPARAM parameter. For string values, the application must call the RegistryGetString function to retrieve the new value. In the case of this example, the Connections Network Count state value is numeric and, therefore, the new value is contained in the WPARAM parameter of the message.

The following code example shows the relevant portions of the WndProc function to handle the notification.

Copy Code

LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    int nNetworkConnections;
    int wmId, wmEvent;
    
    switch (message) 
    {
        // Number of network connections changed
        case WM_CONNECTIONSNETWORKCOUNT:
            nNetworkConnections = (int) wParam;
            if (nNetworkConnections == 0)
                StopDataTransfer();
            else
                StartOrContinueDataTransfer();
            break;
        case WM_COMMAND:
            // ..
        case WM_PAINT:
            // ..
        case WM_CREATE:
            // ..
        case WM_DESTROY:
            // ..
        default:
            return DefWindowProc(hWnd, message, wParam, lParam);
    }

    return 0;
}

That's all there is to it—the application now responds to changes in available network connectivity. Just as the code example demonstrates, an application can monitor changes in any of the state values by simply registering to receive the notification, handling the notification, and retrieving the current value that, in many cases, is passed as part of the message.

One last thing to remember is that monitoring notifications consumes device resources, so you'll want to call the RegistryCloseNotification function when you no longer need the notification or when the application closes. The only argument to the RegistryCloseNotification function is the handle returned by calling the RegistryNotifyWindow function.

In many cases, you will want the notification for the life of the application, so the most logical place to close the notification handle is when the application closes, as shown in the following code example.

Copy Code

LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    int nNetworkConnections;
    int wmId, wmEvent;
    
    switch (message) 
    {
        case WM_CONNECTIONSNETWORKCOUNT:
            // ..
        case WM_COMMAND:
            wmId    = LOWORD(wParam); 
            wmEvent = HIWORD(wParam); 
            switch (wmId)
            {
                case IDM_EXIT:
                    // Close notification handle
                    if (g_hNotify)
                        RegistryCloseNotification(g_hNotify);

                    DestroyWindow(hWnd);
                    break;
                default:
                    return DefWindowProc(hWnd, message, wParam, lParam);
            }
        case WM_PAINT:
            // ..
        case WM_CREATE:
            // ..
        case WM_DESTROY:
            // ..
        default:
            return DefWindowProc(hWnd, message, wParam, lParam);
    }

    return 0;
}
Receiving Notifications in Managed Code

As in the case of retrieving values from the State and Notifications Broker, the .NET Compact Framework encapsulates many of the details that are involved in state value change notifications within the SystemState class. In addition to providing the many static properties that are used to access the state values, the SystemState class also provides a Changed instance-based event. To receive a state value change notifications, your application must perform the following two steps:

  • Create an instance of the SystemState class and pass the appropriate SystemProperty enumeration that identifies the value of your interest.
  • Attach a delegate to the new SystemState instance's Changed event.

After these steps are complete, the delegate will be called with each change in the state value.

The following code example shows the C# code to register for notification of changes in the Connections Network Count value.

Copy Code

public partial class FormMain : Form
{
    private void FormMain_Load(object sender, EventArgs e)
    {
         _connectionsNetworkCount = 
               new SystemState(SystemProperty.ConnectionsNetworkCount);
        _connectionsNetworkCount.Changed+=connectionsNetworkCount_Changed;
    }
    // ...
    // ...
}
    SystemState _connectionsNetworkCount;

The _connectionsNetworkCount instance invokes its Changed event on any change in the Connections Network Count state value, which then calls the connectionsNetworkCount_Changed method.

Implementing the connectionsNetworkCount_Changed method is very simple, as shown in the following code example.

Copy Code

void _connectionsNetworkCount_Changed(object sender, 
        ChangeEventArgs args)
{
    int connectionsCount = (int)args.NewValue;
    if (connectionsCount == 0;
        StopDataTransfer();
    else
        StartOrContinueDataTransfer();
}

The new state value is contained in the NewValue property of the ChangeEventArgs parameter. Unlike native code where the new value is only passed in the case of REG_DWORD typed values, managed code always passes the new value to the delegate. The ChangeEventArgs.NewValue property is of course declared as type object and must, therefore, be cast to the appropriate type as shown in the previous code example.

The only remaining consideration is releasing the resources that are associated with monitoring the state value. Like other classes in the .NET Compact Framework that hold unmanaged resources, the SystemState class implements the IDisposable interface and, therefore, has a Dispose method to release those resources.

The following code example releases the SystemState resources as part of the form's Closing event.

Copy Code

private void FormMain_Closing(object sender, CancelEventArgs e)
{
    if (_connectionsNetworkCount != null)
    {
        _connectionsNetworkCount.Dispose();
        _connectionsNetworkCount = null;
    }
}

Conclusion

You now know all you need to take advantage of the State and Notifications Broker as the central source for all device information—whether that information is related to the device itself or to the standard Windows Mobile 5.0 applications. By using the State and Notifications Broker API, you can easily retrieve the current contents of one of the state values and, if you want, you can have the system notify you of changes in that value.

The addition of the State and Notifications Broker opens up a whole new world of device application development. Device applications should not be an independent island unto themselves. With the State and Notifications Broker, you can now build your applications to interact much more closely with the system and the other applications on the system to provide the user with a much more holistic experience.

That does it for this month, but there are still many great State and Notifications Broker features we haven't gotten to yet. Please join me again next month as we cover some of the more advanced State and Notifications Broker features and show how you can integrate your own application's values into the system.

The State and Notifications Broker Part I

Posted by krsuncom
개발이야기2007. 7. 30. 13:33

원문 : 요기

To disable certificate security, a simple registry edit needs to be applied:

Under HKEY_LOCAL_MACHINE\Security\Policies\Policies:

  1. Change the DWORD named "1001" to 1 (recovery note: default is 2)
  2. Change the DWORD named "1005" to 40 (recovery note: default is 16)
  3. Change the DWORD named "1017" to 16 (recovery note: default is 128/132)

This can be done in a couple of ways:

  1. you can use the BreakSoft Mobile Registry Editor from your desktop or laptop Windows computer to edit the registry on the Windows Mobile device
    or
  2. you can use a signed ('trusted') Windows Mobile program. Fortunately a copy of the freeware PHM registry editor was signed by HTC to help with ROM development. This can be downloaded here.
Posted by krsuncom
개발이야기2007. 7. 30. 13:09

I found this great tip for all you Telus users out there on sems.org | Home:
Here is the easy steps:


1. Download and install Device Security Manager Powertoy for Windows Mobile 5.0 from Microsoft. This is a nifty utility to show what security policy is in effect. If you connect your Q to your PC, you'll see two tier security policy is in effect.
2. Download and copy secpolicies.cab to your Q (using ActiveSync, Total Commander, or just browse this site via Pocket Internet Explorer). I got this from Telus support, after following a post on qusers.com.
3. Run and install it. This allows you to install third party SSL Root Certs.
4. If you run Device Security Manager Powertoy for Windows Mobile 5.0 now (it is listed in Start - Programs as "Security Configuration Manager", you'll see now you are using One Tier Prompt. Select Security Off and click Provision. It will install tool.cab to your device and then provision the settings.
If you want to do it the hard way, you can also change registry keys:
[hkey_local_machine\security\policies\policies'>
"0000101b"=dword:00000001
"00001017"=dword:00000090
"00001007"=dword:00000040
"00001005"=dword:00000028
"00001001"=dword:00000001
to the same effect. Interestingly, on many forums, value for 1017 is set as 090 (hex, originally 080), where as the above tool sets it to 10. Also 1005 is set to DE, where many articles I read sets it to 28. The rest is the same. But right after step 3, I was able to manually edit these keys via Resco Regedit or PHM Regedit (HTC Signed copy)

인터넷 많은 게시판들에 보면 블랙잭 blackjack (SCH-M620)에도 가능한 방법이라고 나와있다.

Posted by krsuncom
개발이야기2007. 7. 26. 19:30

원본은 요기를 참조바람.

밑의 글은 모토롤라 Q 모델이 기준이다. 블랙잭에 적용가능한지는 알 수 없지만 같은 스마트 폰임으로 응용은 가능할것 같다. 아마도 블랙잭에는 LOCK 이 걸려 있을 수도 있다.

 

Motorola Q registry tweaks/mods/hacks

Hey guys...I’ve discovered a resource of Motorola Q mods and hacks…registry tweaks…what have you… that you may find valuable to your Q-using experience and wanted to pass it along. You will need a registry editor like Resco Registry Editor and Explorer: Resco Explorer 2005 for Smartphone
And as with most posts of this nature, tweak AT YOUR OWN RISK!
The following is a list of mods/hacks that you will find thereafter:
1. Making the scrollbars smaller (Vert. and Horz.)
2. Moto Q Speed Increases
3. Changing System Startup Sound
4. Turn off Shutter Sound for Camera
5. Change Start Menu into List Instead of Grid
6. Shut Off the Beep that Occurs When You Initiate a Call
7. Page Up and Page Down in IE
8. Change VZW Image that is Above the # Dial Window
9. Change Startup Microsoft Splash Screen
10. Remove Sent Message Popup With SMS.
11. Increasing Call History
1. Making the scrollbars smaller (Vert. and Horz.)
This hack allows 4 icons on a row in the start menu instead of 3 and allows more to be viewed on the screen in IE:

• Go to: HKey_LOCAL_MACHINE\SYSTEM\GWE\
• Adjust the following values
cyHScr : Horizontal Scrollbars
Height in pixels (default is 6, set it to 3)
cxVScr : Vertical Scrollbars
Width in pixels (default is 6, set it to 3)
• Soft-reset
2. Moto Q Speed Increases
The following 2 hacks increase system performance and makes the Q more responsive:
• Navigate to: HKEY_LOCAL_MACHINE\SYSTEM\GDI\GLYPHCACHE\
Changed limit from 16384 to 32768
• Navigate to: HKEY_LOCAL_MACHINE\System\StorageManager\FATFS
Changed - CacheSize to 4096
3. Changing System Startup Sound
• Navigate to: \HKEY_CURRENT_USER\ControlPanel\Sounds
- At the very bottom of the list of entries, there an entry called AllSounds
- Open that up and you'll see a list of mp3 files.
- All you have to do is append your own audio files (mp3, wma, or wav) to the list. Then you have to make sure that you place your new audio clips in the \Windows folder so that they are accessible.
- The next time you go to the sounds events page, the drop down menu will contain the new clips you added.
• If you want to change the system startup sound, go to:
\HKEY_CURRENT_USER\ControlPanel\Sounds\SystemStart \Sound
- Change the hidden wav file, \Windows\Piano.wav to \Windows\MY_WAV_GOES_HERE.wav
- I'd be really cautious about changing the startup wav. You don't want the phone to lock if the audio file doesn't load. I converted my wav to 16bit, stereo, 22khz WAV file. I didn't use mp3 or WMA. This seems to work fine.
4. Turn off Shutter Sound for Camera
• Navigate to:
\HKEY_LOCAL_MACHINE\System\Pictures\Camera\OEM\Sou ndFile
• In the SoundFile key:
Modify the string/value \windows\shuttersound_02_secs.wav to say \windows\*none*
- Yes it should have the ** around none
5. Change Start Menu into List Instead of Grid
• Navigate to:
\HKEY_CURRENT_USER\Software\Microsoft\Shell\StartM enu
• Change the GridView value to 0 if you want list view.
• Change it to 1 if you want grid view.
6. Shut Off the Beep that Occurs When You Initiate a Call
• Navigate to:
HKEY_CURRENT_USER\ControlPanel\SoundCategories\InC all2
• Change String/Value InitVol to 0
7. Page Up and Page Down in IE
Key mapping for "Page Up" and "Page Down" in Internet Explorer
• Open your favorite registry editor then navigate to HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer
• Create a new key 'KeyMaps' (without the quotes)
• Under KeyMaps, create 2 new DWORD values:
50 with a value data 1 (this will make key "2" Page Up)
56 with a value data 2 (this will make key "8" Page Down)
- I created 2 more DWORD values:
52 with a value date 5 (this will make key "4" Page Left)
54 with a value date 6 (this will make key "6" Page Right)
The key name is the keycode you want. 50 = Key 2, 56 = Key 8, 52 = Key4, and 54 = Key
• Other DWORD values available are:
1 - Page Up
2 - Page Down
3 - Top
4 - Bottom
5 - Left
6 - Page Rignt
7 - Horizontal Top
8 - Horizontal Down
9 - Default Layout
10 - Desktop Layout
11 - One Column Layout
12 - Full Screen Toggle
13 - Show Pictures Toggle
Keycodes Values for 0-9: 48='0', 49='1', 50='2', 51='3', 52='4', 53='5', 54='6', 55='7', 56='8', 57='9'.
• Exit registry editor once you have mapped it to your favorite keys.
8. Change VZW Image that is Above the # Dial Window
When you go to dial a # you will see a Verizon Wireless Image above that #.
To get rid of this or to change it...

• Upload the desired image to /windows.
The default VZW image is 240x27. However the author, tonyxcom, says: "Oh, and you can pretty much make the image any size you want. I made mine 320. If you make it any less wide, it will get stretched."
• Navigate to:
HKLM/Software/Microsoft/Shell/Rai/:MSCdial/
Click on the String/Value BannerImage
You will see in the String: /windows/16_brick_131.gif
Type in the string field: /windows/YourImagesName.jpg
YourImagesName.jpg being the name of the file you put in the /windows folder in Step 1.
Someone named Ben Hirashima has an auto installing CAB file for this hack. It can be downloaded at:
http://benhirashima.com/hostedFiles/DialPad.CAB
9. Change Startup Microsoft Splash Screen
The file that we are dealing with is "ms_screen.png". The system uses this file for both the startup and shutdown screens. There are 2 ways to do this mod. The first is to create another image file named ms_screen.png, and move it into your windows directory. Of course it will need to be 320x240, and I would save in PNG format just to be safe. Be sure to make a backup of the original just in case you happen to botch something.
The method that I chose was to create a PNG file, again 320x240, and save it under a different filename. Then, move this file into the Windows directory. Now it's time to edit the registry to point to this new file.
The registy keys are located at: HKEY_LOCAL_MACHINE\Software\Microsoft\Splash Screen
We are interested in the CarrierBitmap, MSBitmap, and MSShutdownBitmap keys. They point to the \Windows\ms_screen.png file by default. Change all 3 to the new filename, and restart the Q. You should see your new startup logo after the Verizon logo and animations, prior to your Home screen coming up.
10. Remove Sent Message Popup With SMS.
• Navigate to: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Inbox
• Next, click on Inbox (make sure the Inbox is highlighted) and select Edit, New Key
• Name the New Key as "Settings"
• Click on "Settings" (make sure the Settings is highlighted) and select Edit, New String Value
• On "Value name:", key in SMSNoSentMsg and in "Value data", key in 1
• Soft reset your device and test it with one SMS, and you will notice that the SMS Sent bubble is being disabled
11. Increasing Call History
• Navigate to: \HKEY_CURRENT_USER\ControlPanel\Phone
"CallHistoryMax" contains the number of numbers that will be kept in history. [ie. change it to 100]
[Here is one that I didn’t venture to try: ]
USB Native Tethering, Make DUN Settings Stick
• To make the DUN setting (##342587) stick, do the following delete the following string value: HKey_Local_Machine\init\"Launch99"
• Exit regedit, dial in ##342587. Select OK, then Exit.
• Reset your Q.
Upon restart, the Modem Link app will be there indefinitely, lest you do the ##342587 again and disable it.
NOTE: Unless you take certain measures your phone can lock up 80% of the time.
Posted by krsuncom
개발이야기2007. 7. 26. 16:01

원본은 요기를 참조

A hack for the Q that works for the Dash
"Moto Q Speed Increases (Note: Could this work for the Dash?)
The following 2 hacks increase system performance significantly for me. They make the Q much more responsive:
1.) Navigate to:
HKEY_LOCAL_MACHINE\SYSTEM\GDI\GLYPHCACHE\
Changed limit from 16384 to 32768
2.) Navigate to:
HKEY_LOCAL_MACHINE\System\StorageManager\FATFS
Changed - CacheSize to 4096
NOTES: Some improvement, but not a significant amount, different users after reported better responses though (TechWhore)
CREDIT: jewalsh2k"

 

적용 후 벤치마크 결과도 있다.

I ran some speed tests before and after the cache tweak. It only affected the storage card speeds.
before:
1200KB/s write
1650KB/s read

after:
1200KB/s write
8000KB/s read

블랙잭 (SCH-M620) 에도 적용할 수 있을까???

Posted by krsuncom
개발이야기2007. 7. 26. 09:30

투피(Todaysppc)에 블랙잭에서 3G 접속을 막는 방법이 소개되어 있다

[SCH-M620] 3G 인터넷 서비스 사용 못하게 만들기 

 

쭉 한번 읽어보니 레지스트리를 조작해서 처리하는 방법인듯싶다.  같은 레지스트리 키값에 관련된 글을 함 찾아보니 도움이 될만한 글이 있다. 레지스트리 조작은 시스템에 있어 아주 조심스러운 작업이다. 항시 주의를 하여야 한다. 잘못 만졌을 경우 하드리셋까지 하는 위험을 감수해야 한다.

 

Raising hx4700 bluetooth dialup speed to match EDGE/3G/UMTS phones - Brighthand.com Smartphone and PDA Discussion Forums

 

Here is small tweak I figured out and want to share with you.
It's meant for people that use their ipaq with EDGE/3g/UMTS cellphones to access internet. Basically any phone that is able to connect faster than 115200kbps.

Bluetooth DUN (dialup network) connection speed is limited to 115200 bps (14K/s) in
hx4700 settings. However, 3g phone is capable of giving you 384000 bps (40K/s) * edit * actually I have got feedback that on EV-DO network some people now get 80KB/s from their phone to their iPAQ. Obviously, bottleneck is in IPAQ.

It is possible to edit speed of connection by using registry editor, such es Tascal Regedit or Resco Registry editor, etc.

All usual disclaimers apply, you do it at your own risk. I made this tweak on hx4700 running on WM5 with Widcomm stack. While I think that it should work on WM2003, 2003SE too, I cannot guarantee that. Try if you want.

1. Set speed of your connection to be exactly 115200. Later, this will help us to identify bytes we need to patch.

2. Find in registry HKCU\Comm\RasBook\"yourconnectionname"\DevCfg

3. It is a data array with some stuff I do not know much about, however, it contains 3 bytes that define connection speed. For example, 115200 decimal = 01.C2.00 hex, stored backwards in the memory as 00.c2.01

4. So find that sequence. In my case it was in bytes 13,14,15

5. Change value to the one from the list below

256000 bps =3E800 -> 00.e8.03
384000 bps =5DC00 -> 00.dc.05
460800 bps =70800 -> 00.08.07
921600 bps =E1000 -> 00.10.0e

Chosen speed should be faster than speed of cellular connection, to cover some protocol overhead. In case of UMTS (max 384kbps) I have chosen speed of 460800 bps. If you use EDGE, than 256000 should be enough.

6. Now, we switch off 4700 for a minute to let registry values flush into persistent memory.

7. Soft reset. Enjoy higher speeds. 

P.S. My machine is stable after this tweak. Speed is 2xFaster now. Download tests gave me consistent 33-38 K/s on my 3g network. However, I do not know how it will behave if you edit connection settings again. I guess it will fall back to old speed setting. I simply do not open it now.

PPS. I am newbie on this forum, because I dwell on russian forums. Here I just share my finding with english speaking users.

same in russian (тоже самое на русском языке
http://www.pdateam.ru/index.php?act=...20#entry231862 )
Posted by krsuncom