Consultor Eletrônico



Kbase 17124: How to Call WIN32 API Function: SetCurrentDirectory
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/05/1998
How to Call WIN32 API Function: SetCurrentDirectory

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 SetCurrentDirectory. This function changes the current
directory to the specified path.

This code has been tested on Windows NT 4.0 Workstation only.


DEFINE VARIABLE intResult AS INTEGER NO-UNDO.

PROCEDURE SetCurrentDirectoryA EXTERNAL "KERNEL32.DLL":
DEFINE INPUT PARAMETER chrCurDir AS CHARACTER.
DEFINE RETURN PARAMETER intResult AS LONG.
END PROCEDURE.

RUN SetCurrentDirectoryA (INPUT "C:\TEMP", OUTPUT intResult).

IF intResult = 1 THEN
MESSAGE "Current Directory Has Been Changed" VIEW-AS ALERT-BOX.
ELSE
MESSAGE "Directory Does Not Exist" VIEW-AS ALERT-BOX.

Progress Software Technical Support Note # 17124