Application.OpenDocument event
From Xojo Documentation
Event
The user has double-clicked on a document which this app is specified to open or the OpenDocument method was called.
Sample Code
This code loads the text of the supplied file into a TextArea on Window1: