Communicating with ArcPad from ArcPad Studio
Sending a script or external event to ArcPad from an external application requires getting ArcPad's window handle and using the SendMessage or PostMessage Windows application programming interfaces (APIs) to send scripts or external events, respectively.
ArcPad Studio provides a means to test how scripts and external events sent to ArcPad from an external program will behave.
The following tasks show the workflow for communicating with ArcPad from ArcPad Studio.
Starting ArcPad from ArcPad Studio
Steps:
- Start ArcPad Studio.
- Click the Start ArcPad button.The first time you click the Start ArcPad button, the Locate ArcPad program file dialog box appears. Navigate to the folder containing ArcPad.exe, select it, and click Open. You can also specify the location of ArcPad.exe on the General page of the Preferences dialog box.
Getting ArcPad's window handle
Steps:
- Start ArcPad Studio.
- Start ArcPad.
- Click the ArcPad menu and click Find ArcPad Window.
Sending a script to ArcPad
Steps:
- Start ArcPad Studio.
- Start ArcPad.
- Click the ArcPad menu and click Send Script.
- Type a script in the Script dialog box.
- Click OK.
Sending an external event to ArcPad
Steps:
- Start ArcPad Studio.
- Start ArcPad.
- Click the ArcPad menu and click Send ExEvent.
- Type or choose an ExEvent ID in the ID text box.
- Click OK.
Note:
You need to have a default configuration or applet loaded into ArcPad with an event handler for the OnExEvent event to confirm that this event was received by ArcPad. See the following code example:
<?xml version="1.0" encoding="UTF-8"?> <ArcPad> <APPLET> <SYSTEMOBJECTS> <APPLICATION onexevent="Call ExtEvent"/> </SYSTEMOBJECTS> </APPLET> <SCRIPT src="ExtEventHandler.vbs"/> </ArcPad>
2/7/2013