Kbase 18930: How To Use Progress 4GL To Invoke A Windows
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/15/2008 |
|
Status: Verified
GOAL:
How to use Progress 4GL to invoke a Windows "browse for folder" window.
FIX:
The code begins with a definition of external procedures:
PROCEDURE SHBrowseForFolder EXTERNAL "shell32.dll":
DEFINE INPUT PARAMETER mPoint AS MEMPTR.
DEFINE RETURN PARAMETER lRet AS LONG.
END.
PROCEDURE SHGetPathFromIDList EXTERNAL "shell32.dll":
DEFINE INPUT PARAMETER mPoint AS LONG.
DEFINE INPUT-OUTPUT PARAMETER cVar AS CHARACTER.
DEFINE RETURN PARAMETER lRet AS LONG.
END.
/* Call the procedures - in trigger code (.. ON CHOOSE OF btn-1): */
DEFINE VARIABLE mPoint AS MEMPTR NO-UNDO.
DEFINE VARIABLE cVar AS CHARACTER NO-UNDO.
DEFINE VARIABLE iRet AS INTEGER NO-UNDO.
DEFINE VARIABLE iRet2 AS INTEGER NO-UNDO.
SET-SIZE (mPoint) = 1000.
cVar = FILL (" ",255).
RUN SHBrowseForFolder (INPUT mPoint, OUTPUT iRet).
RUN SHGetPathFromIDList (iRet, INPUT-OUTPUT cVar, OUTPUT iRet2).
MESSAGE cVar VIEW-AS ALERT-BOX.