Author: akhaldi Date: Thu Apr 23 22:35:23 2015 New Revision: 67375
URL: http://svn.reactos.org/svn/reactos?rev=67375&view=rev Log: [SHELL32][BROWSEUI] Implement SetAnimation so that AVIs from shell32 can be used when the progress dialog is in use. Brought to you by Robert Naumann. CORE-9327
Modified: trunk/reactos/dll/win32/browseui/CProgressDialog.cpp trunk/reactos/dll/win32/shell32/shlfileop.cpp trunk/reactos/dll/win32/shell32/shresdef.h
Modified: trunk/reactos/dll/win32/browseui/CProgressDialog.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/CProgres... ============================================================================== --- trunk/reactos/dll/win32/browseui/CProgressDialog.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/browseui/CProgressDialog.cpp [iso-8859-1] Thu Apr 23 22:35:23 2015 @@ -343,6 +343,13 @@
HRESULT WINAPI CProgressDialog::SetAnimation(HINSTANCE hInstance, UINT uiResourceId) { + HWND hAnimation = GetDlgItem(this->hwnd, IDD_PROGRESS_DLG); + SetWindowLongW(hAnimation, GWL_STYLE, + GetWindowLongW(hAnimation, GWL_STYLE)|ACS_TRANSPARENT|ACS_CENTER|ACS_AUTOPLAY); + + if(!Animate_OpenEx(hAnimation,hInstance,MAKEINTRESOURCEW(uiResourceId))) + return S_FALSE; + return S_OK; }
Modified: trunk/reactos/dll/win32/shell32/shlfileop.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shlfileop... ============================================================================== --- trunk/reactos/dll/win32/shell32/shlfileop.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/shlfileop.cpp [iso-8859-1] Thu Apr 23 22:35:23 2015 @@ -479,20 +479,24 @@ if (op->progress == NULL) return; WCHAR szTitle[50], szPreflight[50]; + UINT animation_id = NULL;
switch (op->req->wFunc) { case FO_COPY: LoadStringW(shell32_hInstance, IDS_FILEOOP_COPYING, szTitle, sizeof(szTitle)/sizeof(WCHAR)); LoadStringW(shell32_hInstance, IDS_FILEOOP_FROM_TO, op->szBuilderString, sizeof( op->szBuilderString)/sizeof(WCHAR)); + animation_id = IDA_SHELL_COPY; break; case FO_DELETE: LoadStringW(shell32_hInstance, IDS_FILEOOP_DELETING, szTitle, sizeof(szTitle)/sizeof(WCHAR)); LoadStringW(shell32_hInstance, IDS_FILEOOP_FROM, op->szBuilderString, sizeof( op->szBuilderString)/sizeof(WCHAR)); + animation_id = IDA_SHELL_DELETE; break; case FO_MOVE: LoadStringW(shell32_hInstance, IDS_FILEOOP_MOVING, szTitle, sizeof(szTitle)/sizeof(WCHAR)); LoadStringW(shell32_hInstance, IDS_FILEOOP_FROM_TO, op->szBuilderString, sizeof( op->szBuilderString)/sizeof(WCHAR)); + animation_id = IDA_SHELL_COPY; break; default: return; @@ -501,6 +505,7 @@
op->progress->SetTitle(szTitle); op->progress->SetLine(1, szPreflight, false, NULL); + op->progress->SetAnimation(shell32_hInstance, animation_id); }
static void _SetOperationTexts(FILE_OPERATION *op, LPCWSTR src, LPCWSTR dest) {
Modified: trunk/reactos/dll/win32/shell32/shresdef.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shresdef.... ============================================================================== --- trunk/reactos/dll/win32/shell32/shresdef.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/shresdef.h [iso-8859-1] Thu Apr 23 22:35:23 2015 @@ -488,16 +488,18 @@ * AVI resources * * windows shell32 has 14 of them: 150-152 and 160-170 - * FIXME: Need to add them, but for now just let them use the same: searching.avi - * (also to limit shell32's size) + * FIXME: Add 150-152 */ -#define IDR_AVI_SEARCH 150 -#define IDR_AVI_SEARCHING 151 -#define IDR_AVI_FINDCOMPUTER 152 -#define IDR_AVI_FILEMOVE 160 -#define IDR_AVI_FILECOPY 161 -#define IDR_AVI_FILENUKE 163 -#define IDR_AVI_FILEDELETE 164 + +#define IDA_SHELL_COPY 160 +#define IDA_SHELL_COPY1 161 +#define IDA_SHELL_COPY2 167 +#define IDA_SHELL_COPY3 168 +#define IDA_SHELL_RECYCLE 162 +#define IDA_SHELL_EMPTY_RECYCLE 163 +#define IDA_SHELL_DELETE 164 +#define IDA_SHELL_DELETE1 169 +#define IDA_SHELL_DOWNLOAD 170
/* Desktop Browser commands */ #define FCIDM_DESKBROWSER_CLOSE 0xA004