Alexandre Julliard : wordpad: Set the window small icon, and get rid of old icons.

Alexandre Julliard julliard at winehq.org
Tue Apr 20 11:32:20 CDT 2010


Module: wine
Branch: master
Commit: b2e7e5c3530a77d9af5819643e458e0fa0e32b78
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=b2e7e5c3530a77d9af5819643e458e0fa0e32b78

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Apr 19 20:13:34 2010 +0200

wordpad: Set the window small icon, and get rid of old icons.

---

 programs/wordpad/rsrc.rc   |    9 ---------
 programs/wordpad/rtf.ico   |  Bin 2238 -> 0 bytes
 programs/wordpad/txt.ico   |  Bin 2238 -> 0 bytes
 programs/wordpad/wordpad.c |   18 ++++++------------
 programs/wordpad/wordpad.h |    5 +----
 programs/wordpad/wri.ico   |  Bin 2238 -> 0 bytes
 6 files changed, 7 insertions(+), 25 deletions(-)

diff --git a/programs/wordpad/rsrc.rc b/programs/wordpad/rsrc.rc
index c074e3d..60d0792 100644
--- a/programs/wordpad/rsrc.rc
+++ b/programs/wordpad/rsrc.rc
@@ -52,14 +52,5 @@ IDB_FORMATBAR BITMAP "formatbar.bmp"
 /* @makedep: wordpad.ico */
 IDI_WORDPAD ICON "wordpad.ico"
 
-/* @makedep: rtf.ico */
-IDI_RTF ICON "rtf.ico"
-
-/* @makedep: wri.ico */
-IDI_WRI ICON "wri.ico"
-
-/* @makedep: txt.ico */
-IDI_TXT ICON "txt.ico"
-
 /* @makedep: zoom.cur */
 IDC_ZOOM CURSOR "zoom.cur"
diff --git a/programs/wordpad/rtf.ico b/programs/wordpad/rtf.ico
deleted file mode 100644
index 653a5cf..0000000
Binary files a/programs/wordpad/rtf.ico and /dev/null differ
diff --git a/programs/wordpad/txt.ico b/programs/wordpad/txt.ico
deleted file mode 100644
index 39a9f90..0000000
Binary files a/programs/wordpad/txt.ico and /dev/null differ
diff --git a/programs/wordpad/wordpad.c b/programs/wordpad/wordpad.c
index b9e6f37..d5f9af5 100644
--- a/programs/wordpad/wordpad.c
+++ b/programs/wordpad/wordpad.c
@@ -703,17 +703,8 @@ static void preview_exit(HWND hMainWnd)
 
 static void set_fileformat(WPARAM format)
 {
-    HICON hIcon;
-    HINSTANCE hInstance = GetModuleHandleW(0);
     fileFormat = format;
 
-    if(format & SF_TEXT)
-        hIcon = LoadIconW(hInstance, MAKEINTRESOURCEW(IDI_TXT));
-    else
-        hIcon = LoadIconW(hInstance, MAKEINTRESOURCEW(IDI_RTF));
-
-    SendMessageW(hMainWnd, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
-
     set_bar_states();
     set_default_font();
     target_device(hMainWnd, wordWrap[reg_formatindex(fileFormat)]);
@@ -2618,7 +2609,7 @@ int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hOldInstance, LPSTR szCmdPar
 {
     INITCOMMONCONTROLSEX classes = {8, ICC_BAR_CLASSES|ICC_COOL_CLASSES|ICC_USEREX_CLASSES};
     HACCEL hAccel;
-    WNDCLASSW wc;
+    WNDCLASSEXW wc;
     MSG msg;
     RECT rc;
     UINT_PTR hPrevRulerProc;
@@ -2638,11 +2629,13 @@ int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hOldInstance, LPSTR szCmdPar
     wc.cbWndExtra = 4;
     wc.hInstance = hInstance;
     wc.hIcon = LoadIconW(hInstance, MAKEINTRESOURCEW(IDI_WORDPAD));
+    wc.hIconSm = LoadImageW(hInstance, MAKEINTRESOURCEW(IDI_WORDPAD), IMAGE_ICON,
+                            GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_SHARED);
     wc.hCursor = LoadCursor(NULL, IDC_IBEAM);
     wc.hbrBackground = GetSysColorBrush(COLOR_WINDOW);
     wc.lpszMenuName = MAKEINTRESOURCEW(IDM_MAINMENU);
     wc.lpszClassName = wszMainWndClass;
-    RegisterClassW(&wc);
+    RegisterClassExW(&wc);
 
     wc.style = CS_HREDRAW | CS_VREDRAW;
     wc.lpfnWndProc = preview_proc;
@@ -2650,11 +2643,12 @@ int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hOldInstance, LPSTR szCmdPar
     wc.cbWndExtra = 0;
     wc.hInstance = hInstance;
     wc.hIcon = NULL;
+    wc.hIconSm = NULL;
     wc.hCursor = LoadCursor(NULL, IDC_IBEAM);
     wc.hbrBackground = GetSysColorBrush(COLOR_WINDOW);
     wc.lpszMenuName = NULL;
     wc.lpszClassName = wszPreviewWndClass;
-    RegisterClassW(&wc);
+    RegisterClassExW(&wc);
 
     registry_read_winrect(&rc);
     hMainWnd = CreateWindowExW(0, wszMainWndClass, wszAppTitle, WS_CLIPCHILDREN|WS_OVERLAPPEDWINDOW,
diff --git a/programs/wordpad/wordpad.h b/programs/wordpad/wordpad.h
index 2f774c3..2067299 100644
--- a/programs/wordpad/wordpad.h
+++ b/programs/wordpad/wordpad.h
@@ -185,11 +185,8 @@
 #define IDB_FORMATBAR 101
 
 #define IDI_WORDPAD 102
-#define IDI_RTF 103
-#define IDI_WRI 104
-#define IDI_TXT 105
 
-#define IDC_ZOOM 106
+#define IDC_ZOOM 103
 
 #define STRING_ALL_FILES 1400
 #define STRING_TEXT_FILES_TXT 1401
diff --git a/programs/wordpad/wri.ico b/programs/wordpad/wri.ico
deleted file mode 100644
index d011356..0000000
Binary files a/programs/wordpad/wri.ico and /dev/null differ




More information about the wine-cvs mailing list