IT 이야기2009. 5. 13. 19:07

요즘 스마트폰이 급격하게 보급되고 있습니다. 가격도 많이 내렸고 (공짜도 많음)

사용자 스스로 프로그램을 깔아서 쓸 수 있다는 매력과 일정관리 및 다양하게 쓸모가 있어서겠지요.

요즘은 외장 메모리 및 내장 메모리가 커서 이것저것 많이들 집어 넣고 다닙니다.

물론 사적인 정보들도 말이죠..

그런데. 분실했다면…  ????…

끔찍한 일이지만..누구에게나 일어날 수 있는 일입니다.

그런 우려를 타켓으로 (주)쏘몬에서 시큐어온모바일 (www.SecureOnMobile.com) 서비스를 시작했습니다.

현재 오픈베타로 진행되고 있습니다.

 

++Secure On Mobile++

 

서비스를 간단히 설면하면..

 

휴대폰(스마트폰)을 분실 했을 때 휴대폰의 개인정보를 타인이 볼 수 없도록

휴대폰을 잠그는 기능을 제공합니다.  방법은 스마트폰으로 전화나 SMS로 특정 신호를 전송해서 처리 합니다.

현재는 Windows Mobile 6.1 이상의 스마트폰중 일부를 지원하고 있습니다.

옴니아도 되네요..

 

현재는 라이트 버전이데 곧 부가적인 서비스들이 제공될 것으로 생각됩니다.

아주 참신한 서비스네요….

근데 외장메모리는…..???? 보안

Posted by krsuncom
IT 이야기2007. 9. 12. 14:26

전면 터치스크린 방식 바형 PDA폰. 윈도우 모바일 5.0 PPC 탑재,

멋진 휴대폰이나 PDA 라는 느낌을 전혀 주지 않는거 같다. 사진은 세티즌에서 긁은것임.



Posted by krsuncom
IT 이야기2007. 9. 11. 12:34

정답은  HP IPAQ510 이다. 국내는 셰계 최초경쟁에 목슴걸고 하는 회사들이 많은데 스마트폰이나 포켓피시폰 쪽에는 그런 경쟁을 안하나 보다.

참조:ZDNet Korea...스마트폰「윈도우 모바일 6」으로 갈아탄다…HP 아이팩 510 보이스 메신저

최초의 윈도우 모바일 6 스마트폰이 공개됐다.


그런데 제조업체가 다름 아닌 HP이다. 수시로 이메일을 확인해야 하고, 가끔은 이동 중에도 문서 작업을 해야 하는 모바일 전문가라면 이 제품이 딱이다.
HP 아이팩 510 보이스 메신저(iPaq 510 Voice Messenger)는 HP의 다른 스마트폰과 달리 음성 기능을 강화한 것으로 모바일 디바이스 라인업의 공백을 메운 제품. 사용이 편리한 포켓 PC폰과 스탠드얼론 PDA의 중간쯤에 해당한다.
컴팩트한 디자인으로 언뜻 보기에는 마치 휴대폰 같고, 제어 시스템도 당연히 터치 방식이다. 그러나 아이팩 510이 다른 제품과 달리 강화된 음성 명령과 자주 사용하는 프로그램에 대한 ‘바로가기 기능’을 갖고 있다는 점 때문에 이러한 디자인이 묻혀버릴 수도 있다는 점은 아쉽다.

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. 29. 13:45

 

Virtual-Key Codes

Send Feedback

The following table shows the symbolic constant names, hexadecimal values, and keyboard equivalents for the virtual-key codes used by the Microsoft Windows CE operating system. The codes are listed in numeric order. You can combine any of the codes with a modifier key to create a hot key.

Virtual key codes

Symbolic constant
Hexadecimal value
Mouse or keyboard equivalent

VK_LBUTTON
01
Left mouse button

VK_RBUTTON
02
Right mouse button

VK_CANCEL
03
Control-break processing

VK_MBUTTON
04
Middle mouse button on a three-button mouse

0507
Undefined

VK_BACK
08
BACKSPACE key

VK_TAB
09
TAB key

0A0B
Undefined

VK_CLEAR
0C
CLEAR key

VK_RETURN
0D
ENTER key

0E0F
Undefined

VK_SHIFT
10
SHIFT key

VK_CONTROL
11
CTRL key

VK_MENU
12
ALT key

VK_PAUSE
13
PAUSE key

