DEFINE VARIABLE chrCommandLine AS CHARACTER NO-UNDO FORMAT "X(128)".
DEFINE VARIABLE ptrToString AS MEMPTR NO-UNDO.
PROCEDURE GetCommandLineA EXTERNAL "KERNEL32.DLL":
DEFINE RETURN PARAMETER ptrToString AS MEMPTR.
END PROCEDURE.
RUN GetCommandLineA (OUTPUT ptrToString).
DEFINE VARIABLE i AS INTEGER NO-UNDO.
ASSIGN chrCommandLine = GET-STRING(ptrToString,1).
MESSAGE chrCommandLine
VIEW-AS ALERT-BOX INFO BUTTONS OK.
SET-SIZE(ptrToString) = 0.
Hi, this code return the command line that started the current session.