+ Reply to Thread
Results 1 to 2 of 2

Thread: How to delete a directory with all the sub-directories with a WIN32 API?

  1. #1
    Junior Member
    Join Date
    Feb 2012
    Posts
    49

    How to delete a directory with all the sub-directories with a WIN32 API?

    How to delete a directory with all the sub-directories with a WIN32 API?

  2. #2
    Example;

    Code:
    void DeleteDirectoryWithSubDirectories(char szDirectoryPath[MAX_PATH])
    {
    	SHFILEOPSTRUCT fileStruct ;
    	
    	memset(&fileStruct, 0, sizeof(fileStruct)) ;
    
    	fileStruct.hwnd   = NULL ;
    	fileStruct.wFunc  = FO_DELETE ;
    	fileStruct.fFlags = FOF_SILENT | FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_NOCONFIRMMKDIR ;
    	fileStruct.pFrom  = szDirectoryPath ;
    	
    	SHFileOperation(&fileStruct) ;
    }
    For more information on SHFileOperation API:
    http://msdn.microsoft.com/en-us/libr...=vs.85%29.aspx

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts