mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[SHIMGVW] Implement ImageView_Delete (#6132)
- Call SHFileOperation to delete. - Rebuild the file list and load the next file. CORE-19358
This commit is contained in:
parent
0faa1561a6
commit
e7f6b473e6
1 changed files with 29 additions and 2 deletions
|
@ -989,8 +989,35 @@ ImageView_OnSize(HWND hwnd, UINT state, INT cx, INT cy)
|
|||
static LRESULT
|
||||
ImageView_Delete(HWND hwnd)
|
||||
{
|
||||
DPRINT1("ImageView_Delete: unimplemented.\n");
|
||||
return 0;
|
||||
WCHAR szCurFile[MAX_PATH + 1], szNextFile[MAX_PATH];
|
||||
SHFILEOPSTRUCT FileOp = { hwnd, FO_DELETE };
|
||||
|
||||
if (image)
|
||||
{
|
||||
GdipDisposeImage(image);
|
||||
image = NULL;
|
||||
}
|
||||
|
||||
/* FileOp.pFrom must be double-null-terminated */
|
||||
GetFullPathNameW(currentFile->FileName, _countof(szCurFile) - 1, szCurFile, NULL);
|
||||
szCurFile[_countof(szCurFile) - 2] = UNICODE_NULL; /* Avoid buffer overrun */
|
||||
szCurFile[lstrlenW(szCurFile) + 1] = UNICODE_NULL;
|
||||
|
||||
GetFullPathNameW(currentFile->Next->FileName, _countof(szNextFile), szNextFile, NULL);
|
||||
szNextFile[_countof(szNextFile) - 1] = UNICODE_NULL; /* Avoid buffer overrun */
|
||||
|
||||
FileOp.pFrom = szCurFile;
|
||||
FileOp.fFlags = FOF_ALLOWUNDO;
|
||||
if (SHFileOperation(&FileOp) != 0)
|
||||
return 0;
|
||||
|
||||
pFreeFileList(currentFile);
|
||||
currentFile = NULL;
|
||||
|
||||
currentFile = pBuildFileList(szNextFile);
|
||||
pLoadImageFromNode(currentFile, hwnd);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static LRESULT
|
||||
|
|
Loading…
Reference in a new issue