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:
  1. Start ArcPad Studio.
  2. Click the Start ArcPad buttonStart 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:
  1. Start ArcPad Studio.
  2. Start ArcPad.
  3. Click the ArcPad menu and click Find ArcPad Window.

Sending a script to ArcPad

Steps:
  1. Start ArcPad Studio.
  2. Start ArcPad.
  3. Click the ArcPad menu and click Send Script.
  4. Type a script in the Script dialog box.
  5. Click OK.

Sending an external event to ArcPad

Steps:
  1. Start ArcPad Studio.
  2. Start ArcPad.
  3. Click the ArcPad menu and click Send ExEvent.
  4. Type or choose an ExEvent ID in the ID text box.
  5. Click OK.

NoteNote:

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