In case you ever need it:
LOCAL lcfile, lcdir, lcbuffer, lnresult, lnpt, lcexecutable
DECLARE INTEGER FindExecutable IN Shell32 STRING @lpfile, STRING @lpdirectory, STRING @lpbuffer
lcfile = THIS.cFileToFindExecutableFor
lcdir = JUSTPATH(lcfile)
lcbuffer = SPACE(260)
lnresult = FindExecutable(@lcfile, @lcdir, @lcbuffer)
IF lnresult > 31
lcbuffer = strtran(lcbuffer,CHR(0),' ')
lnpt = AT('.EXE ', UPPER(lcbuffer))+3
lcexecutable = LEFT(lcbuffer, lnpt)
ENDIF
RETURN lcexecutable
*
I create dummy file names to test what executable would be used. Such as lctempfile = lchomedir+'\TEMP\'+SYS(3)+'.htm'.
The file does not exist, I just create a name to pass to the above function call. It then returns to me the complete path to the execuatable that would be used to run the htm file.
>>My application does the following.
>>Before the interface comes up it asks the users computer where is the executable for all of the programs that the application may need. Such as PDF, DOC, TXT, HTM, etc. I do this by using a call asking the Users Computer what program is brought up when a certain extension (PDF, etc..) is encountered. I then store the results into a Application Object, to be used later. If this is what you have in mind then I will be glad to send you the code.
>>
>Hi Bret,
>
>I was thinking in this direction. Actually, I was gathering some ideas for my colleague's program. I am not sure how MereMortals stores some user's defined information. We'll discuss it tomorrow with my colleague. One it's quite certain, though: the program should not fail immediatelly if the program is not found in its default directory, it may prompt the user as your program does and Sergey suggested.
Bret Hobbs
"We'd have been called juvenile delinquents only our neighborhood couldn't afford a sociologist." Bob Hope