Author: zguo
Date: Thu Mar 24 23:03:35 2016
New Revision: 71043
URL:
http://svn.reactos.org/svn/reactos?rev=71043&view=rev
Log:
Sync rapps_new with rapps. Porting done by Mark Jensen. Original code from Ismael Ferreras
Morezuelas.
CORE-10986
Modified:
trunk/reactos/base/applications/rapps_new/loaddlg.cpp
Modified: trunk/reactos/base/applications/rapps_new/loaddlg.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps_ne…
==============================================================================
--- trunk/reactos/base/applications/rapps_new/loaddlg.cpp [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps_new/loaddlg.cpp [iso-8859-1] Thu Mar 24 23:03:35
2016
@@ -36,7 +36,6 @@
#include <shellutils.h>
static PAPPLICATION_INFO AppInfo;
-static HICON hIcon = NULL;
class CDownloadDialog :
public CComObjectRootEx<CComMultiThreadModelNoCS>,
@@ -359,12 +358,16 @@
switch (Msg)
{
case WM_INITDIALOG:
-
- hIcon = LoadIconW(hInst, MAKEINTRESOURCEW(IDI_MAIN));
- if (hIcon)
+ {
+ HICON hIconSm = NULL, hIconBg = NULL;
+
+ hIconBg = (HICON)GetClassLongPtr(hMainWnd, GCLP_HICON);
+ hIconSm = (HICON)GetClassLongPtr(hMainWnd, GCLP_HICONSM);
+
+ if (hIconBg && hIconSm)
{
- SendMessageW(Dlg, WM_SETICON, ICON_BIG, (LPARAM) hIcon);
- SendMessageW(Dlg, WM_SETICON, ICON_SMALL, (LPARAM) hIcon);
+ SendMessageW(Dlg, WM_SETICON, ICON_BIG, (LPARAM) hIconBg);
+ SendMessageW(Dlg, WM_SETICON, ICON_SMALL, (LPARAM) hIconSm);
}
SetWindowLongPtrW(Dlg, GWLP_USERDATA, 0);
@@ -379,7 +382,7 @@
if (!Thread) return FALSE;
CloseHandle(Thread);
return TRUE;
-
+ }
case WM_COMMAND:
if (wParam == IDCANCEL)
{
@@ -389,7 +392,6 @@
return FALSE;
case WM_CLOSE:
- if (hIcon) DestroyIcon(hIcon);
EndDialog(Dlg, 0);
return TRUE;