OziExplorer API

(Application Programming Interface)

Its more of a controlling interface, the API provides methods for other programs to control many actions of OziExplorer.

The API uses a combination of Windows Messaging the Clipboard and Files to send and receive messages and data.

For the File interface to OziExplorer, parameters are placed in a file called message1.dat

Notes

Strings being sent to OziExplorer must be placed on the clipboard.
If there is more than 1 parameter in the string then a TAB (chr 9) is used to delimit the fields.

Message
Number
Action Parameters to OziExplorer Parameters from OziExplorer
1 Quit nil nil
10 Hide Toolbar nil nil
11 Show Toolbar nil nil
50 Get the Path of the OziExplorer EXE file nil From OziExplorer to Clipboard
Parameter - Exe Path as a String
60 Get the Map Datum from OziExplorer nil From OziExplorer to Clipboard
The Datum name
61 Get OziExplorer to translate a position from specified datum to another From clipboard to OziExplorer
Parameter 1 - From Datum (name)
Parameter 2 - To Datum (name)
Parameter 3 - Latitude
Parameter 4 - Longitude
The Datum names must be valid OziExplorer datum names, they are case sensitive as well.
From OziExplorer to Clipboard
The translated Lat,Lon
Parameter 1 - Latitude
Parameter 2 - Longitude
101 Load a Map From Clipboard to OziExplorer
Parameter - Full Path and name of Map file
nil
102 Save the Map From Clipboard to OziExplorer
Parameter - Full Path and name of Map file.
If name is empty then the map is saved using its current name.
If the name is not empty then the map is saved as the name.
nil
110 Load a Waypoint file From Clipboard to OziExplorer
Parameter - Full Path and name of Waypoint file
nil
111 Load a Waypoint file (from file) From File to OziExplorer
message1.dat
Parameter - Full Path and name of Waypoint file
nil
114 Clear Waypoints nil nil
120 Load a Track File From Clipboard to OziExplorer
Parameter 1 - Track Number
Parameter 2 - Full Path and name of Track File
nil
122 Clear all Tracks nil nil
124 Clear specified Track From Clipboard to OziExplorer
Parameter 1 - Track Number
nil
126 Change Track Color From Clipboard to OziExplorer
Parameter 1 - Track Number
Parameter 2 - Color Value
nil
160 Turn on map click - clicking on the map returns the pixel x, pixel y, latitude and longitude of the position clicked on the map nil From OziExplorer to Clipboard
The map click position

Parameter 1 - image pixel x
Parameter 2 - image pixel y
Parameter 3 - Latitude
Parameter 4 - Longitude

161 Turn off map click sending of position nil nil
Moving Map
201 Send Moving Map position from OziExplorer using a file.
(see also Message Number 205)
nil From OziExplorer to file message2.dat
Line 1 - latitude (position in WGS 84 datum)
Line 2 - longitude
Line 3 - speed (knots)
Line 4 - Heading
Line 5 - Magnetic Variation
Line 6 - Altitude (feet)
202 Get NMEA sentence from the Clipboard (see Message Number 212) From Clipboard to OziExplorer
Parameter 1 - The NMEA message.
RMC, GGA, GLL, VTG messages are processed in the same manner as those from the GPS.
nil
203 Get NMEA sentence from a File (see Message Number 213) From File (mmfile.dat) to OziExplorer
Line 1 - The NMEA message.
RMC, GGA, GLL, VTG messages are processed in the same manner as those from the GPS.
nil
205 Send Moving Map position from OziExplorer using the Clipboard nil From OziExplorer to clipboard
Parameter 1 - latitude (position in WGS 84 datum)
Parameter 2 - longitude
Parameter 3 - speed (knots)
Parameter 4 - Heading
Parameter 5 - Magnetic Variation
Parameter 6 - Altitude (feet)
       