VK_CAPITAL
14
CAPS LOCK key

1519
Reserved for Kanji systems

1A
Undefined

VK_ESCAPE
1B
ESC key

1C1F
Reserved for Kanji systems

VK_SPACE
20
SPACEBAR

VK_PRIOR
21
PAGE UP key

VK_NEXT
22
PAGE DOWN key

VK_END
23
END key

VK_HOME
24
HOME key

VK_LEFT
25
LEFT ARROW key

VK_UP
26
UP ARROW key

VK_RIGHT
27
RIGHT ARROW key

VK_DOWN
28
DOWN ARROW key

VK_SELECT
29
SELECT key

2A
Specific to original equipment manufacturer

VK_EXECUTE
2B
EXECUTE key

VK_SNAPSHOT
2C
PRINT SCREEN key

VK_INSERT
2D
INS key

VK_DELETE
2E
DEL key

VK_HELP
2F
HELP key

3A40
Undefined

VK_LWIN
5B
Left Windows key on a Microsoft Natural Keyboard

VK_RWIN
5C
Right Windows key on a Microsoft Natural Keyboard

VK_APPS
5D
Applications key on a Microsoft Natural Keyboard

5E5F
Undefined

VK_NUMPAD0
60
Numeric keypad 0 key

VK_NUMPAD1
61
Numeric keypad 1 key

VK_NUMPAD2
62
Numeric keypad 2 key

VK_NUMPAD3
63
Numeric keypad 3 key

VK_NUMPAD4
64
Numeric keypad 4 key

VK_NUMPAD5
65
Numeric keypad 5 key

VK_NUMPAD6
66
Numeric keypad 6 key

VK_NUMPAD7
67
Numeric keypad 7 key

VK_NUMPAD8
68
Numeric keypad 8 key

VK_NUMPAD9
69
Numeric keypad 9 key

VK_MULTIPLY
6A
Multiply key

VK_ADD
6B
Add key

VK_SEPARATOR
6C
Separator key

VK_SUBTRACT
6D
Subtract key

VK_DECIMAL
6E
Decimal key

VK_DIVIDE
6F
Divide key

VK_F1
70
F1 key

VK_F2
71
F2 key

VK_F3
72
F3 key

VK_F4
73
F4 key

VK_F5
74
F5 key

VK_F6
75
F6 key

VK_F7
76
F7 key

VK_F8
77
F8 key

VK_F9
78
F9 key

VK_F10
79
F10 key

VK_F11
7A
F11 key

VK_F12
7B
F12 key

VK_F13
7C
F13 key

VK_F14
7D
F14 key

VK_F15
7E
F15 key

VK_F16
7F
F16 key

VK_F17
80H
F17 key

VK_F18
81H
F18 key

VK_F19
82H
F19 key

VK_F20
83H
F20 key

VK_F21
84H
F21 key

VK_F22
85H
F22 key

(PPC only) Key used to lock device.

VK_F23
86H
F23 key

VK_F24
87H
F24 key

888F
Unassigned

VK_NUMLOCK
90
NUM LOCK key

VK_SCROLL
91
SCROLL LOCK key

VK_LSHIFT
0xA0
Left SHIFT

VK_RSHIFT
0xA1
Right SHIFT

VK_LCONTROL
0xA2
Left CTRL

VK_RCONTROL
0xA3
Right CTRL

VK_LMENU
0xA4
Left ALT

VK_RMENU
0xA5
Right ALT

BA-C0
Specific to original equipment manufacturer; reserved. See following tables.

C1-DA
Unassigned

DB-E2
Specific to original equipment manufacturer; reserved. See following tables.

E3 – E4
Specific to original equipment manufacturer

E5
Unassigned

E6
Specific to original equipment manufacturer

VK_PACKET
E7
Used to pass Unicode characters as if they were keystrokes. If VK_PACKET is used with SendInput, then the Unicode character to be delivered should be placed into the lower 16 bits of the scan code. If a keyboard message is removed from the message queue and the virtual key is VK_PACKET, then the Unicode character will be the upper 16 bits of the lparam.

E8
Unassigned

E9-F5
Specific to original equipment manufacturer

VK_ATTN
F6
ATTN key

VK_CRSEL
F7
CRSEL key

VK_EXSEL
F8
EXSEL key

VK_EREOF
F9
Erase EOF key

VK_PLAY
FA
PLAY key

VK_ZOOM
FB
ZOOM key

VK_NONAME
FC
Reserved for future use

VK_PA1
FD
PA1 key

VK_OEM_CLEAR
FE
CLEAR key

VK_KEYLOCK
F22
Key used to lock device

Original equipment manufacturers should make special note of the VK key ranges reserved for specific original equipment manufacturer use: 2A, DBE4, E6, and E9F5.

In addition to the VK key assignments in the previous table, Microsoft has assigned the following specific original equipment manufacturer VK keys.

Symbolic constant
Hexadecimal value
Mouse or keyboard equivalent

VK_OEM_SCROLL
0x91
None

VK_OEM_1
0xBA
";:" for US

VK_OEM_PLUS
0xBB
"+" any country/region

VK_OEM_COMMA
0xBC
"," any country/region

VK_OEM_MINUS
0xBD
"-" any country/region

VK_OEM_PERIOD
0xBE
"." any country/region

VK_OEM_2
0xBF
"/?" for US

VK_OEM_3
0xC0
"`~" for US

VK_OEM_4
0xDB
"[{" for US

VK_OEM_5
0xDC
"\|" for US

VK_OEM_6
0xDD
"]}" for US

VK_OEM_7
0xDE
"'"" for US

VK_OEM_8
0xDF
None

VK_OEM_AX
0xE1
AX key on Japanese AX keyboard

VK_OEM_102
0xE2
"<>" or "\|" on RT 102-key keyboard

For East Asian Input Method Editors (IMEs) the following additional virtual keyboard definitions must be observed.

Symbolic constant
Hexadecimal value
Description

VK_DBE_ALPHANUMERIC
0x0f0
Changes the mode to alphanumeric.

VK_DBE_KATAKANA
0x0f1
Changes the mode to Katakana.

VK_DBE_HIRAGANA
0x0f2
Changes the mode to Hiragana.

VK_DBE_SBCSCHAR
0x0f3
Changes the mode to single-byte characters.

VK_DBE_DBCSCHAR
0x0f4
Changes the mode to double-byte characters.

VK_DBE_ROMAN
0x0f5
Changes the mode to Roman characters.

VK_DBE_NOROMAN
0x0f6
Changes the mode to non-Roman characters.

VK_DBE_ENTERWORDREGISTERMODE
0x0f7
Activates the word registration dialog box.

VK_DBE_ENTERIMECONFIGMODE
0x0f8
Activates a dialog box for setting up an IME environment.

VK_DBE_FLUSHSTRING
0x0f9
Deletes the undetermined string without determining it.

VK_DBE_CODEINPUT
0x0fa
Changes the mode to code input.

VK_DBE_NOCODEINPUT
0x0fb
Changes the mode to no-code input.

Original equipment manufacturers should not use the unassigned portions of the VK mapping tables. Microsoft will assign these values in the future. If manufacturers require additional VK mappings, they should reuse some of the current manufacturer-specific and vendor-specific assignments.

See Also

Using Virtual-Key Codes | Manufacturer-specific Virtual-Key Codes

Virtual-Key Codes

Posted by krsuncom
개발이야기2007. 8. 18. 09:51

원문:Download details: Windows Mobile Developer Power Toys

 

Windows Mobile Developer Power Toys

Brief Description

Developer Power Toys for the Windows Mobile platform

On This Page

Quick Details

Overview

System Requirements

Instructions

Related Resources

What Others Are Downloading

Download files below

Quick Details

Version:
12Dec2006

Date Published:
9/18/2003

Language:
English

Download Size:
1.2 MB - 19.7 MB*

*Download size depends on selected download components.

Overview

The Windows Mobile Developer Power Toys help you develop and test your Windows Mobile applications. N.B. These Power Toys are NOT supported..
The Power Toys include:

  • Emulator ActiveSync Connection Tool - Allows Activesync to connect to your Emulator session from Visual Studio .NET 2003.
  • ActiveSync Remote Display - Display Pocket PC applications on your desktop or laptop without needing any device side configuration.
  • CECopy - Command line tool for copying files to the device currently connected to desktop ActiveSync.
  • Convert PPC DAT to SP XML - Command line tool for generating Smartphone CABWizSP XML docs from existing Pocket PC CAB files.
  • Hopper - User input stress simulator.
  • JShell - UI version of the Platform Builder Target Control Window.
  • PPC Command Shell - Command shell for the Pocket PC 2003 device.
  • RAPI Debug - Displays detailed information about currently running processes.
  • RAPI Start - Command line tool to remotely start an application on your Pocket PC from your desktop.
  • TypeIt - Send characters/strings to the Smartphone 2003 Emulator via ActiveSync.

Top of page

System Requirements
  • Supported Operating Systems: Windows 2000 Service Pack 3; Windows Server 2003; Windows XP
  • Windows Mobile 2003 based Pocket PCs
  • Windows Mobile 2003 based Smartphones
  • Windows Mobile 2002 based Pocket PCs
  • Windows Mobile 2002 based Smartphones

Not all tools are supported on all listed platforms.

Top of page

Instructions

There are two packages to download. The Emulator Activesync Connection Tool comes as one package. The remaining tools come in a second package.
Emulator Activesync Connection Tool

  1. Start Visual Studio .NET 2003.
  2. Click "Connect Emulator with ActiveSync" on the Tools menu.
  3. From the "Connect Emulator with ActiveSync" dialog, select an Emulator image from
    the dropdown list.
  4. Ensure the selected emulator is not running yet.
  5. Click the Connect button. The emulator will be started and an ActiveSync
    connection will be established with it.
  6. Once the connection is ready, it is OK to close the tool by clicking Exit
    from the menu.

Remaining Power Toys
All the other Power Toys are installed by the second installation package. A shortcut called Windows Mobile Developer Power Toys is created on the Start Menu which will allow you to access the Power Toys. The readme file for each toy explains how the Power Toy is used.

Top of page

Download details: Windows Mobile Developer Power Toys

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. 8. 20:50

 

투데이PPC

http://www.todayppc.co.kr
국내 최대 Pocket PC 사용자 커뮤니티

네스팟 스윙

http://www.nespot.com/web/swing
/swing_01.htm

네스팟 스윙 서비스 홈페이지

마이미츠


http://www.mymits.net
삼성전자 Mits 사용자 모임

프로포즈


http://www.propoz.co.kr
싸이버뱅크 POZ 사용자 모임 커뮤니티

네이트PDA


http://pda.nate.com
다양한 PDA 정보 공유 커뮤니티

넥사모

http://www.nexamo.net
삼성전자 넥시오 사용자 커뮤니티

세티즌


http://www.cetizen.com
휴대폰 및 모바일 단말기 커뮤니티

MissPDA


http://www.misspda.com
모바일 사용자 커뮤니티

PDA Bench


http://www.pdabench.com
모바일 및 디지털 장비 커뮤니티


HandandGo

PocketPC.com


PocketGear.com

MobiPocket


Pocket PC Magazine

Pen Computing


Gadgeteer

Unwired-I.Net


MedicalPocketPC.com

InfoSync


PDASquare

Windows Mobile – 커뮤니티

Posted by krsuncom
링크2007. 8. 8. 20:48

 

Windows Mobile 기반 Smartphone 관련 링크

관심 분야 여행

Windows Mobile 기반 Smartphone 사용자에게 멋진 다운로드에서부터 즉각적인 정보 액세스, 단말기 소프트웨어 및 업데이트에 이르는 모든 것을 제공하는 다양한 사이트에 방문해 보십시오. 아래 나열된 사이트는 Microsoft Corporation의 제휴 업체가 아닙니다.

사이트 항목

비즈니스 뉴스/금융

비즈니스 동향 및 월 스트리트와 연결하십시오.

엔터테인먼트

최신 엔터테인먼트 뉴스에서 동영상 게임 및 TV 시간표까지 모든 것을 찾아 보십시오.

게임

첨단 게임 사이트에 연결해 Windows Mobile(tm) 기반 Smartphone을 위한 새로운 게임을 확인하십시오.

정보 사이트: 디렉터리 서비스/날씨/여행

Windows Mobile(tm) 기반 Smartphone과 함께하면 날씨 확인, 차량 렌트, 식당 찾기 등과 같은 필요한 모든 작업을 이동 중에도 손쉽게 할 수 있습니다.

국제 Windows Mobile 커뮤니티 사이트

전세계 모든 Windows Mobile 사이트입니다.

모바일 상거래

비즈니스 및 상거래용 Windows Mobile(tm) 기반 Smartphone 응용 프로그램에 대해 자세히 배워 보십시오.

뉴스

전세계 권위 있는 발행물 및 서비스의 온라인 뉴스를 살펴 보십시오.

