mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 06:33:01 +00:00
[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
svn path=/trunk/; revision=67375
This commit is contained in:
parent
4cfa2fc11c
commit
551a6399a2
3 changed files with 23 additions and 9 deletions
|
@ -343,6 +343,13 @@ HRESULT WINAPI CProgressDialog::SetTitle(LPCWSTR pwzTitle)
|
||||||
|
|
||||||
HRESULT WINAPI CProgressDialog::SetAnimation(HINSTANCE hInstance, UINT uiResourceId)
|
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;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -479,20 +479,24 @@ static void _SetOperationTitle(FILE_OPERATION *op) {
|
||||||
if (op->progress == NULL)
|
if (op->progress == NULL)
|
||||||
return;
|
return;
|
||||||
WCHAR szTitle[50], szPreflight[50];
|
WCHAR szTitle[50], szPreflight[50];
|
||||||
|
UINT animation_id = NULL;
|
||||||
|
|
||||||
switch (op->req->wFunc)
|
switch (op->req->wFunc)
|
||||||
{
|
{
|
||||||
case FO_COPY:
|
case FO_COPY:
|
||||||
LoadStringW(shell32_hInstance, IDS_FILEOOP_COPYING, szTitle, sizeof(szTitle)/sizeof(WCHAR));
|
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));
|
LoadStringW(shell32_hInstance, IDS_FILEOOP_FROM_TO, op->szBuilderString, sizeof( op->szBuilderString)/sizeof(WCHAR));
|
||||||
|
animation_id = IDA_SHELL_COPY;
|
||||||
break;
|
break;
|
||||||
case FO_DELETE:
|
case FO_DELETE:
|
||||||
LoadStringW(shell32_hInstance, IDS_FILEOOP_DELETING, szTitle, sizeof(szTitle)/sizeof(WCHAR));
|
LoadStringW(shell32_hInstance, IDS_FILEOOP_DELETING, szTitle, sizeof(szTitle)/sizeof(WCHAR));
|
||||||
LoadStringW(shell32_hInstance, IDS_FILEOOP_FROM, op->szBuilderString, sizeof( op->szBuilderString)/sizeof(WCHAR));
|
LoadStringW(shell32_hInstance, IDS_FILEOOP_FROM, op->szBuilderString, sizeof( op->szBuilderString)/sizeof(WCHAR));
|
||||||
|
animation_id = IDA_SHELL_DELETE;
|
||||||
break;
|
break;
|
||||||
case FO_MOVE:
|
case FO_MOVE:
|
||||||
LoadStringW(shell32_hInstance, IDS_FILEOOP_MOVING, szTitle, sizeof(szTitle)/sizeof(WCHAR));
|
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));
|
LoadStringW(shell32_hInstance, IDS_FILEOOP_FROM_TO, op->szBuilderString, sizeof( op->szBuilderString)/sizeof(WCHAR));
|
||||||
|
animation_id = IDA_SHELL_COPY;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
|
@ -501,6 +505,7 @@ static void _SetOperationTitle(FILE_OPERATION *op) {
|
||||||
|
|
||||||
op->progress->SetTitle(szTitle);
|
op->progress->SetTitle(szTitle);
|
||||||
op->progress->SetLine(1, szPreflight, false, NULL);
|
op->progress->SetLine(1, szPreflight, false, NULL);
|
||||||
|
op->progress->SetAnimation(shell32_hInstance, animation_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _SetOperationTexts(FILE_OPERATION *op, LPCWSTR src, LPCWSTR dest) {
|
static void _SetOperationTexts(FILE_OPERATION *op, LPCWSTR src, LPCWSTR dest) {
|
||||||
|
|
|
@ -488,16 +488,18 @@
|
||||||
* AVI resources
|
* AVI resources
|
||||||
*
|
*
|
||||||
* windows shell32 has 14 of them: 150-152 and 160-170
|
* 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
|
* FIXME: Add 150-152
|
||||||
* (also to limit shell32's size)
|
|
||||||
*/
|
*/
|
||||||
#define IDR_AVI_SEARCH 150
|
|
||||||
#define IDR_AVI_SEARCHING 151
|
#define IDA_SHELL_COPY 160
|
||||||
#define IDR_AVI_FINDCOMPUTER 152
|
#define IDA_SHELL_COPY1 161
|
||||||
#define IDR_AVI_FILEMOVE 160
|
#define IDA_SHELL_COPY2 167
|
||||||
#define IDR_AVI_FILECOPY 161
|
#define IDA_SHELL_COPY3 168
|
||||||
#define IDR_AVI_FILENUKE 163
|
#define IDA_SHELL_RECYCLE 162
|
||||||
#define IDR_AVI_FILEDELETE 164
|
#define IDA_SHELL_EMPTY_RECYCLE 163
|
||||||
|
#define IDA_SHELL_DELETE 164
|
||||||
|
#define IDA_SHELL_DELETE1 169
|
||||||
|
#define IDA_SHELL_DOWNLOAD 170
|
||||||
|
|
||||||
/* Desktop Browser commands */
|
/* Desktop Browser commands */
|
||||||
#define FCIDM_DESKBROWSER_CLOSE 0xA004
|
#define FCIDM_DESKBROWSER_CLOSE 0xA004
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue