Feeds:
Posts
Comments

Archive for the ‘Programming’ Category

Ever wondered how contact application searches using all the character mapping of a key?When you press the “2” key it matches all the contacts 

with ‘a’,’b’ and ‘c’. If you want to have the same kind of functionality in your application then the magic lies in the following registry key:

HKEY_LOCAL_MACHINESecurityPhonePhoneKeyMatch
 “KeyboardMappings” = REG_SZ

This has the mappings for all the keys and there corresponding character values.

Read Full Post »

When trying to display notification ballon you must have observed that they are displayed at the bottom of the screen.Whereas applications like volume control,clock display it at the top of the screen.This is much more intutive and user freindly, especially in the scenario when you are displaying it in response to user clicking at your icon. You can also do the same :

In the SHNOTIFICATIONDATA structure give the following value to the clsid member:

{ 0x99de7411, 0x772f, 0x43d0, { 0x81, 0xf0, 0x66, 0x83, 0x36, 0xca,
0x65, 0x1b } }

Read Full Post »

Crating status bar windows is easy enough, you just need to use CreateStatusWindow function and you won’t forget to set WS_VISIBLE and WS_CHILD flag, would you?

When you are trying to set the background color of the status bar it’s easy again, if its simple, you just need to send SB_SETBKCOLOR message to status part. But the fun starts when you have set parts in your status bar. In this case parts would have the default color,so it would look as if border color has been setup.

To solve this issue you would need handle WM_DRAWITEM message in your WndProc. The lParam in this case is a pointer to LPDRAWITEMSTRUCT.

Eg.: code inside WM_DRAWITEM

LPDRAWITEMSTRUCT lpDrawStruct;

HBRUSH hBrush;

lpdis= (LPDRAWITEMSTRUCT) lParam;

hBrush=CreateSolidBrush(RGB(255,0,0));

FillRect(lpDrawStruct->hDC, &lpDrawStruct->rcItem, hBrush);

Read Full Post »

Recently I was trying to extend the menu of the Phone context in windows mobile 6 device.We hit a strange problem.As long as we were inserting Menu it was fine,but when we tried to insert Sub menu, all the main menu items were automatically inserted in the Submenu. E.g. If main Menu has a menu item “Create Note” the same menu item would reappear in the submenu. And what was really weird was that when you click on that it would launch the Note application. After lot of head scratching we couldn’t solve it. We later came to know that it is a bug and has been solved in Windows Mobile 6 AKU 0.3.

So guys if you hit this issue, please don’t scratch your head 🙂

Read Full Post »

Came across these interesting links for white-papers on Security on Windows Mobile.

1.Security considerations for Windows Mobile Messaging in the Enterprise: This white-paper covers the security consideration on the device,Security considerations within the corporate network and Security considerations on the network.

2.Security Model for Windows Mobile 5 and Windows Mobile 6: This white-paper deals with provisioning and managing windows mobile 5/6 device.

Read Full Post »

Came across this interesting link today. Channel 9 guys have created a wiki for the Wince base port development. I am sure this would be welcomed whole heartedly by whole lot of BSP developers,since there are only a couple of books that I know of of Windows Ce BSP development,and they are quite old.

This should be fun to follow,here is the link:

Big Book of BSP

Read Full Post »

Windows Mobile 6 SDK comes with a real kool tool called “Cellular Emulator”.Check it out if havent already.It lets you simulate a 2G and 3G network on an emulator.You can also send sms from cellular emulator to wm6 device emulator and vice versa. It also supports making phone calls,making it realy helpful tool when you are developing application which would use these features.Eg. An application to intercept incoming call notifications or SMS notifications.

It is realy easy to setup also.

  1. Run Cellular Emulator on desktop PC. Check the status bar for the COM port. eg. it displayes COM3 in mine.
  2. Run the Windows Mobile 6 emulator.
  3. In the emulator go to File->Configure->Peripherals-> in the serial port 0,give the COM port as what is shown in the status bar of Cellular Emulator. For.eg. COM3
  4. Perform soft reset of emulator

You are ready to rock and roll 🙂

Read Full Post »

Very often there is a requirement that we should find out when an Windows Mobile device has connected with a PC.I know that I had one :-).

There are 3 ways,that I know of,using which we can achieve this objective.

1.First approach is registry based.There are two predefined events “AutoStartOnConnect” and “AutoStartOnDisconnect”. Both of these have associated registry key namely [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows CE Services\AutoStartOnConnect] and [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows CE Services\AutoStartOnDisconnect]. You add an entry here which would enable your application to be executed when these events occur. To do this you simple need to add a new string value and data would be path and name of your application and command-line if any. e.g. MyApplication – “C:\Myapplication.exe”

2. Second approach is COM based. This needs more work but you are also rewarded with more functionality :-).

Two COM interfaces are used to register an application for the notification.IDccMan and IDccManSink. Of these IDccMan is implemented by Active sync connection manager so as an application developer you just need to implement IDccMan.(Note: there is another interface IDccManSink2 which extends IDccMan and provides support for IPv6). (more…)

Read Full Post »

Connection manager on Windows Mobile which exposes an api ConnMgrQueryDetailedStatus.This api can be used to query all the avaialble connections on the device. Following code snippet shows how:

//Variable Declaration

CONNMGR_CONNECTION_DETAILED_STATUS  *pConnMgrDet;HRESULT hResult; DWORD dwBufferSize=0;//Code Snippet

hResult=ConnMgrQueryDetailedStatus(pConnMgrDet,&dwBufferSize); (more…)

Read Full Post »

Wap configuration file and DMProcessConfigXML () can be used for retrieving existing GPRS settings on the device. This can be useful when you want to verify if the connection you added/removed was successfully installed or even for simply getting information regarding the existing connections. Following peice of code retreives the settings and stores it in a xml file.

//Declare the variables

LPCWSTR g_wszGPRSXml;

FILE *pXmlFile;

LPWSTR wszOutputXML = NULL;

 HRESULT hResult; (more…)

Read Full Post »

Older Posts »