The event NOTIFICATION_EVENT_SYNC_END is only triggered after a manually
triggered sync, not when your device automatically syncs on connection to
the PC. Therefore after the user clicks the Sync button in ActiveSync.
If you want to run a process on every connect to the desktop you'll find
NOTIFICATION_EVENT_NET_CONNECT more reliable, since it will be triggered at
the beginning of each connection, though you'll need to determine whether
the current connection is ActiveSync or another network connection such as
GPRS. If you try to resolve the hostname PPP_PEER this will indicate that
you are connected to activesync.
Peter
--
Peter Foot
Windows Embedded MVP
www.inthehand.com |
www.opennetcf.org
Do have an opinion on the effectiveness of Microsoft Windows Mobile and
Embedded newsgroups? Let us know!
https://www.windowsembeddedeval.com/...ity/newsgroups
"Hassan Wasel" <h-> wrote in message
news:...
> Hi Everybody,
> I want to run a PocketPC 2003 application at the end of Active Sync
> Connection. I wrote the following application to test this function
> CeRunAppAtEvent(). I got no application at the end of sync.
>
> // PDAClientRunSetter.cpp : Defines the entry point for the application.
> //
>
> #include "stdafx.h"
> #include <notify.h>
>
> int WINAPI WinMain( HINSTANCE hInstance,
> HINSTANCE hPrevInstance,
> LPTSTR lpCmdLine,
> int nCmdShow)
> {
> CeRunAppAtEvent(_T("\\Windows\\Calc.exe"),NOTIFICA TION_EVENT_NONE);
> return
> CeRunAppAtEvent(_T("\\Windows\\CloseAS.exe"),NOTIF ICATION_EVENT_SYNC_END);
>
> }
>
> Any comments will be highly apperiated.
>
> Thanks in advance.
>
> Hassan Wasel