30. FAQ o Win API

Q> How to delete a directory, if it not the empty? 
A> 

SHFILEOPSTRUCT sh; 

sh.hwnd = GetSafeHwnd ();//For BCB sh.hwnd=FormX-> Handle; 
sh.wFunc = FO_DELETE; 
sh.pFrom = "c: \\test\0"; 
sh.pTo = NULL; 
sh.fFlags = FOF_NOCONFIRMATION | FOF_SILENT; 
sh.hNameMappings = 0; 
sh.lpszProgressTitle = NULL; 

SHFileOperation (&sh); 

This code carries out all tree, since (and including) s:\test 

2000 (c) DM