Clarion
Opening Documents and Programs from inside your Clarion-program (Clarion 6.3)

If you want to display a WinWord.DOC or Excel.XLS from inside your Clarion-program, you can easily do by calling that file with the command ShellExecute. You do not have to know, where the other EXE is located. ShellExecute will automagically start the program that is associated with the called document. There is no need for you you to knopw, which MP3-player, what text-processor or spreadsheet-program is actually installed.

Your first step is to open Global Properties -> Embeds and insert this into your Global Map:

    Module('winapi')
        SHELLEXECUTE(Unsigned, *CString, *CString, *CString, *CString,Signed),Unsigned, Pascal, Raw, Proc,name('SHELLEXECUTEA'),proc
        GetDesktopWindow(), Unsigned, Pascal
    End

In After Global Includes I have added some some EQUATEs, which make it easier to read and understand, what some specific values are meant for. I will not list them here, please look them up in the source.

This is the actual call when the Button ?BtnOpenThatFile is pressed:

    Operation           = 'Open' 
    ListOfParameters 	= ''
    PathToFile          = '' 

    ShellExecute(GetDesktopWindow(), Operation, FileToOpen, ListOfParameters, PathToFile, EQ:SHOW)
Please look into the source for some additional comments.

Thats all! Add salt and pepper as you like....

You can download the sample source (Clarion 6.3). This page was made on 17.09.2013.


Here you find some more samples