Ver Mensaje Individual
  #12
Antiguo 21 de enero de 2025, 10:57
Joseg
El Foro es mi casa
Activista del Foro: Activista del Foro - Issue reason: Por participación activa Innovación: Por aportar innovaciones - Issue reason: Por aportar soluciones innovadoras en varias ocasiones 
Última Actividad 21.09.2026 18:39
Posts Posts: 402
Likes enviados Enviados: 130
Likes recibidos Recibidos: 179

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:
  1.  ENVIRONMENT     DIVISION.
  2.  DATA            DIVISION.
  3.  WORKING-STORAGE SECTION.
  4.  01 Wimagem.
  5.     03  pic x(8) value "..\DOCS".
  6.     03 pimagem pic x(200).
  7.  
  8.  
  9.   1      open-command.
  10.    2     filler        pic x(4)  value "open".
  11.    2     filler        pic x(1)  value low-value.
  12.  
  13.   1      file-to-open.
  14.    2     FTOP          pic x(256) value spaces.
  15.    2     filler        pic x(1)  value low-value.
  16.  
  17.   1      default-directory.
  18. *  2     filler        pic x(17) value "D:\downloads\pdfs".
  19.    2     filler        pic x(1)  value low-value.
  20.  
  21.   77     se-hInstance    pic s9(9) comp-5.
  22.   77     ReturnValue     pic s9(9) comp-5.
  23.  
  24.  LINKAGE         SECTION.
  25.  01  POW-ARG-PLISTITEM OBJECT REFERENCE POW-CLISTITEM.
  26.  PROCEDURE       DIVISION USING POW-ARG-PLISTITEM.
  27.  
  28. *** To use this routine, the SHELL32.LIB file needs to be added
  29. *** to the PowerCobol project.
  30.      MOVE "Text" OF CmText7 TO pimagem
  31.      MOVE Wimagem TO FTOP
  32.      
  33.       call "ShellExecuteA" with stdcall linkage
  34.           using
  35.               by value 0       *> window handle
  36.               by reference
  37.                   open-command *> operation to perform
  38.                   file-to-open *> document to open
  39.               by value 0       *> parameters (none here)
  40.               by reference
  41.                   default-directory, *> directory (could also be null)
  42.               by value 1       *> SW-SHOWNORMAL show the file when open
  43.           returning
  44.               se-hInstance     *> not 'really' a handle,
  45.                               *> more an error return
  46.       end-call
  47.  
  48.       if se-hInstance is not greater than 32 then
  49.           INVOKE pow-self "DisplayMessage"
  50.               USING "Não consegue abrir o documento / NÃO ESTA SELECIONADO..." "Bad Open :(" POW-DMICONERROR
  51.               RETURNING ReturnValue
  52.       end-if
  53.  
  54.       exit program
  55.  
  56.      




Citación del post de orlando Ver Mensaje
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
Joseg is offline   Responder Con Cita