Revision: 7488 http://sourceforge.jp/projects/ttssh2/scm/svn/commits/7488 Author: zmatsuo Date: 2019-03-17 01:20:46 +0900 (Sun, 17 Mar 2019) Log Message: ----------- keycodeをUNICODE文字セットでビルドできるようにした Modified Paths: -------------- trunk/teraterm/keycode/keycode.c -------------- next part -------------- Modified: trunk/teraterm/keycode/keycode.c =================================================================== --- trunk/teraterm/keycode/keycode.c 2019-03-16 16:20:33 UTC (rev 7487) +++ trunk/teraterm/keycode/keycode.c 2019-03-16 16:20:46 UTC (rev 7488) @@ -32,9 +32,10 @@ #include <windows.h> #include <stdio.h> #include <string.h> +#include <tchar.h> #include "kc_res.h" -#define ClassName "KeyCodeWin32" +#define ClassName _T("KeyCodeWin32") #include "compat_w95.h" @@ -64,7 +65,7 @@ DoCover_IsDebuggerPresent(); - if ((module = GetModuleHandle("kernel32.dll")) != NULL) { + if ((module = GetModuleHandleA("kernel32.dll")) != NULL) { if ((setDefDllDir = (pSetDefDllDir)GetProcAddress(module, "SetDefaultDllDirectories")) != NULL) { // SetDefaultDllDirectories() \x82\xAA\x8Eg\x82\xA6\x82\xE9\x8Fꍇ\x82́A\x8C\x9F\x8D\xF5\x83p\x83X\x82\xF0 %WINDOWS%\system32 \x82݂̂ɐݒ肷\x82\xE9 (*setDefDllDir)((DWORD)0x00000800); // LOAD_LIBRARY_SEARCH_SYSTEM32 @@ -93,7 +94,7 @@ ghInstance = hInstance; hWnd = CreateWindow(ClassName, - "Key code for Tera Term", + _T("Key code for Tera Term"), WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, @@ -174,10 +175,10 @@ if (KeyDown) { _snprintf_s(OutStr,sizeof(OutStr),_TRUNCATE,"Key code is %u.",Scan); - TextOut(hDC,10,10,OutStr,strlen(OutStr)); + TextOutA(hDC,10,10,OutStr,strlen(OutStr)); } else { - TextOut(hDC,10,10,"Push any key.",13); + TextOutA(hDC,10,10,"Push any key.",13); } EndPaint(hWnd, &ps);