Windows Vista Tips

Windows Vista Tips > Newsgroups > ActiveSync > Run Pocket PC 2003 aplication After Active Sync Connection set

Reply
Thread Tools Display Modes

Run Pocket PC 2003 aplication After Active Sync Connection set

 
 
Hassan Wasel
Guest
Posts: n/a

 
      09-15-2004
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
 
Reply With Quote
 
 
 
 
Peter Foot [MVP]
Guest
Posts: n/a

 
      09-15-2004
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



 
Reply With Quote
 
Hassan Wasel
Guest
Posts: n/a

 
      09-15-2004
Peter Foot [MVP] wrote:
> 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
>


Thanks for your fast reply.
But even when I try NOTIFICATION_EVENT_NET_CONNECT, without checking the
host name, It didn't work when I put the PDA in the cradle, the
calculator didn't work.

Hassan

// 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\\Calc.exe"),NOTIFICA TION_EVENT_NET_CONNECT);
}

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ipaq 6945 Pocket Pc Connection Sync Issues buyslake Windows Vista Administration 0 02-26-2007 07:07 PM
Outlook 2003, XP and Active Sync Bob ActiveSync 6 09-01-2004 07:55 PM
Re: iPAQ sync to Exchange 2003 with ActiveSync Raj Pillai ActiveSync 0 08-12-2004 07:10 AM
Active Sync with Exchange 2003 Graham ActiveSync 1 08-06-2004 09:59 AM
can not get active sync working on my pocket pc after low batteries Johan @ pandora.Be ActiveSync 1 07-05-2004 02:50 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59