Sync rapps_new with rapps. Porting done by Mark Jensen. Original code from Ismael Ferreras Morezuelas.

CORE-10986

svn path=/trunk/; revision=71043
This commit is contained in:
Ziliang Guo 2016-03-24 23:03:35 +00:00
parent 72fc8c1283
commit 3ccdac9aca

View file

@ -36,7 +36,6 @@
#include <shellutils.h> #include <shellutils.h>
static PAPPLICATION_INFO AppInfo; static PAPPLICATION_INFO AppInfo;
static HICON hIcon = NULL;
class CDownloadDialog : class CDownloadDialog :
public CComObjectRootEx<CComMultiThreadModelNoCS>, public CComObjectRootEx<CComMultiThreadModelNoCS>,
@ -359,12 +358,16 @@ DownloadDlgProc(HWND Dlg, UINT Msg, WPARAM wParam, LPARAM lParam)
switch (Msg) switch (Msg)
{ {
case WM_INITDIALOG: case WM_INITDIALOG:
hIcon = LoadIconW(hInst, MAKEINTRESOURCEW(IDI_MAIN));
if (hIcon)
{ {
SendMessageW(Dlg, WM_SETICON, ICON_BIG, (LPARAM) hIcon); HICON hIconSm = NULL, hIconBg = NULL;
SendMessageW(Dlg, WM_SETICON, ICON_SMALL, (LPARAM) hIcon);
hIconBg = (HICON)GetClassLongPtr(hMainWnd, GCLP_HICON);
hIconSm = (HICON)GetClassLongPtr(hMainWnd, GCLP_HICONSM);
if (hIconBg && hIconSm)
{
SendMessageW(Dlg, WM_SETICON, ICON_BIG, (LPARAM) hIconBg);
SendMessageW(Dlg, WM_SETICON, ICON_SMALL, (LPARAM) hIconSm);
} }
SetWindowLongPtrW(Dlg, GWLP_USERDATA, 0); SetWindowLongPtrW(Dlg, GWLP_USERDATA, 0);
@ -379,7 +382,7 @@ DownloadDlgProc(HWND Dlg, UINT Msg, WPARAM wParam, LPARAM lParam)
if (!Thread) return FALSE; if (!Thread) return FALSE;
CloseHandle(Thread); CloseHandle(Thread);
return TRUE; return TRUE;
}
case WM_COMMAND: case WM_COMMAND:
if (wParam == IDCANCEL) if (wParam == IDCANCEL)
{ {
@ -389,7 +392,6 @@ DownloadDlgProc(HWND Dlg, UINT Msg, WPARAM wParam, LPARAM lParam)
return FALSE; return FALSE;
case WM_CLOSE: case WM_CLOSE:
if (hIcon) DestroyIcon(hIcon);
EndDialog(Dlg, 0); EndDialog(Dlg, 0);
return TRUE; return TRUE;