Home > Archive > Cobol > March 2008 > Open Associated file
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Open Associated file
|
|
|
| Fujitsu Power Cobol V7.0
I try with this code:
call "ShellExecuteA" with stdcall linkage
using
by value 0 *> window handle
by reference
open-command *> operation to perform
file-to-open *> document to open
by value 0 *> parameters (none here)
by reference
default-directory, *> directory (could also be null)
by value 0 *> SW-SHOWNORMAL show the file when open
returning
se-hInstance *> not 'really' a handle,
*> more an error return
end-call
I open all files less the MS office.
Some reason?
Thanks
Joe
| |
| Kellie Fitton 2008-03-19, 6:55 pm |
| On Mar 19, 4:54=A0am, "Euro" <e...@euromercante.pt> wrote:
> Fujitsu Power Cobol V7.0
>
> I try with this code:
>
> =A0 =A0 =A0 call "ShellExecuteA" with stdcall linkage
> =A0 =A0 =A0 =A0 =A0 using
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 by value 0 =A0 =A0 =A0*> window handle
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 by reference
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 open-command *> operation to perform
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 file-to-open *> document to open
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 by value 0 =A0 =A0 =A0 *> parameters (none her=
e)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 by reference
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 default-directory, *> directory (could=
also be null)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 by value 0 =A0 =A0 =A0 *> SW-SHOWNORMAL show t=
he file when open
> =A0 =A0 =A0 =A0 =A0 returning
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 se-hInstance =A0 =A0 *> not 'really' a handle,=
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*> more an =
error return
> =A0 =A0 =A0 end-call
>
> I open all files less the MS office.
> Some reason?
>
> Thanks
> Joe
Hi,
You can use the following APIs to retrieve the name and handle of the
executable file associated with a specified filename (doc, xls, pps):
FindExecutable()
CreateProcess()
WaitForSingleObject()
CloseHandle()
http://msdn2.microsoft.com/en-us/library/ms647374.aspx
http://msdn2.microsoft.com/en-us/library/ms682425.aspx
http://msdn2.microsoft.com/en-us/library/ms687032.aspx
http://msdn2.microsoft.com/en-us/library/ms724211.aspx
Kellie.
| |
|
|
|
|
|
|
|