Consultor Eletrônico



Kbase P52902: How to display a .gif using the XP ·Windows Picture and Fax
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   08/11/2003
Status: Unverified

GOAL:

How to display a .gif using the XP 'Windows Picture and Fax Viewer' from 4GL?

FACT(s) (Environment):

Windows XP

FACT(s) (Environment):

Progress 8.x

FACT(s) (Environment):

Progress 9.x

FIX:

The following 4GL code will display an image file named mozart.gif on the screen:

DEFINE VARIABLE cCommand AS CHARACTER NO-UNDO.
DEFINE VARIABLE cDiretory AS CHARACTER NO-UNDO.
DEFINE VARIABLE cFileName AS CHARACTER NO-UNDO.

ASSIGN
cDiretory = "C:\WRK91D"
cFileName = "mozart.gif"
cCommand = "rundll32.exe %SystemRoot%\System32\shimgvw.dll,ImageView_Fullscreen" +
CHR(32) + cDiretory + CHR(92) + cFileName.

OS-COMMAND SILENT VALUE(cCommand).

For other windows systems that do not have the ·Windows Picture and Fax Viewer·, the following code uses MSPAINT.EXE to display the same image file on the screen:

DEFINE VARIABLE cCommand AS CHARACTER NO-UNDO.
DEFINE VARIABLE cDiretory AS CHARACTER NO-UNDO.
DEFINE VARIABLE cFileName AS CHARACTER NO-UNDO.

ASSIGN
cDiretory = "C:\WRK91D"
cFileName = "mozart.gif"
cCommand = "mspaint.exe" + CHR(32) + cDiretory + CHR(92) + cFileName.

OS-COMMAND SILENT VALUE(cCommand).