210 Stop NMEA Communication nil nil
211 Start NMEA Communication nil nil
212 Start NMEA Communication but use the NMEA messages from the clipboard nil nil
213 Start NMEA Communication but use the NMEA messages from a file called mmfile.dat nil nil
220 Navigate to a Waypoint From Clipboard to OziExplorer
Parameter 1 - Waypoint Number
nil
225 Cancel Navigation nil nil
230 Create Marker Waypoint at GPS Position nil nil
       
Distance and Bearing
311 Distance and Bearing between 2 positions
From Clipboard to OziExplorer
Parameter 1 - latitude1
Parameter 2 - longitude 1
Parameter 3 - latitude 2
Parameter 4 - longitude 2
From OziExplorer to Clipboard

Parameter 1 - Distance in meters
Parameter 2 - Bearing in degrees

312 Distance and Bearing between GPS position and Waypoint (name) From Clipboard to OziExplorer
Parameter 1 - Name of waypoint

The waypoint must be loaded in OziExplorer.

From OziExplorer to Clipboard

Parameter 1 - Distance in meters
Parameter 2 - Bearing in degrees

313 Distance and bearing between 2 waypoints From Clipboard to OziExplorer
Parameter 1 - Name of 1st waypoint
Parameter 2 - Name of 2nd waypont

The waypoints must be loaded in OziExplorer.

From OziExplorer to Clipboard

Parameter 1 - Distance in meters
Parameter 2 - Bearing in degrees

314 Distance and Bearing between GPS position and Active waypoint (the waypoint being navigated to). nil From OziExplorer to Clipboard

Parameter 1 - Distance in meters
Parameter 2 - Bearing in degrees

       
Oedometers
350 Start Oedometer 1 nil nil
351 Stop Oedometer 1 nil nil
352 Reset Oedometer 1 to zero nil nil
353 Set Oedometer 1 to a value Clipboard to OziExplorer
Parameter 1 - value in meters
nil
354 Oedometer 1 count up nil nil
355 Oedometer 1 count down nil nil
       
360 Start Oedometer 2 nil nil
361 Stop Oedometer 2 nil nil
362 Reset Oedometer 2 to zero nil nil
363 Set Oedometer 2 to a value Clipboard to OziExplorer
Parameter 1 - value in meters
nil
364 Oedometer 2 count up nil nil
365 Oedometer 2 count down nil nl
       
369 Read Oedometers 1 and 2 nil OziExplorer to clipboard
Parameter 1 - Oedometer 1 reading
Parameter 2 - Oedometer 2 reading
       

How does it Work

When OziExplorer starts it registers a windows message number with Windows, this allows OziExplorer to receive windows messages which are specifically for it.

OziMessage:=RegisterWindowMessage(pchar('OziExplorer'));
(Delphi code)

The controlling program registers the same message as it starts

OziMessage = RegisterWindowMessage("OziExplorer")
(VB code)

It doesn't matter which program registers the name first Windows will always return the same message number.

 

The controlling program needs to find the OziExplorer main window

(VB code)

Dim hwnd1 As Long
hwnd1 = FindWindow("TfmMainform", vbNullString)
If hwnd1 = 0 Then
   Showmessage ("Please Start OziExplorer")
   Exit Sub
End If

 

To get OziExplorer to perform an action a Windows message is sent

m1 is the message number from the table above

Sub Send2Ozi(m1, m2)
  Dim hwnd1 As Long
  Dim result As Boolean
  'OziMessage is a global variable
  ' This procedure sends a message to Ozi in the
  ' windows message queue
  hwnd1 = FindWindow("TfmMainform", vbNullString)
  result = PostMessage(hwnd1, OziMessage, m1, m2)
End Sub

 

This is a complete action
1. Put the required parameter in the clipboard
2. Send a message to OziExplorer to perform the action

(VB code)

The parameter(s) have been placed in string s

'clear the clipboard
Clipboard.Clear
'add CRLF to the end of the string
s = s & Chr(13) & Chr(10)
'put it on the clipboard
Clipboard.SetText s
'send the message to tell OziExplorer the clipboard is ready
Send2Ozi 202, 0