벨소리

다운로드할 수 있는 멋진 벨소리가 있는 사이트에 방문해 보십시오.

설치 및 개인 설정

Smartphone의 설치 및 개인 설정을 도와 줍니다.

소프트웨어

다음 사이트를 방문하여 Smartphone용 소프트웨어 및 업데이트를 다운로드하십시오.

Smartphone 애호가

Windows Mobile(tm) 기반 Smartphone 사용자들의 다양한 관심 항목을 다루고 있는 사이트를 확인하십시오.

Smartphone Thoughts for Windows Mobile
많은 사랑을 받고 있는 Windows Mobile용 Pocket PC Thoughts 사이트를 제작한 신뢰할 수 있는 소스에서 뉴스, 의견 및 포럼을 즐기십시오.
Modaco
가장 활동적인 영어 버전 Windows Mobile 기반 Smartphone 포럼에 가입하고 수많은 초기 화면과 벨소리도 다운로드하십시오.
Cool Smartphone for Windows Mobile
Windows Mobile 기반 Smartphone 뉴스가 가장 먼저 시작되는 유럽에서 최신 뉴스를 받아 보십시오.
PPCW.Net
Windows Mobile(tm) 기반 Smartphone 및 Pocket PC와 관련된 유용한 정보로 가득한 최신 사이트도 방문하십시오.
Smartphone Themes for Windows Mobile
멋진 소프트웨어를 다운로드하고 다른 사이트 리뷰에도 연결하십시오.
Mobway.com
소프트웨어, 벨소리 및 기타 다운로드 링크가 마련된 Windows Mobile(tm) 기반 Smartphone 애호가 사이트입니다.
기타 Windows Mobile 기반 Smartphone 애호가 사이트

Windows Mobile - Smartphone 커뮤니티: 관련 링크

Posted by krsuncom
블랙잭이야기2007. 8. 2. 12:57

서핑중 찾은 내용인데 AT&T는 블랙잭 및 기타  자사폰에 Windows Mobile 6 을 무료로 업그레이드 한다는 내용이다. SKT 나 KTF 는 이런 약속을 하면 안될까 ?  국내에서는 일어나지 않을 일 같다.

원본: AT&T Promises Free Windows Mobile 6 Upgrades for Treo 750, BlackJack, and 8525 
         Submitted by Ed Hardy on Friday, March 30, 2007

 

 

In the wake of Microsoft's announcement of Windows Mobile 6, many of those who have a Windows Mobile 5 device are very interested in when, or if, they will get an upgrade to the latest version of this operating system.

Windows Mobile

Those with some of AT&T's (formerly Cingular Wireless) most recent devices can stop wondering. A spokesperson for this carrier said today that the Samsung BlackJack, Cingular 8525, and Treo 750 will all be receiving upgrades to the latest version of this operating system.

And the owners of these smartphones should be very pleased to learn that their upgrade will come free of charge.

At this point, Cingular isn't willing to commit to any kind of specific timetable about when the upgrades will be available. The spokesperson would only say, "later this year".

The Other Side of the Coin

While this is good news for many AT&T subscribers, there's bad news for others.

At this point, Cingular has no plans to release operating system upgrades for some of its other Windows Mobile models, including the Cingular 8125 and 3125, both of which this carrier is currently offering.

What's Going to Change?

Naturally, because of hardware requirements, the BlackJack will get an upgrade to Windows Mobile 6 Standard, while the other two will get the Professional version. This will affect what new features they get.

One of the improvements in all versions of Windows Mobile 6 include the ability to display HTML-formatted email.

It will also sport improved versions of the Mobile Office applications, bringing them closer to their desktop equivalents. These will also offer support for the new file formats in Microsoft Office 2007.

For the first time, the version of this Mobile Office for non-touchscreen devices will allow users to edit, not just view, Office files.

In addition, Microsoft has fine tuned the look of the operating system.

Why Is This So Complicated?

Upgrades on cellular-wireless devices don't work like they do on PCs and laptops.

Microsoft develops the software, but before it goes to the user the wireless carriers must tweak it for each handheld or smartphone they offer, and field test it to be sure it doesn't cause any problems with their cellular-wireless networks.

The carrier then distributes the new version to its customers.

That's the ideal situation. In some cases, carriers decide that its not worth their time and money to do the development work and testing to offer an operating system upgrade, so they don't offer one.

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