5 #include "debugtools.h"
7 #include "shell32_main.h"
8 #include "winversion.h"
12 #include "wine/undocshell.h"
14 DEFAULT_DEBUG_CHANNEL(shell
);
16 #define ASK_DELETE_FILE 1
17 #define ASK_DELETE_FOLDER 2
18 #define ASK_DELETE_MULTIPLE_FILE 3
20 static BOOL
SHELL_WarnFolderDelete (int nKindOfDialog
, LPCSTR szDir
)
22 char szCaption
[255], szText
[255], szBuffer
[256];
24 LoadStringA(shell32_hInstance
, IDS_DELETEFOLDER_TEXT
, szText
, sizeof(szText
));
25 LoadStringA(shell32_hInstance
, IDS_DELETEFOLDER_CAPTION
, szCaption
, sizeof(szCaption
));
26 FormatMessageA(FORMAT_MESSAGE_FROM_STRING
, szText
, 0,0, szBuffer
, sizeof(szBuffer
), (DWORD
*)&szDir
);
28 return (IDOK
== MessageBoxA(GetActiveWindow(),szText
, szCaption
, MB_OKCANCEL
| MB_ICONEXCLAMATION
));
31 /**************************************************************************
32 * SHELL_DeleteDirectoryA()
37 BOOL
SHELL_DeleteDirectoryA(LPCSTR pszDir
, BOOL bShowUI
)
42 char szTemp
[MAX_PATH
];
44 strcpy(szTemp
, pszDir
);
45 PathAddBackslashA(szTemp
);
46 strcat(szTemp
, "*.*");
48 if (bShowUI
&& !SHELL_WarnFolderDelete(ASK_DELETE_FOLDER
, pszDir
)) return FALSE
;
50 if(INVALID_HANDLE_VALUE
!= (hFind
= FindFirstFileA(szTemp
, &wfd
)))
54 if(strcasecmp(wfd
.cFileName
, ".") && strcasecmp(wfd
.cFileName
, ".."))
56 strcpy(szTemp
, pszDir
);
57 PathAddBackslashA(szTemp
);
58 strcat(szTemp
, wfd
.cFileName
);
60 if(FILE_ATTRIBUTE_DIRECTORY
& wfd
.dwFileAttributes
)
61 SHELL_DeleteDirectoryA(szTemp
, FALSE
);
65 } while(FindNextFileA(hFind
, &wfd
));
68 ret
= RemoveDirectoryA(pszDir
);
74 /*************************************************************************
75 * SHCreateDirectory [SHELL32.165]
79 * not sure about LPSECURITY_ATTRIBUTES
81 DWORD WINAPI
SHCreateDirectory(LPSECURITY_ATTRIBUTES sec
,LPCSTR path
)
84 TRACE("(%p,%s)\n",sec
,path
);
85 if ((ret
= CreateDirectoryA(path
,sec
)))
87 SHChangeNotifyA(SHCNE_MKDIR
, SHCNF_PATHA
, path
, NULL
);
92 /************************************************************************
93 * Win32DeleteFile [SHELL32.164]
95 * Deletes a file. Also triggers a change notify if one exists.
98 * Verified on Win98 / IE 5 (SHELL32 4.72, March 1999 build) to be
99 * ANSI. Is this Unicode on NT?
103 BOOL WINAPI
Win32DeleteFile(LPSTR fName
)
105 TRACE("%p(%s)\n", fName
, fName
);
108 SHChangeNotifyA(SHCNE_DELETE
, SHCNF_PATHA
, fName
, NULL
);
112 /*************************************************************************
113 * SHFileOperationA [SHELL32.243]
118 DWORD WINAPI
SHFileOperationA (LPSHFILEOPSTRUCTA lpFileOp
)
120 FIXME("(%p):stub.\n", lpFileOp
);
124 /*************************************************************************
125 * SHFileOperationW [SHELL32.244]
130 DWORD WINAPI
SHFileOperationW (LPSHFILEOPSTRUCTW lpFileOp
)
132 FIXME("(%p):stub.\n", lpFileOp
);
136 /*************************************************************************
137 * SHFileOperation [SHELL32.242]
140 DWORD WINAPI
SHFileOperationAW(LPVOID lpFileOp
)
142 if (VERSION_OsIsUnicode())
143 return SHFileOperationW(lpFileOp
);
144 return SHFileOperationA(lpFileOp
);
147 /*************************************************************************
148 * SheGetDirW [SHELL32.281]
151 HRESULT WINAPI
SheGetDirW(LPWSTR u
, LPWSTR v
)
152 { FIXME("%p %p stub\n",u
,v
);
156 /*************************************************************************
157 * SheChangeDirW [SHELL32.274]
160 HRESULT WINAPI
SheChangeDirW(LPWSTR u
)
161 { FIXME("(%s),stub\n",debugstr_w(u
));