[ttssh2-commit] [9472] LoadImageW() を layer_for_unicode に追加

アーカイブの一覧に戻る
scmno****@osdn***** scmno****@osdn*****
2021年 10月 17日 (日) 01:11:19 JST


Revision: 9472
          https://osdn.net/projects/ttssh2/scm/svn/commits/9472
Author:   zmatsuo
Date:     2021-10-17 01:11:19 +0900 (Sun, 17 Oct 2021)
Log Message:
-----------
LoadImageW() を layer_for_unicode に追加

Modified Paths:
--------------
    trunk/teraterm/layer_for_unicode/init_ptr.cpp
    trunk/teraterm/layer_for_unicode/layer_for_unicode.cpp
    trunk/teraterm/layer_for_unicode/layer_for_unicode.h
    trunk/teraterm/layer_for_unicode/symbol_list.txt
    trunk/teraterm/ttpdlg/ttdlg.c

-------------- next part --------------
Modified: trunk/teraterm/layer_for_unicode/init_ptr.cpp
===================================================================
--- trunk/teraterm/layer_for_unicode/init_ptr.cpp	2021-10-14 14:52:23 UTC (rev 9471)
+++ trunk/teraterm/layer_for_unicode/init_ptr.cpp	2021-10-16 16:11:19 UTC (rev 9472)
@@ -30,7 +30,7 @@
 
 #include "codeconv.h"
 
-// #define ALWAYS_ANSI	1
+#define ALWAYS_ANSI	1
 
 static bool IsWindowsNTKernel(void)
 {

Modified: trunk/teraterm/layer_for_unicode/layer_for_unicode.cpp
===================================================================
--- trunk/teraterm/layer_for_unicode/layer_for_unicode.cpp	2021-10-14 14:52:23 UTC (rev 9471)
+++ trunk/teraterm/layer_for_unicode/layer_for_unicode.cpp	2021-10-16 16:11:19 UTC (rev 9472)
@@ -822,3 +822,17 @@
 	free(strA);
 	return len;
 }
+
+HANDLE WINAPI _LoadImageW(HINSTANCE hInst, LPCWSTR name, UINT type,
+						  int cx, int cy, UINT fuLoad)
+{
+	HANDLE handle;
+	if (HIWORD(name) == 0) {
+		handle = LoadImageA(hInst, (LPCSTR)name, type, cx, cy, fuLoad);
+	} else {
+		char *nameA = ToCharW(name);
+		handle = LoadImageA(hInst, nameA, type, cx, cy, fuLoad);
+		free(nameA);
+	}
+	return handle;
+}

Modified: trunk/teraterm/layer_for_unicode/layer_for_unicode.h
===================================================================
--- trunk/teraterm/layer_for_unicode/layer_for_unicode.h	2021-10-14 14:52:23 UTC (rev 9471)
+++ trunk/teraterm/layer_for_unicode/layer_for_unicode.h	2021-10-16 16:11:19 UTC (rev 9472)
@@ -66,6 +66,8 @@
 LRESULT WINAPI _DefWindowProcW(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
 BOOL WINAPI _ModifyMenuW(HMENU hMnu, UINT uPosition, UINT uFlags, UINT_PTR uIDNewItem, LPCWSTR lpNewItem);
 int WINAPI _GetMenuStringW(HMENU hMenu, UINT uIDItem, LPWSTR lpString, int cchMax, UINT flags);
+HANDLE WINAPI _LoadImageW(HINSTANCE hInst, LPCWSTR name, UINT type,
+						  int cx, int cy, UINT fuLoad);
 
 // kernel32.dll
 DWORD WINAPI _GetFileAttributesW(LPCWSTR lpFileName);

Modified: trunk/teraterm/layer_for_unicode/symbol_list.txt
===================================================================
--- trunk/teraterm/layer_for_unicode/symbol_list.txt	2021-10-14 14:52:23 UTC (rev 9471)
+++ trunk/teraterm/layer_for_unicode/symbol_list.txt	2021-10-16 16:11:19 UTC (rev 9472)
@@ -19,6 +19,7 @@
 user32 DefWindowProcW @ 16
 user32 ModifyMenuW @ 20
 user32 GetMenuStringW @ 20
+user32 LoadImageW @ 24
 
 kernel32 GetFileAttributesW @ 4
 kernel32 GetModuleFileNameW @ 12

Modified: trunk/teraterm/ttpdlg/ttdlg.c
===================================================================
--- trunk/teraterm/ttpdlg/ttdlg.c	2021-10-14 14:52:23 UTC (rev 9471)
+++ trunk/teraterm/ttpdlg/ttdlg.c	2021-10-16 16:11:19 UTC (rev 9472)
@@ -2539,20 +2539,7 @@
 		if (IsWindowsNT4()) {
 			fuLoad = LR_VGACOLOR;
 		}
-#if 0
-		// TODO 9x
 		hIcon = LoadImageW(hInst, name, IMAGE_ICON, cx, cy, fuLoad);
-#else
-		{
-			if (HIWORD(name) == 0) {
-				hIcon = LoadImageA(hInst, (LPCSTR)name, IMAGE_ICON, cx, cy, fuLoad);
-			} else {
-				char *nameA = ToCharW(name);
-				hIcon = LoadImageA(hInst, nameA, IMAGE_ICON, cx, cy, fuLoad);
-				free(nameA);
-			}
-		}
-#endif
 	}
 	return hIcon;
 }


ttssh2-commit メーリングリストの案内
アーカイブの一覧に戻る