tweak for win32_trash()
This commit is contained in:
parent
adc181e3ec
commit
87ed5bc991
2 changed files with 10 additions and 4 deletions
|
|
@ -2141,8 +2141,10 @@ static SDL_Surface *myIMG_Load(const char *file);
|
||||||
static int trash(char *path);
|
static int trash(char *path);
|
||||||
#else
|
#else
|
||||||
#ifndef UNLINK_ONLY
|
#ifndef UNLINK_ONLY
|
||||||
static int win32_trash(char *path);
|
extern int win32_trash(char *path);
|
||||||
#define trash(file) win32_trash(file)
|
#define trash(file) win32_trash(file)
|
||||||
|
#else
|
||||||
|
static int trash(char *path);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
int file_exists(char *path);
|
int file_exists(char *path);
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,17 @@
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
int win32_trash(char *path);
|
int win32_trash(char *path);
|
||||||
int win32_trash(char *path)
|
int win32_trash(char *path)
|
||||||
{
|
{
|
||||||
SHFILEOPSTRUCT op;
|
SHFILEOPSTRUCT op;
|
||||||
|
int ret;
|
||||||
|
|
||||||
op.wFunc = FO_DELETE;
|
op.wFunc = FO_DELETE;
|
||||||
op.pFrom = path;
|
op.pFrom = path;
|
||||||
op.fFlags = FOF_SILENT|FOF_ALLOWUNDO;
|
op.fFlags = FOF_SILENT|FOF_ALLOWUNDO;
|
||||||
|
ret = SHFileOperationA(&op);
|
||||||
return SHFileOperationA(&op);
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue