svnno****@sourc*****
svnno****@sourc*****
2009年 6月 9日 (火) 01:25:42 JST
Revision: 3455 http://svn.sourceforge.jp/view?root=ttssh2&view=rev&rev=3455 Author: maya Date: 2009-06-09 01:25:42 +0900 (Tue, 09 Jun 2009) Log Message: ----------- NT4 㧠32bit ã¢ã¤ã³ã³ã表示ãããã¨ãã¦å´©ããã®ã§ãTera Term åæ§ LR_VGACOLOR ãæå®ããããã«ããã Modified Paths: -------------- trunk/ttpmenu/resource.h trunk/ttpmenu/ttpmenu.cpp trunk/ttpmenu/ttpmenu.rc -------------- next part -------------- Modified: trunk/ttpmenu/resource.h =================================================================== --- trunk/ttpmenu/resource.h 2009-06-08 15:55:59 UTC (rev 3454) +++ trunk/ttpmenu/resource.h 2009-06-08 16:25:42 UTC (rev 3455) @@ -44,6 +44,7 @@ #define BUTTON_INITFILE 1035 #define EDIT_PROMPT_USER 1036 #define STATIC_ICON 1036 +#define IDC_TTPMENU_ICON 1036 #define EDIT_PROMPT_PASS 1037 #define CHECK_TTSSH 1037 #define EDIT_OPTION 1038 Modified: trunk/ttpmenu/ttpmenu.cpp =================================================================== --- trunk/ttpmenu/ttpmenu.cpp 2009-06-08 15:55:59 UTC (rev 3454) +++ trunk/ttpmenu/ttpmenu.cpp 2009-06-08 16:25:42 UTC (rev 3455) @@ -28,6 +28,7 @@ HWND g_hWndMenu = NULL; // Ýè_CAOÌnh HWND g_hWndTip; // Ýè_CAOàc[`bvÌnh HICON g_hIcon; // AvP[VACRÌnh +HICON g_hIconSmall; // AvP[VACR(16x16)Ình HMENU g_hMenu; // j [iñ\¦jÌnh HMENU g_hSubMenu; // |bvAbvj [Ình HMENU g_hListMenu; // Ýèê|bvAbvj [Ình @@ -982,7 +983,7 @@ nid.uID = TTERM_ICON; nid.uFlags = NIF_ICON | NIF_TIP | NIF_MESSAGE; nid.uCallbackMessage = WM_TMENU_NOTIFY; - nid.hIcon = g_hIcon; + nid.hIcon = g_hIconSmall; lstrcpy(nid.szTip, "TeraTerm Menu"); ::Shell_NotifyIcon(dwMessage, &nid); @@ -2312,7 +2313,8 @@ ::EndDialog(hWnd, FALSE); } SetDlgPos(hWnd, POSITION_CENTER); - ::SetClassLong(hWnd, GCL_HICON, (LONG) g_hIcon); + PostMessage(hWnd, WM_SETICON, ICON_BIG, (LPARAM)g_hIcon); + PostMessage(hWnd, WM_SETICON, ICON_SMALL, (LPARAM)g_hIconSmall); CreateTooltip(); crText = ::GetSysColor(COLOR_WINDOWTEXT); crBkgnd = ::GetSysColor(COLOR_WINDOW); @@ -2411,7 +2413,9 @@ switch(uMsg) { case WM_INITDIALOG: SetDlgPos(hWnd, POSITION_CENTER); - ::SetClassLong(hWnd, GCL_HICON, (LONG) g_hIcon); + PostMessage(hWnd, WM_SETICON, ICON_BIG, (LPARAM)g_hIcon); + PostMessage(hWnd, WM_SETICON, ICON_SMALL, (LPARAM)g_hIconSmall); + SendDlgItemMessage(hWnd, IDC_TTPMENU_ICON, STM_SETICON, (WPARAM)g_hIcon, 0); InitVersionDlg(hWnd); return TRUE; case WM_COMMAND: @@ -2451,7 +2455,8 @@ switch(uMsg) { case WM_CREATE: - ::SetClassLong(hWnd, GCL_HICON, (LONG) g_hIcon); + PostMessage(hWnd, WM_SETICON, ICON_BIG, (LPARAM)g_hIcon); + PostMessage(hWnd, WM_SETICON, ICON_SMALL, (LPARAM)g_hIconSmall); SetDlgPos(hWnd, POSITION_CENTER); ::ShowWindow(hWnd, SW_HIDE); SetTaskTray(hWnd, NIM_ADD); @@ -2576,6 +2581,7 @@ WNDCLASS winClass; char uimsg[MAX_UIMSG]; DWORD dwErr; + int fuLoad = LR_DEFAULTCOLOR; // CXg[ÅÀsðo·é½ßÉ mutex ð쬷é (2006.8.12 maya) // 2dN®h~̽ßÅÍÈ¢ÌÅAÁÉÔèlÍ©È¢ @@ -2586,9 +2592,14 @@ GetUILanguageFile(UILanguageFile, sizeof(UILanguageFile)); - g_hI = hI; - g_hIcon = ::LoadIcon(g_hI, (LPCSTR) TTERM_ICON); + g_hI = hI; + if (is_NT4()){ + fuLoad = LR_VGACOLOR; + } + g_hIcon = (HICON)::LoadImage(g_hI, MAKEINTRESOURCE(TTERM_ICON), IMAGE_ICON, 32, 32, fuLoad); + g_hIconSmall = (HICON)::LoadImage(g_hI, MAKEINTRESOURCE(TTERM_ICON), IMAGE_ICON, 16, 16, fuLoad); + memset(&winClass, 0, sizeof(winClass)); winClass.style = (CS_BYTEALIGNCLIENT | CS_BYTEALIGNWINDOW | CS_DBLCLKS); winClass.lpfnWndProc = WinProc; Modified: trunk/ttpmenu/ttpmenu.rc =================================================================== --- trunk/ttpmenu/ttpmenu.rc 2009-06-08 15:55:59 UTC (rev 3454) +++ trunk/ttpmenu/ttpmenu.rc 2009-06-08 16:25:42 UTC (rev 3455) @@ -158,7 +158,7 @@ DEFPUSHBUTTON "OK",IDOK,61,69,44,14 CTEXT "Tera Term %s\r\nTeraTerm Menu Version %d.%02d",IDC_VERSION,20,9,124,19 LTEXT "Includes:\nversion 0.94r2\nCopyright(C) 1997-2003 S.Hayakawa\r\nCopyright(C) 2004-2007 TeraTerm Project",IDC_INCLUDE,13,31,150,35 - ICON TTERM_ICON,STATIC_ICON,4,8,21,20 + ICON "",IDC_TTPMENU_ICON,4,8,20,20 END