Kbase 17112: How to Call WIN32 API Function: GetCommandLine
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  4/14/1999 |
|
How to Call WIN32 API Function: GetCommandLine
DISCLAIMER:
===========
The code example in this knowledgebase is for informational purposes
only. If you have specific questions about which API calls would be
best suited to your design goals, please consult your Microsoft
documentation.
INTRODUCTION:
=============
The following sample code shows how to call the Win32 API function
called GetCommandLine. This function returns the command line used
to start Progress (it gives the entire command line, not just the
arguments passed to the prowin32 executable).
This code has been tested on Windows NT 4.0 (Workstation and Server)
and Windows 95.
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).
ASSIGN chrCommandLine = GET-STRING(ptrToString,1).
MESSAGE chrCommandLine VIEW-AS ALERT-BOX.
Progress Software Technical Support Note # 17112