Windows Mobile Development Forum
 
By making a donation,
you are helping us improve this forum.
Blueinput
Universal Bluetooth Mouse and Keyboard driver for Pocket PC

Fingertouch PRO
Software keyboard supporting multiple languages (English, French, German, Greek, Italian, Portuguese, Russian, Spanish) and the fT9 engine for fast text input

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Detect Active Sync connection on WM 5 devices

 
Post new topic   Reply to topic    www.teksoftco.com Forum Index -> Developers

Top Pocket PC and Smartphone products


Glyphs - Winner 2009



CapturePRO



BlueMusic



BlueInput



With USBInput you can use an USB Mouse or Keyboard on Pocket PC.

View previous topic :: View next topic  
Author Message
Raul Tinca
TEK-Giant
TEK-Giant


Joined: 06 Apr 2006
Posts: 272

PostPosted: Tue Jun 20, 2006 4:00 pm    Post subject: Detect Active Sync connection on WM 5 devices Reply with quote

On 2005 devices the RAS API doesn't help too much... but there is a key in the registry that is updated by the OS in case if an AS connection:

Registry key:
HKEY_LOCAL_MACHINE \ System\State\Hardware key:Cradled

Here is a short code to help you read this key programatically:

bool bisActiveSyncConnected()
{
HKEY hKey;
DWORD dwTip, dwPos;
DWORD dwsize = sizeof(DWORD);
if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("System\\State\\Hardware"), 0, 0, &hKey) == ERROR_SUCCESS)
{
if (RegQueryValueEx(hKey, _T("Cradled"), 0, &dwTip, (LPBYTE)&dwPos, &dwsize)==ERROR_SUCCESS)
{
RegCloseKey(hKey);
return (dwPos>0);
}
else return 0;
}
return 0;
}

You can also register for notifications related to changes on this key value. Wink
Back to top
View user's profile Send private message Send e-mail MSN Messenger
dr.ppc
TEK-Newbie
TEK-Newbie


Joined: 16 Jan 2007
Posts: 1

PostPosted: Tue Jan 16, 2007 11:01 am    Post subject: Reply with quote

Hi,

What do you mean "You can also register for notifications related to changes on this key value. "

Could you please point me how to to that? You mean to automatically monitor the change of registry (key value)?

Thanks & best wishes,

dr.ppc
Back to top
View user's profile Send private message
Raul Tinca
TEK-Giant
TEK-Giant


Joined: 06 Apr 2006
Posts: 272

PostPosted: Tue Jan 16, 2007 4:28 pm    Post subject: Reply with quote

The following table shows the registry notification functions with a description of the purpose of each.

CeFindCloseRegChange This function stops change notification handle monitoring.
CeFindFirstRegChange This function creates a change notification handle and sets up initial change notification filter conditions. A wait on a notification handle succeeds when a change matching the filter conditions occurs in the specified registry key, or subkeys.
CeFindNextRegChange This function requests that the operating system signal a change notification handle the next time it detects an appropriate change.

Cheers,
Raul
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Neo
Advisor


Joined: 04 Mar 2006
Posts: 1301

Post subject: Best choice for your Pocket PC!

I've heard it's possible to use a bluetooth Mouse with my PDA?
I've found some info here regarding Blueinput, did anyone test this?

Thanks!



Display posts from previous:   
Post new topic   Reply to topic    www.teksoftco.com Forum Index -> Developers All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2007 phpBB Group