Consultor Eletrônico



Kbase 18141: How to Call WIN32 API Function: RemoveDirectory
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   7/24/1998
How to Call WIN32 API Function: RemoveDirectory

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 RemoveDirectory. This function deletes the specified empty
directory.

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


DEFINE VARIABLE intResult AS INTEGER NO-UNDO.

PROCEDURE RemoveDirectoryA EXTERNAL "KERNEL32.DLL":
DEFINE INPUT PARAMETER chrDir AS CHARACTER NO-UNDO.
DEFINE RETURN PARAMETER logResult AS SHORT NO-UNDO.
END PROCEDURE.

RUN RemoveDirectoryA ("C:\TEMP\JUNK", OUTPUT intResult).

IF intResult = 1 THEN
MESSAGE "Directory Removed" VIEW-AS ALERT-BOX.
ELSE
MESSAGE "Removal Failed" VIEW-AS ALERT-BOX.