Funciona en todos los Windows de 32/64 bits
Se abre con el programa asociado, no hay que preocuparse por la ruta.
Código COBOL:
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 Wimagem.
03 pic x(8) value "..\DOCS".
03 pimagem pic x(200).
1 open-command.
2 filler pic x(4) value "open".
2 filler pic x(1) value low-value.
1 file-to-open.
2 FTOP pic x(256) value spaces.
2 filler pic x(1) value low-value.
1 default-directory.
* 2 filler pic x(17) value "D:\downloads\pdfs".
2 filler pic x(1) value low-value.
77 se-hInstance pic s9(9) comp-5.
77 ReturnValue pic s9(9) comp-5.
LINKAGE SECTION.
01 POW-ARG-PLISTITEM OBJECT REFERENCE POW-CLISTITEM.
PROCEDURE DIVISION USING POW-ARG-PLISTITEM.
*** To use this routine, the SHELL32.LIB file needs to be added
*** to the PowerCobol project.
MOVE "Text" OF CmText7 TO pimagem
MOVE Wimagem TO FTOP
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 1 *> SW-SHOWNORMAL show the file when open
returning
se-hInstance *> not 'really' a handle,
*> more an error return
end-call
if se-hInstance is not greater than 32 then
INVOKE pow-self "DisplayMessage"
USING "Não consegue abrir o documento / NÃO ESTA SELECIONADO..." "Bad Open :(" POW-DMICONERROR
RETURNING ReturnValue
end-if
exit program
Citación del post de
orlando
|
❞
buena tarde
Alguien me da una mano tengo programas win10 que llaman a paint y excel ..pero
por ejemplo en paint seria cambia ruta y compilarlo con ruta de el usuario ej pepe ver archivo p
Código:
c:\users\pepe\AppData\Local\mspaint.exe D:\odog\0000000000001.bmp
pero
esto me llevaria a compilar por cada usuario....no se si alguien ya lo ha hecho .......pero
con una sola ruta...para dejar algo general y ahorrar trabajo-.............
por otro lado
tengo excel ver archivos e y e1.....pero no se como seria.....
pero ,,,no se dejaron subir solo archivo p
muy amables recibo ideas
|