Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to find the associated exe?

5 views
Skip to first unread message

Jason T. Kenney

unread,
Mar 17, 1999, 3:00:00 AM3/17/99
to
Thanks for the help...
However, I am working with sql windows 5.02. Is there a 16 bit
equivalent???

Ran J. Flam wrote in message <7cp2cg$dq...@horizon.centurasoft.com>...
>Use FindExecutableA( ) as shown below.
>
>
>Ran J. Flam
>Sparta Systems, Inc.
>-------------------------------------------------
>
>If the return value != 31 then sAssociatedExe is set with the executable
>file which is associated with the exetension of the 'sInFilename' above.
>
>Call SalStrSetBufferLength( sAssociatedExec, 256 )
>If FindExecutableA( sInFilename, 0, sAssociatedExec ) != 31
> Call SalStrTrim( sAssociatedExec, sAssociatedExec )
> If SalStrLength( sAssociatedExec ) > 0
> Set sOutAssociatedFile =
>ConvertToShortFilename( sAssociatedExec )
> Return TRUE
>
>!!CB!! 81
>Library name: shell32.dll
> Function: FindExecutableA
> Description:
> Export Ordinal: 0
> Returns
> Number: WORD
> Parameters
> String: LPSTR
> Number: DWORD
> Receive String: LPSTR
>
>
>
>

Ran J. Flam

unread,
Mar 17, 1999, 3:00:00 AM3/17/99
to

Ran J. Flam

unread,
Mar 17, 1999, 3:00:00 AM3/17/99
to
In my precious message, please ignore the call ConvertToShortFilename( ),
this was from the old days of 16-bit .... We were 'playing' around with the
~ ....

Ran.

Jason T. Kenney

unread,
Mar 17, 1999, 3:00:00 AM3/17/99
to
If you know the extension of the file (*.bmp, *.doc, *.txt). How can you
find full path and file name of the executable that is associated with it?


Is there a windows function??

Mahesh Ramakrishnan

unread,
Mar 17, 1999, 3:00:00 AM3/17/99
to
Jason,


If 16 bit and if you are comfortable with salgetprofilestring,

then you can search in win.ini under the section "[Extensions]". It may
work.

Regards,


Mahesh.


Jason T. Kenney wrote in message <7cp7j0$dq...@horizon.centurasoft.com>...


>Thanks for the help...
>However, I am working with sql windows 5.02. Is there a 16 bit
>equivalent???
>
>
>
>Ran J. Flam wrote in message <7cp2cg$dq...@horizon.centurasoft.com>...

Craig Manley

unread,
Mar 18, 1999, 3:00:00 AM3/18/99
to
Hi,

> Call SalStrSetBufferLength( sAssociatedExec, 256 )

A small remark: MAX_PATH = 260, not 256 as shown above. Maybe a long
string should be used if you use MAX_PATH.
-Craig.

Ran J. Flam

unread,
Mar 20, 1999, 3:00:00 AM3/20/99
to
Craig,

Thanks for the info!
We'll make the code changes as you suggested.
-Ran

Ran J. Flam

unread,
Mar 20, 1999, 3:00:00 AM3/20/99
to
Jason,

You probably have the answer by now, but, to be on the safe side ..
The 16-bit function is FindExecutable( ) as is included in shell.dll
We have actually first used it in our SQLWindows apps.
-Ran

0 new messages