Revision: 8230 https://osdn.net/projects/ttssh2/scm/svn/commits/8230 Author: yasuhide Date: 2019-09-26 02:59:23 +0900 (Thu, 26 Sep 2019) Log Message: ----------- [Tooltip] trunk(r8225まで)をマージした r8210 | エラーチェックのif文をシンプルにした r8211 | cmakeビルドで delayload オプションを追加 r8216 | シリアルポート設定ダイアログの詳細情報に、COMポートとデバイスドライバの情報を表示するようにした。 r8217 | シリアルポート設定ダイアログの3ボタン(OK, Cancel, Help)の幅と高さが合うようにサイズ調整した。 r8218 | SSHユーザ認証ダイアログで、ユーザ欄からTABキーでパスフレーズ欄への移動に遅延がある問題を改善した。 r8219 | cmakeでビルドできるように調整 r8220 | SSHユーザー名オプションボタンのTABストップを修正 r8221 | r8220 の改版履歴を追加した。 r8225 | コモンダイアログのヘルプボタンが機能するよう修正 Revision Links: -------------- https://osdn.net/projects/ttssh2/scm/svn/commits/8210 https://osdn.net/projects/ttssh2/scm/svn/commits/8211 https://osdn.net/projects/ttssh2/scm/svn/commits/8216 https://osdn.net/projects/ttssh2/scm/svn/commits/8217 https://osdn.net/projects/ttssh2/scm/svn/commits/8218 https://osdn.net/projects/ttssh2/scm/svn/commits/8219 https://osdn.net/projects/ttssh2/scm/svn/commits/8220 https://osdn.net/projects/ttssh2/scm/svn/commits/8221 https://osdn.net/projects/ttssh2/scm/svn/commits/8220 https://osdn.net/projects/ttssh2/scm/svn/commits/8225 Modified Paths: -------------- branches/tootip_classify/TTProxy/CMakeLists.txt branches/tootip_classify/doc/en/html/about/history.html branches/tootip_classify/doc/ja/html/about/history.html branches/tootip_classify/teraterm/teraterm/CMakeLists.txt branches/tootip_classify/teraterm/teraterm/filesys.cpp branches/tootip_classify/teraterm/teraterm/ftdlg.cpp branches/tootip_classify/teraterm/teraterm/tekwin.cpp branches/tootip_classify/teraterm/teraterm/tekwin.h branches/tootip_classify/teraterm/teraterm/ttermpro.v10.vcxproj branches/tootip_classify/teraterm/teraterm/ttermpro.v11.vcxproj branches/tootip_classify/teraterm/teraterm/ttermpro.v12.vcxproj branches/tootip_classify/teraterm/teraterm/ttermpro.v14.vcxproj branches/tootip_classify/teraterm/teraterm/ttermpro.v15.vcxproj branches/tootip_classify/teraterm/teraterm/ttermpro.v15.vcxproj.filters branches/tootip_classify/teraterm/teraterm/ttermpro.v16.vcxproj branches/tootip_classify/teraterm/teraterm/ttermpro.v16.vcxproj.filters branches/tootip_classify/teraterm/teraterm/ttermpro.v9.vcproj branches/tootip_classify/teraterm/teraterm/ttermpro.vcproj branches/tootip_classify/teraterm/teraterm/ttwinman.c branches/tootip_classify/teraterm/teraterm/ttwinman.h branches/tootip_classify/teraterm/teraterm/vtwin.cpp branches/tootip_classify/teraterm/teraterm/vtwin.h branches/tootip_classify/teraterm/ttpcmn/CMakeLists.txt branches/tootip_classify/teraterm/ttpcmn/ttpcmn.v10.vcxproj branches/tootip_classify/teraterm/ttpcmn/ttpcmn.v11.vcxproj branches/tootip_classify/teraterm/ttpcmn/ttpcmn.v12.vcxproj branches/tootip_classify/teraterm/ttpcmn/ttpcmn.v14.vcxproj branches/tootip_classify/teraterm/ttpcmn/ttpcmn.v15.vcxproj branches/tootip_classify/teraterm/ttpcmn/ttpcmn.v15.vcxproj.filters branches/tootip_classify/teraterm/ttpcmn/ttpcmn.v16.vcxproj branches/tootip_classify/teraterm/ttpcmn/ttpcmn.v16.vcxproj.filters branches/tootip_classify/teraterm/ttpcmn/ttpcmn.v9.vcproj branches/tootip_classify/teraterm/ttpcmn/ttpcmn.vcproj branches/tootip_classify/teraterm/ttpdlg/ttdlg.c branches/tootip_classify/teraterm/ttpdlg/ttpdlg.rc branches/tootip_classify/ttssh2/ttxssh/CMakeLists.txt branches/tootip_classify/ttssh2/ttxssh/auth.c Added Paths: ----------- branches/tootip_classify/teraterm/ttpcmn/comportinfo.cpp branches/tootip_classify/teraterm/ttpcmn/comportinfo.h branches/tootip_classify/teraterm/ttpcmn/devpkey_teraterm.h -------------- next part -------------- Modified: branches/tootip_classify/TTProxy/CMakeLists.txt =================================================================== --- branches/tootip_classify/TTProxy/CMakeLists.txt 2019-09-25 17:59:21 UTC (rev 8229) +++ branches/tootip_classify/TTProxy/CMakeLists.txt 2019-09-25 17:59:23 UTC (rev 8230) @@ -8,6 +8,10 @@ include(${CMAKE_CURRENT_SOURCE_DIR}/../libs/lib_openssl.cmake) +if (MSVC) + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DELAYLOAD:user32.dll") +endif() + set(COMMON_SRC ../teraterm/common/ttlib.h ../teraterm/common/ttlib.c Modified: branches/tootip_classify/doc/en/html/about/history.html =================================================================== --- branches/tootip_classify/doc/en/html/about/history.html 2019-09-25 17:59:21 UTC (rev 8229) +++ branches/tootip_classify/doc/en/html/about/history.html 2019-09-25 17:59:23 UTC (rev 8230) @@ -59,6 +59,7 @@ <ul> <li>The toolchip during resizing can not be displayed on the left and top edge of the desktop. This bug was introduced in 4.103.</li> <li>Eterm look-feel: When a image file is randomly selected with the wallpaper, invalid file may be selected. </li> + <!--li>\x83R\x83\x82\x83\x93\x83_\x83C\x83A\x83\x8D\x83O\x82̃w\x83\x8B\x83v\x83{\x83^\x83\x93\x82\xAA\x8B@\x94\\x82\xB7\x82\xE9\x82悤\x8FC\x90\xB3\x82\xB5\x82\xBD\x81B4.104\x82ł̃G\x83\x93\x83o\x83O\x81B</li--> </ul> </li> @@ -3221,6 +3222,8 @@ <li>The same messages may be included on MessageBox displaying.</li> <li>When the network is disconnected from SSH server side, an application fault may be occurred while known_hosts dialog is shown.</li> <li>SSH1: The <a href="../commandline/ttssh.html#nosecuritywarning">/nosecuritywarning</a> option does not work well.</li> + <li>The problem is improved in the user authentication dialog that the delay occurs when the focus is moved from the user name to passphrase by using TAB key after entering the user name.</li> + <li>When the user name is left blank in the user authentication dialog, the focus may not be moved from the user name to the pull-down menu on the right side with TAB key.</li> </ul> </li> </ul> Modified: branches/tootip_classify/doc/ja/html/about/history.html =================================================================== --- branches/tootip_classify/doc/ja/html/about/history.html 2019-09-25 17:59:21 UTC (rev 8229) +++ branches/tootip_classify/doc/ja/html/about/history.html 2019-09-25 17:59:23 UTC (rev 8230) @@ -59,6 +59,7 @@ <ul> <li>\x83\x8A\x83T\x83C\x83Y\x92\x86\x82̏c\x89\xA1\x83T\x83C\x83Y\x83c\x81[\x83\x8B\x83`\x83b\x83v\x82\xAA\x81A\x83f\x83X\x83N\x83g\x83b\x83v\x82̍\xB6\x92[\x82Ə\xE3\x92[\x82ŕ\\x8E\xA6\x82\xB3\x82\xEA\x82Ȃ\xAD\x82Ȃ\xC1\x82Ă\xA2\x82\xBD\x96\xE2\x91\xE8\x82\xF0\x8FC\x90\xB3\x82\xB5\x82\xBD\x81B4.103\x82ł̃G\x83\x93\x83o\x83O\x81B</li> <li>Eterm look-feel: \x95ǎ\x86\x82ƍ\xAC\x8D\x87\x82\xB7\x82\xE9\x89摜\x83t\x83@\x83C\x83\x8B\x82\xF0\x83\x89\x83\x93\x83_\x83\x80\x82ɑI\x91\xF0\x82\xB7\x82\xE9\x8DہA\x96\xB3\x8AW\x82ȃt\x83@\x83C\x83\x8B\x82\xF0\x91I\x91\xF0\x82\xB7\x82邱\x82Ƃ\xAA\x82\xA0\x82\xE9\x96\xE2\x91\xE8\x82\xF0\x8FC\x90\xB3\x82\xB5\x82\xBD\x81B</li> + <li>\x83R\x83\x82\x83\x93\x83_\x83C\x83A\x83\x8D\x83O\x82̃w\x83\x8B\x83v\x83{\x83^\x83\x93\x82\xAA\x8B@\x94\\x82\xB7\x82\xE9\x82悤\x8FC\x90\xB3\x82\xB5\x82\xBD\x81B4.104\x82ł̃G\x83\x93\x83o\x83O\x81B</li> </ul> </li> @@ -3227,6 +3228,8 @@ <li>\x83\x81\x83b\x83Z\x81[\x83W\x83{\x83b\x83N\x83X\x82̕\\x8E\xA6\x82ɓ\xAF\x88ꃁ\x83b\x83Z\x81[\x83W\x82\xAA\x95\xA1\x90\x94\x8A܂܂\xEA\x82邱\x82Ƃ\xAA\x82\xA0\x82\xE9\x96\xE2\x91\xE8\x82\xF0\x8FC\x90\xB3\x82\xB5\x82\xBD\x81B</li> <li>known_hosts\x83_\x83C\x83A\x83\x8D\x83O\x82̕\\x8E\xA6\x92\x86\x82\xC9SSH\x83T\x81[\x83o\x91\xA4\x82\xA9\x82\xE7\x83l\x83b\x83g\x83\x8F\x81[\x83N\x90ؒf\x82\xB3\x82\xEA\x82\xE9\x82ƁA\x83A\x83v\x83\x8A\x82\xAA\x83N\x83\x89\x83b\x83V\x83\x85\x82\xB7\x82邱\x82Ƃ\xAA\x82\xA0\x82\xE9\x96\xE2\x91\xE8\x82\xF0\x8FC\x90\xB3\x82\xB5\x82\xBD\x81B</li> <li>SSH1: <a href="../commandline/ttssh.html#nosecuritywarning">/nosecuritywarning</a>\x83I\x83v\x83V\x83\x87\x83\x93\x82\xAA\x8B@\x94\\x82\xB5\x82Ă\xA2\x82Ȃ\xA9\x82\xC1\x82\xBD\x96\xE2\x91\xE8\x82\xF0\x8FC\x90\xB3\x82\xB5\x82\xBD\x81B</li> + <li>\x83\x86\x81[\x83U\x94F\x8F_\x83C\x83A\x83\x8D\x83O\x82ŁA\x83\x86\x81[\x83U\x96\xBC\x82\xF0\x93\xFC\x97͌\xE3\x82\xCCTAB\x83L\x81[\x82Ńp\x83X\x83t\x83\x8C\x81[\x83Y\x97\x93\x82ւ̈ړ\xAE\x82ɒx\x89\x84\x82\xAA\x82\xA0\x82\xE9\x96\xE2\x91\xE8\x82\xF0\x89\xFC\x91P\x82\xB5\x82\xBD\x81B</li> + <li>\x83\x86\x81[\x83U\x94F\x8F_\x83C\x83A\x83\x8D\x83O\x82ŁA\x83\x86\x81[\x83U\x96\xBC\x82\xF0\x8Bɂ\xB5\x82\xBD\x8C\xE3\x81ATAB\x83L\x81[\x82ʼnE\x91\xA4\x82̃v\x83\x8B\x83_\x83E\x83\x93\x83\x81\x83j\x83\x85\x81[\x82Ƀt\x83H\x81[\x83J\x83X\x88ړ\xAE\x82\xB5\x82Ȃ\xA2\x82\xB1\x82Ƃ\xAA\x82\xA0\x82\xE9\x96\xE2\x91\xE8\x82\xF0\x8FC\x90\xB3\x82\xB5\x82\xBD\x81B</li> </ul> </li> </ul> Modified: branches/tootip_classify/teraterm/teraterm/CMakeLists.txt =================================================================== --- branches/tootip_classify/teraterm/teraterm/CMakeLists.txt 2019-09-25 17:59:21 UTC (rev 8229) +++ branches/tootip_classify/teraterm/teraterm/CMakeLists.txt 2019-09-25 17:59:23 UTC (rev 8230) @@ -6,9 +6,6 @@ if(USE_UNICODE_API) add_definitions(-DUNICODE -D_UNICODE) endif() -if(ENABLE_DPIAWARENESS) - add_definitions(-DDPIAWARENESS) -endif() set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/") @@ -174,6 +171,7 @@ ../common ../ttpfile ../ttpdlg + ../ttpcmn ${ONIGURUMA_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR}/../ttpdlg # for svnversion.h ${SFMT_INCLUDE_DIRS} Modified: branches/tootip_classify/teraterm/teraterm/filesys.cpp =================================================================== --- branches/tootip_classify/teraterm/teraterm/filesys.cpp 2019-09-25 17:59:21 UTC (rev 8229) +++ branches/tootip_classify/teraterm/teraterm/filesys.cpp 2019-09-25 17:59:23 UTC (rev 8230) @@ -43,7 +43,6 @@ #include "ttcommon.h" #include "ttdde.h" #include "ttlib.h" -#include "helpid.h" #include "dlglib.h" #include "vtterm.h" #include "win16api.h" @@ -639,7 +638,6 @@ if (ts.LogHideDialog) LogVar->HideDialog = 1; - HelpId = HlpFileLog; /* 2007.05.24 Gentaro */ eLineEnd = Line_LineHead; Modified: branches/tootip_classify/teraterm/teraterm/ftdlg.cpp =================================================================== --- branches/tootip_classify/teraterm/teraterm/ftdlg.cpp 2019-09-25 17:59:21 UTC (rev 8229) +++ branches/tootip_classify/teraterm/teraterm/ftdlg.cpp 2019-09-25 17:59:23 UTC (rev 8230) @@ -43,6 +43,7 @@ #include "tt_res.h" #include "ftdlg.h" #include "teraterml.h" +#include "helpid.h" ///////////////////////////////////////////////////////////////////////////// // CFileTransDlg dialog @@ -216,7 +217,7 @@ ChangeButton(! Pause); return TRUE; case IDC_TRANSHELP: - ::PostMessage(fv->HMainWin,WM_USER_DLGHELP2,0,0); + ::PostMessage(fv->HMainWin,WM_USER_DLGHELP2,HlpFileSend,0); return TRUE; default: return (TTCDialog::OnCommand(wParam,lParam)); Modified: branches/tootip_classify/teraterm/teraterm/tekwin.cpp =================================================================== --- branches/tootip_classify/teraterm/teraterm/tekwin.cpp 2019-09-25 17:59:21 UTC (rev 8229) +++ branches/tootip_classify/teraterm/teraterm/tekwin.cpp 2019-09-25 17:59:23 UTC (rev 8230) @@ -636,6 +636,7 @@ LRESULT CTEKWindow::OnDlgHelp(WPARAM wParam, LPARAM lParam) { + DWORD help_id = (wParam == 0) ? HelpId : wParam; OpenHelp(HH_HELP_CONTEXT, HelpId, ts.UILanguageFile); return 0; } @@ -779,6 +780,9 @@ { LRESULT retval = 0; if (msg == MsgDlgHelp) { + // HELPMSGSTRING message \x8E\x9E + // wp = dialog handle + // lp = initialization structure OnDlgHelp(wp, lp); return 0; } Modified: branches/tootip_classify/teraterm/teraterm/tekwin.h =================================================================== --- branches/tootip_classify/teraterm/teraterm/tekwin.h 2019-09-25 17:59:21 UTC (rev 8229) +++ branches/tootip_classify/teraterm/teraterm/tekwin.h 2019-09-25 17:59:23 UTC (rev 8230) @@ -38,6 +38,7 @@ TTEKVar tk; HMENU MainMenu, EditMenu, WinMenu, FileMenu, SetupMenu, HelpMenu; + LONG HelpId; public: CTEKWindow(HINSTANCE hInstance); Modified: branches/tootip_classify/teraterm/teraterm/ttermpro.v10.vcxproj =================================================================== --- branches/tootip_classify/teraterm/teraterm/ttermpro.v10.vcxproj 2019-09-25 17:59:21 UTC (rev 8229) +++ branches/tootip_classify/teraterm/teraterm/ttermpro.v10.vcxproj 2019-09-25 17:59:23 UTC (rev 8230) @@ -63,7 +63,7 @@ <ClCompile> <AdditionalOptions>/D"_CRT_SECURE_NO_DEPRECATE" %(AdditionalOptions)</AdditionalOptions> <Optimization>Disabled</Optimization> - <AdditionalIncludeDirectories>$(SolutionDir)..\libs\SFMT;$(SolutionDir)..\libs\oniguruma\src;$(SolutionDir)common;$(SolutionDir)ttpfile;$(SolutionDir)ttpdlg;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>$(SolutionDir)..\libs\SFMT;$(SolutionDir)..\libs\oniguruma\src;$(SolutionDir)common;$(SolutionDir)ttpfile;$(SolutionDir)ttpdlg;$(SolutionDir)ttpcmn;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <BrowseInformation> @@ -109,7 +109,7 @@ <AdditionalOptions>/D"_CRT_SECURE_NO_DEPRECATE" %(AdditionalOptions)</AdditionalOptions> <Optimization>MaxSpeed</Optimization> <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> - <AdditionalIncludeDirectories>$(SolutionDir)..\libs\SFMT;$(SolutionDir)..\libs\oniguruma\src;$(SolutionDir)common;$(SolutionDir)ttpfile;$(SolutionDir)ttpdlg;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>$(SolutionDir)..\libs\SFMT;$(SolutionDir)..\libs\oniguruma\src;$(SolutionDir)common;$(SolutionDir)ttpfile;$(SolutionDir)ttpdlg;$(SolutionDir)ttpcmn;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <StringPooling>true</StringPooling> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> Modified: branches/tootip_classify/teraterm/teraterm/ttermpro.v11.vcxproj =================================================================== --- branches/tootip_classify/teraterm/teraterm/ttermpro.v11.vcxproj 2019-09-25 17:59:21 UTC (rev 8229) +++ branches/tootip_classify/teraterm/teraterm/ttermpro.v11.vcxproj 2019-09-25 17:59:23 UTC (rev 8230) @@ -62,7 +62,7 @@ <ClCompile> <AdditionalOptions>/D"_CRT_SECURE_NO_DEPRECATE" %(AdditionalOptions)</AdditionalOptions> <Optimization>Disabled</Optimization> - <AdditionalIncludeDirectories>$(SolutionDir)..\libs\SFMT;$(SolutionDir)..\libs\oniguruma\src;$(SolutionDir)common;$(SolutionDir)ttpfile;$(SolutionDir)ttpdlg;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>$(SolutionDir)..\libs\SFMT;$(SolutionDir)..\libs\oniguruma\src;$(SolutionDir)common;$(SolutionDir)ttpfile;$(SolutionDir)ttpdlg;$(SolutionDir)ttpcmn;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <BrowseInformation /> @@ -106,7 +106,7 @@ <AdditionalOptions>/D"_CRT_SECURE_NO_DEPRECATE" %(AdditionalOptions)</AdditionalOptions> <Optimization>MaxSpeed</Optimization> <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> - <AdditionalIncludeDirectories>$(SolutionDir)..\libs\SFMT;$(SolutionDir)..\libs\oniguruma\src;$(SolutionDir)common;$(SolutionDir)ttpfile;$(SolutionDir)ttpdlg;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>$(SolutionDir)..\libs\SFMT;$(SolutionDir)..\libs\oniguruma\src;$(SolutionDir)common;$(SolutionDir)ttpfile;$(SolutionDir)ttpdlg;$(SolutionDir)ttpcmn;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <StringPooling>true</StringPooling> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> Modified: branches/tootip_classify/teraterm/teraterm/ttermpro.v12.vcxproj =================================================================== --- branches/tootip_classify/teraterm/teraterm/ttermpro.v12.vcxproj 2019-09-25 17:59:21 UTC (rev 8229) +++ branches/tootip_classify/teraterm/teraterm/ttermpro.v12.vcxproj 2019-09-25 17:59:23 UTC (rev 8230) @@ -62,7 +62,7 @@ <ClCompile> <AdditionalOptions>/D"_CRT_SECURE_NO_DEPRECATE" %(AdditionalOptions)</AdditionalOptions> <Optimization>Disabled</Optimization> - <AdditionalIncludeDirectories>$(SolutionDir)..\libs\SFMT;$(SolutionDir)..\libs\oniguruma\src;$(SolutionDir)common;$(SolutionDir)ttpfile;$(SolutionDir)ttpdlg;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>$(SolutionDir)..\libs\SFMT;$(SolutionDir)..\libs\oniguruma\src;$(SolutionDir)common;$(SolutionDir)ttpfile;$(SolutionDir)ttpdlg;$(SolutionDir)ttpcmn;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <BrowseInformation /> @@ -106,7 +106,7 @@ <AdditionalOptions>/D"_CRT_SECURE_NO_DEPRECATE" %(AdditionalOptions)</AdditionalOptions> <Optimization>MaxSpeed</Optimization> <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> - <AdditionalIncludeDirectories>$(SolutionDir)..\libs\SFMT;$(SolutionDir)..\libs\oniguruma\src;$(SolutionDir)common;$(SolutionDir)ttpfile;$(SolutionDir)ttpdlg;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>$(SolutionDir)..\libs\SFMT;$(SolutionDir)..\libs\oniguruma\src;$(SolutionDir)common;$(SolutionDir)ttpfile;$(SolutionDir)ttpdlg;$(SolutionDir)ttpcmn;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <StringPooling>true</StringPooling> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> Modified: branches/tootip_classify/teraterm/teraterm/ttermpro.v14.vcxproj =================================================================== --- branches/tootip_classify/teraterm/teraterm/ttermpro.v14.vcxproj 2019-09-25 17:59:21 UTC (rev 8229) +++ branches/tootip_classify/teraterm/teraterm/ttermpro.v14.vcxproj 2019-09-25 17:59:23 UTC (rev 8230) @@ -64,7 +64,7 @@ <ClCompile> <AdditionalOptions>/D"_CRT_SECURE_NO_DEPRECATE" %(AdditionalOptions)</AdditionalOptions> <Optimization>Disabled</Optimization> - <AdditionalIncludeDirectories>$(SolutionDir)..\libs\SFMT;$(SolutionDir)..\libs\oniguruma\src;$(SolutionDir)common;$(SolutionDir)ttpfile;$(SolutionDir)ttpdlg;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>$(SolutionDir)..\libs\SFMT;$(SolutionDir)..\libs\oniguruma\src;$(SolutionDir)common;$(SolutionDir)ttpfile;$(SolutionDir)ttpdlg;$(SolutionDir)ttpcmn;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <BrowseInformation /> @@ -108,7 +108,7 @@ <AdditionalOptions>/D"_CRT_SECURE_NO_DEPRECATE" %(AdditionalOptions)</AdditionalOptions> <Optimization>MaxSpeed</Optimization> <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> - <AdditionalIncludeDirectories>$(SolutionDir)..\libs\SFMT;$(SolutionDir)..\libs\oniguruma\src;$(SolutionDir)common;$(SolutionDir)ttpfile;$(SolutionDir)ttpdlg;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>$(SolutionDir)..\libs\SFMT;$(SolutionDir)..\libs\oniguruma\src;$(SolutionDir)common;$(SolutionDir)ttpfile;$(SolutionDir)ttpdlg;$(SolutionDir)ttpcmn;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <StringPooling>true</StringPooling> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> Modified: branches/tootip_classify/teraterm/teraterm/ttermpro.v15.vcxproj =================================================================== --- branches/tootip_classify/teraterm/teraterm/ttermpro.v15.vcxproj 2019-09-25 17:59:21 UTC (rev 8229) +++ branches/tootip_classify/teraterm/teraterm/ttermpro.v15.vcxproj 2019-09-25 17:59:23 UTC (rev 8230) @@ -65,7 +65,7 @@ <ClCompile> <AdditionalOptions>/D"_CRT_SECURE_NO_DEPRECATE" %(AdditionalOptions)</AdditionalOptions> <Optimization>Disabled</Optimization> - <AdditionalIncludeDirectories>$(SolutionDir)..\libs\SFMT;$(SolutionDir)..\libs\oniguruma\src;$(SolutionDir)common;$(SolutionDir)ttpfile;$(SolutionDir)ttpdlg;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>$(SolutionDir)..\libs\SFMT;$(SolutionDir)..\libs\oniguruma\src;$(SolutionDir)common;$(SolutionDir)ttpfile;$(SolutionDir)ttpdlg;$(SolutionDir)ttpcmn;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <BrowseInformation /> @@ -110,7 +110,7 @@ <AdditionalOptions>/D"_CRT_SECURE_NO_DEPRECATE" %(AdditionalOptions)</AdditionalOptions> <Optimization>MaxSpeed</Optimization> <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> - <AdditionalIncludeDirectories>$(SolutionDir)..\libs\SFMT;$(SolutionDir)..\libs\oniguruma\src;$(SolutionDir)common;$(SolutionDir)ttpfile;$(SolutionDir)ttpdlg;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>$(SolutionDir)..\libs\SFMT;$(SolutionDir)..\libs\oniguruma\src;$(SolutionDir)common;$(SolutionDir)ttpfile;$(SolutionDir)ttpdlg;$(SolutionDir)ttpcmn;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <StringPooling>true</StringPooling> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> @@ -278,4 +278,4 @@ <UserProperties RESOURCE_FILE="ttermpro.rc" /> </VisualStudio> </ProjectExtensions> -</Project> +</Project> \ No newline at end of file Modified: branches/tootip_classify/teraterm/teraterm/ttermpro.v15.vcxproj.filters =================================================================== --- branches/tootip_classify/teraterm/teraterm/ttermpro.v15.vcxproj.filters 2019-09-25 17:59:21 UTC (rev 8229) +++ branches/tootip_classify/teraterm/teraterm/ttermpro.v15.vcxproj.filters 2019-09-25 17:59:23 UTC (rev 8230) @@ -312,5 +312,8 @@ <ClInclude Include="..\common\tmfc.h"> <Filter>Header Files</Filter> </ClInclude> + <ClInclude Include="..\common\tipwin.h"> + <Filter>Header Files</Filter> + </ClInclude> </ItemGroup> </Project> \ No newline at end of file Modified: branches/tootip_classify/teraterm/teraterm/ttermpro.v16.vcxproj =================================================================== --- branches/tootip_classify/teraterm/teraterm/ttermpro.v16.vcxproj 2019-09-25 17:59:21 UTC (rev 8229) +++ branches/tootip_classify/teraterm/teraterm/ttermpro.v16.vcxproj 2019-09-25 17:59:23 UTC (rev 8230) @@ -65,7 +65,7 @@ <ClCompile> <AdditionalOptions>/D"_CRT_SECURE_NO_DEPRECATE" %(AdditionalOptions)</AdditionalOptions> <Optimization>Disabled</Optimization> - <AdditionalIncludeDirectories>$(SolutionDir)..\libs\SFMT;$(SolutionDir)..\libs\oniguruma\src;$(SolutionDir)common;$(SolutionDir)ttpfile;$(SolutionDir)ttpdlg;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>$(SolutionDir)..\libs\SFMT;$(SolutionDir)..\libs\oniguruma\src;$(SolutionDir)common;$(SolutionDir)ttpfile;$(SolutionDir)ttpdlg;$(SolutionDir)ttpcmn;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <BrowseInformation /> @@ -110,7 +110,7 @@ <AdditionalOptions>/D"_CRT_SECURE_NO_DEPRECATE" %(AdditionalOptions)</AdditionalOptions> <Optimization>MaxSpeed</Optimization> <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> - <AdditionalIncludeDirectories>$(SolutionDir)..\libs\SFMT;$(SolutionDir)..\libs\oniguruma\src;$(SolutionDir)common;$(SolutionDir)ttpfile;$(SolutionDir)ttpdlg;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>$(SolutionDir)..\libs\SFMT;$(SolutionDir)..\libs\oniguruma\src;$(SolutionDir)common;$(SolutionDir)ttpfile;$(SolutionDir)ttpdlg;$(SolutionDir)ttpcmn;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <StringPooling>true</StringPooling> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> @@ -278,4 +278,4 @@ <UserProperties RESOURCE_FILE="ttermpro.rc" /> </VisualStudio> </ProjectExtensions> -</Project> +</Project> \ No newline at end of file Modified: branches/tootip_classify/teraterm/teraterm/ttermpro.v16.vcxproj.filters =================================================================== --- branches/tootip_classify/teraterm/teraterm/ttermpro.v16.vcxproj.filters 2019-09-25 17:59:21 UTC (rev 8229) +++ branches/tootip_classify/teraterm/teraterm/ttermpro.v16.vcxproj.filters 2019-09-25 17:59:23 UTC (rev 8230) @@ -312,5 +312,8 @@ <ClInclude Include="..\common\tmfc.h"> <Filter>Header Files</Filter> </ClInclude> + <ClInclude Include="..\common\tipwin.h"> + <Filter>Header Files</Filter> + </ClInclude> </ItemGroup> </Project> \ No newline at end of file Modified: branches/tootip_classify/teraterm/teraterm/ttermpro.v9.vcproj =================================================================== --- branches/tootip_classify/teraterm/teraterm/ttermpro.v9.vcproj 2019-09-25 17:59:21 UTC (rev 8229) +++ branches/tootip_classify/teraterm/teraterm/ttermpro.v9.vcproj 2019-09-25 17:59:23 UTC (rev 8230) @@ -51,7 +51,7 @@ Name="VCCLCompilerTool" AdditionalOptions="/D"_CRT_SECURE_NO_DEPRECATE"" Optimization="0" - AdditionalIncludeDirectories="$(SolutionDir)..\libs\SFMT;$(SolutionDir)..\libs\oniguruma\src;$(SolutionDir)common;$(SolutionDir)ttpfile;$(SolutionDir)ttpdlg" + AdditionalIncludeDirectories="$(SolutionDir)..\libs\SFMT;$(SolutionDir)..\libs\oniguruma\src;$(SolutionDir)common;$(SolutionDir)ttpfile;$(SolutionDir)ttpdlg;$(SolutionDir)ttpcmn" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS" RuntimeLibrary="1" BrowseInformation="0" @@ -145,7 +145,7 @@ AdditionalOptions="/D"_CRT_SECURE_NO_DEPRECATE"" Optimization="2" InlineFunctionExpansion="1" - AdditionalIncludeDirectories="$(SolutionDir)..\libs\SFMT;$(SolutionDir)..\libs\oniguruma\src;$(SolutionDir)common;$(SolutionDir)ttpfile;$(SolutionDir)ttpdlg" + AdditionalIncludeDirectories="$(SolutionDir)..\libs\SFMT;$(SolutionDir)..\libs\oniguruma\src;$(SolutionDir)common;$(SolutionDir)ttpfile;$(SolutionDir)ttpdlg;$(SolutionDir)ttpcmn" PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS" StringPooling="true" RuntimeLibrary="0" Modified: branches/tootip_classify/teraterm/teraterm/ttermpro.vcproj =================================================================== --- branches/tootip_classify/teraterm/teraterm/ttermpro.vcproj 2019-09-25 17:59:21 UTC (rev 8229) +++ branches/tootip_classify/teraterm/teraterm/ttermpro.vcproj 2019-09-25 17:59:23 UTC (rev 8230) @@ -50,7 +50,7 @@ Name="VCCLCompilerTool" AdditionalOptions="/D"_CRT_SECURE_NO_DEPRECATE"" Optimization="0" - AdditionalIncludeDirectories="$(SolutionDir)..\libs\SFMT;$(SolutionDir)..\libs\oniguruma\src;$(SolutionDir)common;$(SolutionDir)ttpfile;$(SolutionDir)ttpdlg" + AdditionalIncludeDirectories="$(SolutionDir)..\libs\SFMT;$(SolutionDir)..\libs\oniguruma\src;$(SolutionDir)common;$(SolutionDir)ttpfile;$(SolutionDir)ttpdlg;$(SolutionDir)ttpcmn" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS" RuntimeLibrary="1" BrowseInformation="0" @@ -145,7 +145,7 @@ AdditionalOptions="/D"_CRT_SECURE_NO_DEPRECATE"" Optimization="2" InlineFunctionExpansion="1" - AdditionalIncludeDirectories="$(SolutionDir)..\libs\SFMT;$(SolutionDir)..\libs\oniguruma\src;$(SolutionDir)common;$(SolutionDir)ttpfile;$(SolutionDir)ttpdlg" + AdditionalIncludeDirectories="$(SolutionDir)..\libs\SFMT;$(SolutionDir)..\libs\oniguruma\src;$(SolutionDir)common;$(SolutionDir)ttpfile;$(SolutionDir)ttpdlg;$(SolutionDir)ttpcmn" PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS" StringPooling="true" RuntimeLibrary="0" Modified: branches/tootip_classify/teraterm/teraterm/ttwinman.c =================================================================== --- branches/tootip_classify/teraterm/teraterm/ttwinman.c 2019-09-25 17:59:21 UTC (rev 8229) +++ branches/tootip_classify/teraterm/teraterm/ttwinman.c 2019-09-25 17:59:23 UTC (rev 8230) @@ -49,7 +49,6 @@ /* 'help' button on dialog box */ WORD MsgDlgHelp; -LONG HelpId; TTTSet ts; TComVar cv; Modified: branches/tootip_classify/teraterm/teraterm/ttwinman.h =================================================================== --- branches/tootip_classify/teraterm/teraterm/ttwinman.h 2019-09-25 17:59:21 UTC (rev 8229) +++ branches/tootip_classify/teraterm/teraterm/ttwinman.h 2019-09-25 17:59:23 UTC (rev 8230) @@ -49,7 +49,6 @@ /* 'help' button on dialog box */ extern WORD MsgDlgHelp; -extern LONG HelpId; extern TTTSet ts; extern TComVar cv; Modified: branches/tootip_classify/teraterm/teraterm/vtwin.cpp =================================================================== --- branches/tootip_classify/teraterm/teraterm/vtwin.cpp 2019-09-25 17:59:21 UTC (rev 8229) +++ branches/tootip_classify/teraterm/teraterm/vtwin.cpp 2019-09-25 17:59:23 UTC (rev 8230) @@ -3580,6 +3580,7 @@ if ((ts.LogFN[0]!=0) && (LogVar==NULL) && NewFileVar(&LogVar)) { LogVar->DirLen = 0; strncpy_s(LogVar->FullName, sizeof(LogVar->FullName), ts.LogFN, _TRUNCATE); + HelpId = HlpFileLog; LogStart(); } @@ -6308,7 +6309,10 @@ { LRESULT retval = 0; if (msg == MsgDlgHelp) { - OnDlgHelp(wp,lp); + // HELPMSGSTRING message \x8E\x9E + // wp = dialog handle + // lp = initialization structure + OnDlgHelp(0, 0); return 0; } switch(msg) Modified: branches/tootip_classify/teraterm/teraterm/vtwin.h =================================================================== --- branches/tootip_classify/teraterm/teraterm/vtwin.h 2019-09-25 17:59:21 UTC (rev 8229) +++ branches/tootip_classify/teraterm/teraterm/vtwin.h 2019-09-25 17:59:23 UTC (rev 8230) @@ -67,6 +67,8 @@ // TipWin CTipWin* TipWin; + LONG HelpId; + public: CVTWindow(HINSTANCE hInstance); ~CVTWindow(); Modified: branches/tootip_classify/teraterm/ttpcmn/CMakeLists.txt =================================================================== --- branches/tootip_classify/teraterm/ttpcmn/CMakeLists.txt 2019-09-25 17:59:21 UTC (rev 8229) +++ branches/tootip_classify/teraterm/ttpcmn/CMakeLists.txt 2019-09-25 17:59:23 UTC (rev 8230) @@ -33,6 +33,10 @@ language.c language.h ttcmn.c + comportinfo.cpp + comportinfo.h + comportinfo.cpp + devpkey_teraterm.h ttpcmn-version.rc ttpcmn.def ${COMMON_SRC} Added: branches/tootip_classify/teraterm/ttpcmn/comportinfo.cpp =================================================================== --- branches/tootip_classify/teraterm/ttpcmn/comportinfo.cpp (rev 0) +++ branches/tootip_classify/teraterm/ttpcmn/comportinfo.cpp 2019-09-25 17:59:23 UTC (rev 8230) @@ -0,0 +1,421 @@ +/* + * Copyright (C) 2019 TeraTerm Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +// for comportinfo_test +//#define TEST_FOR_NT +//#define TEST_FOR_9X + +#include <windows.h> +#include <devguid.h> +#include <setupapi.h> +#include <tchar.h> +#include <stdio.h> +#define _CRTDBG_MAP_ALLOC +#include <crtdbg.h> + +#include "devpkey_teraterm.h" +#include "ttlib.h" +#include "codeconv.h" + +#define DllExport __declspec(dllexport) +#include "comportinfo.h" + +typedef BOOL (WINAPI *TSetupDiGetDevicePropertyW)( + HDEVINFO DeviceInfoSet, + PSP_DEVINFO_DATA DeviceInfoData, + const DEVPROPKEY *PropertyKey, + DEVPROPTYPE *PropertyType, + PBYTE PropertyBuffer, + DWORD PropertyBufferSize, + PDWORD RequiredSize, + DWORD Flags + ); + +typedef BOOL (WINAPI *TSetupDiGetDeviceRegistryPropertyW)( + HDEVINFO DeviceInfoSet, + PSP_DEVINFO_DATA DeviceInfoData, + DWORD Property, + PDWORD PropertyRegDataType, + PBYTE PropertyBuffer, + DWORD PropertyBufferSize, + PDWORD RequiredSize + ); + +typedef LONG (WINAPI *TRegQueryValueExW)( + HKEY hKey, + LPCWSTR lpValueName, + LPDWORD lpReserved, + LPDWORD lpType, + LPBYTE lpData, + LPDWORD lpcbData + ); + +static BOOL IsWindows9X() +{ + return !IsWindowsNTKernel(); +} + +/** + * \x83|\x81[\x83g\x96\xBC\x82\xF0\x8E擾 + */ +static BOOL GetComPortName(HDEVINFO hDevInfo, SP_DEVINFO_DATA *DeviceInfoData, wchar_t **str) +{ + TRegQueryValueExW pRegQueryValueExW = + (TRegQueryValueExW)GetProcAddress( + GetModuleHandleA("ADVAPI32.dll"), "RegQueryValueExW"); + DWORD byte_len; + DWORD dwType = REG_SZ; + HKEY hKey = SetupDiOpenDevRegKey(hDevInfo, + DeviceInfoData, + DICS_FLAG_GLOBAL, + 0, DIREG_DEV, KEY_READ); + if (hKey == NULL){ + // \x83|\x81[\x83g\x96\xBC\x82\xAA\x8E擾\x82ł\xAB\x82Ȃ\xA2? + *str = NULL; + return FALSE; + } + + wchar_t* port_name = NULL; + long r; + if (pRegQueryValueExW != NULL && !IsWindows9X()) { + // 9x\x8Cn\x82ł͂\xA4\x82܂\xAD\x93\xAE\x8D삵\x82Ȃ\xA2 + r = pRegQueryValueExW(hKey, L"PortName", 0, + &dwType, NULL, &byte_len); + port_name = (wchar_t* )malloc(byte_len); + r = pRegQueryValueExW(hKey, L"PortName", 0, + &dwType, (LPBYTE)port_name, &byte_len); + } else { + r = RegQueryValueExA(hKey, "PortName", 0, + &dwType, (LPBYTE)NULL, &byte_len); + char *port_name_a = (char *)malloc(byte_len); + r = RegQueryValueExA(hKey, "PortName", 0, + &dwType, (LPBYTE)port_name_a, &byte_len); + if (r == ERROR_SUCCESS) { + size_t len_w = MultiByteToWideChar(CP_ACP, MB_ERR_INVALID_CHARS, + port_name_a, byte_len, + NULL, 0); + port_name = (wchar_t *)malloc(sizeof(wchar_t) * len_w); + MultiByteToWideChar(CP_ACP, MB_ERR_INVALID_CHARS, + port_name_a, byte_len, + port_name, (int)len_w); + } + free(port_name_a); + } + RegCloseKey(hKey); + if (r != ERROR_SUCCESS) { + free(port_name); + *str = NULL; + return FALSE; + } + *str = port_name; + return TRUE; +} + +/** + * \x83v\x83\x8D\x83p\x83e\x83B\x8E擾 + * + * \x83\x8C\x83W\x83X\x83g\x83\x8A\x82̏ꏊ(Windows10) + * HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{GUID}\0000 + * + */ +static void GetComPropartys(HDEVINFO hDevInfo, SP_DEVINFO_DATA *DeviceInfoData, const char *lang, + wchar_t **friendly_name, wchar_t **str) +{ + const char *FriendlyNameString = "FRIENDLY_NAME"; + const char *DriverDateString = "DRIVER_DATE"; + typedef struct { + const wchar_t *name; // \x96{\x8A\x94\x93\xE0\x82Ŏg\x82\xA4 + const char *key; // \x96{\x8A\x94\x93\xE0\x82Ŏg\x82\xA4 + const DEVPROPKEY *PropertyKey; // \x83\x8C\x83W\x83X\x83g\x83\x8A\x8E擾\x82Ɏg\x82\xA4\x82̂͂\xB1\x82\xEA\x82̂\xDD + DWORD Property; // \x96\xA2\x8Eg\x97p + } list_t; + static const list_t list[] = { + { L"Device Friendly Name", + FriendlyNameString, + &DEVPKEY_Device_FriendlyName, + SPDRP_FRIENDLYNAME }, + { L"Device Instance ID", + "DEVICE_INSTANCE_ID", + &DEVPKEY_Device_InstanceId, + SPDRP_MAXIMUM_PROPERTY }, + { L"Device Manufacturer", + "DEVICE_MANUFACTURER", + &DEVPKEY_Device_Manufacturer, + SPDRP_MFG }, + { L"Provider Name", + "PROVIDER_NAME", + &DEVPKEY_Device_DriverProvider, + SPDRP_MAXIMUM_PROPERTY }, + { L"Driver Date", + DriverDateString, + &DEVPKEY_Device_DriverDate, + SPDRP_MAXIMUM_PROPERTY }, + { L"Driver Version", + "DRIVER_VERSION", + &DEVPKEY_Device_DriverVersion, + SPDRP_MAXIMUM_PROPERTY }, + }; + TSetupDiGetDevicePropertyW pSetupDiGetDevicePropertyW = + (TSetupDiGetDevicePropertyW)GetProcAddress( + GetModuleHandleA("Setupapi.dll"), + "SetupDiGetDevicePropertyW"); + TSetupDiGetDeviceRegistryPropertyW pSetupDiGetDeviceRegistryPropertyW = + (TSetupDiGetDeviceRegistryPropertyW)GetProcAddress( + GetModuleHandleA("Setupapi.dll"), + "SetupDiGetDeviceRegistryPropertyW"); + + wchar_t *s = _wcsdup(L""); + size_t len = 0; + for (size_t i = 0; i < _countof(list); i++) { + const list_t *p = &list[i]; + BOOL r; + wchar_t *str_prop = NULL; + DWORD size; + + if (pSetupDiGetDevicePropertyW != NULL) { + DEVPROPTYPE ulPropertyType; + pSetupDiGetDevicePropertyW(hDevInfo, DeviceInfoData, p->PropertyKey, + &ulPropertyType, NULL, 0, &size, 0); + str_prop = (wchar_t *)malloc(size); + r = pSetupDiGetDevicePropertyW(hDevInfo, DeviceInfoData, p->PropertyKey, + &ulPropertyType, (PBYTE)str_prop, size, &size, 0); + } else if (p->PropertyKey == &DEVPKEY_Device_InstanceId) { + // InstanceId\x82\xCDA\x8Cn\x82Ō\x88\x82ߑł\xBF + DWORD len_a; + SetupDiGetDeviceInstanceIdA(hDevInfo, + DeviceInfoData, + NULL, 0, + &len_a); + char *str_instance_a = (char *)malloc(len_a); + r = SetupDiGetDeviceInstanceIdA(hDevInfo, + DeviceInfoData, + str_instance_a, len_a, + &len_a); + if (r != FALSE) { + int len_w = MultiByteToWideChar(CP_ACP, MB_ERR_INVALID_CHARS, + str_instance_a, len_a, + NULL, 0); + str_prop = (wchar_t *)malloc(sizeof(wchar_t) * len_w); + MultiByteToWideChar(CP_ACP, MB_ERR_INVALID_CHARS, + str_instance_a, len_a, + str_prop, (int)len_w); + } + free(str_instance_a); + } else if (p->Property == SPDRP_MAXIMUM_PROPERTY) { + r = FALSE; + } else if (pSetupDiGetDeviceRegistryPropertyW != NULL && !IsWindows9X()) { + // 9x\x8Cn\x82ł͂\xA4\x82܂\xAD\x93\xAE\x8D삵\x82Ȃ\xA2 + DWORD dwPropType; + r = pSetupDiGetDeviceRegistryPropertyW(hDevInfo, + DeviceInfoData, + p->Property, + &dwPropType, + NULL, 0, + &size); + str_prop = (wchar_t *)malloc(size); + r = pSetupDiGetDeviceRegistryPropertyW(hDevInfo, + DeviceInfoData, + p->Property, + &dwPropType, + (LPBYTE)str_prop, size, + &size); + } else { + DWORD dwPropType; + DWORD len_a; + r = SetupDiGetDeviceRegistryPropertyA(hDevInfo, + DeviceInfoData, + p->Property, + &dwPropType, + NULL, 0, + &len_a); + char *str_prop_a = (char *)malloc(len_a); + r = SetupDiGetDeviceRegistryPropertyA(hDevInfo, + DeviceInfoData, + p->Property, + &dwPropType, + (PBYTE)str_prop_a, len_a, + &len_a); + if (r != FALSE) { + int len_w = MultiByteToWideChar(CP_ACP, MB_ERR_INVALID_CHARS, + str_prop_a, len_a, + NULL, 0); + str_prop = (wchar_t *)malloc(sizeof(wchar_t) * len_w); + MultiByteToWideChar(CP_ACP, MB_ERR_INVALID_CHARS, + str_prop_a, len_a, + str_prop, (int)len_w); + } + free(str_prop_a); + } + if (r != FALSE) { + /* Driver Date\x82\xCD DEVPROP_TYPE_FILETIME \x82ł\xA0\x82邽\x82߁A + * FILETIME \x8D\\x91\xA2\x91̂\xCC8\x83o\x83C\x83g\x82ŕԂ邽\x82߁ASYSTEMTIME \x82ɕϊ\xB7\x82\xB7\x82\xE9\x81B + */ + if (strcmp(list[i].key, DriverDateString) == 0) { + FILETIME ftFileTime; + SYSTEMTIME stFileTime; + int wbuflen = 64; + int buflen = sizeof(wchar_t) * wbuflen; + + ZeroMemory(&ftFileTime, sizeof(FILETIME)); + if (sizeof(ftFileTime) >= size) { + // str_prop\x82\xCDsize\x83o\x83C\x83g + memcpy(&ftFileTime, str_prop, size); + } + ZeroMemory(&stFileTime, sizeof(SYSTEMTIME)); + FileTimeToSystemTime(&ftFileTime , &stFileTime); + str_prop = (wchar_t *)realloc(str_prop, buflen); + _snwprintf_s(str_prop, wbuflen, _TRUNCATE, L"%d-%d-%d", + stFileTime.wMonth, stFileTime.wDay, stFileTime.wYear + ); + } + + size_t name_len = wcslen(p->name); + size_t prop_len = wcslen(str_prop); + len = len + (name_len + (i==0?1:2) + 2 + 2 + prop_len); + s = (wchar_t *)realloc(s, sizeof(wchar_t) * len); + if (i != 0) + wcscat_s(s, len, L"\r\n"); + wcscat_s(s, len, p->name); + wcscat_s(s, len, L": "); + wcscat_s(s, len, str_prop); + } + + if (strcmp(list[i].key, FriendlyNameString) == 0) { + // str_prop\x82̃\x81\x83\x82\x83\x8A\x82\xCD ComPortInfoFree() \x82ʼn\xF0\x95\xFA\x82\xB3\x82\xEA\x82\xE9\x81B + *friendly_name = str_prop; + + } else { + // s \x82ɃR\x83s\x81[\x82\xB5\x82\xBD\x82̂\xC5str_prop\x82̃\x81\x83\x82\x83\x8A\x82͕s\x97v\x82ƂȂ\xE9\x81B + if (str_prop != NULL) { + free(str_prop); + } + } + } + + *str = s; +} + +/* \x94z\x97\xF1\x83\\x81[\x83g\x97p */ +static int sort_sub(const void *a_, const void *b_) +{ + const ComPortInfo_t *a = (ComPortInfo_t *)a_; + const ComPortInfo_t *b = (ComPortInfo_t *)b_; + if (wcsncmp(a->port_name, L"COM", 3) == 0 && + wcsncmp(b->port_name, L"COM", 3) == 0) { + int a_no = _wtoi(&a->port_name[3]); + int b_no = _wtoi(&b->port_name[3]); + return a_no > b_no; + } + return wcscmp(a->port_name, b->port_name); +} + +/** + * com\x83|\x81[\x83g\x82̏\xEE\x95\xF1\x82\xF0\x8E擾\x82\xB7\x82\xE9 + * + * @param[out] count \x8F\xEE\x95\xF1\x90\x94(0\x82̂Ƃ\xABcom\x83|\x81[\x83g\x82Ȃ\xB5) + * @return \x8F\xEE\x95\xF1\x82ւ̃|\x83C\x83\x93\x83^(\x94z\x97\xF1)\x81A\x83|\x81[\x83g\x94ԍ\x86\x82̏\xAC\x82\xB3\x82\xA2\x8F\x87 + * NULL\x82̂Ƃ\xABcom\x83|\x81[\x83g\x82Ȃ\xB5 + * \x8Eg\x97p\x8C\xE3ComPortInfoFree()\x82\xF0\x8CĂԂ\xB1\x82\xC6 + */ +ComPortInfo_t * WINAPI ComPortInfoGet(int *count, const char *lang) +{ + int comport_count = 0; + ComPortInfo_t *comport_infos = NULL; + const GUID *pClassGuid = &GUID_DEVCLASS_PORTS; + + // List all connected serial devices + HDEVINFO hDevInfo = SetupDiGetClassDevsA(pClassGuid, NULL, NULL, DIGCF_PRESENT | DIGCF_PROFILE); + if (hDevInfo == INVALID_HANDLE_VALUE) { + *count = 0; + return NULL; + } + + // Find the ones that are driverless + for (int i = 0; ; i++) { + SP_DEVINFO_DATA DeviceInfoData; + DeviceInfoData.cbSize = sizeof (DeviceInfoData); + if (!SetupDiEnumDeviceInfo(hDevInfo, i, &DeviceInfoData)) + break; + + // \x83|\x81[\x83g\x96\xBC\x8E擾 ("COM1"\x82Ȃ\xC7) + wchar_t *port_name; + if (!GetComPortName(hDevInfo, &DeviceInfoData, &port_name)) { + continue; + } + int port_no = 0; + if (wcsncmp(port_name, L"COM", 3) == 0) { + port_no = _wtoi(port_name+3); + } + + // \x8F\xEE\x95\xF1\x8E擾 + wchar_t *str_friendly_name = NULL; + wchar_t *str_prop = NULL; + GetComPropartys(hDevInfo, &DeviceInfoData, lang, &str_friendly_name, &str_prop); + + comport_count++; + comport_infos = (ComPortInfo_t *)realloc(comport_infos, + sizeof(ComPortInfo_t) * comport_count); + ComPortInfo_t *p = &comport_infos[comport_count-1]; + p->port_name = port_name; // COM\x83|\x81[\x83g\x96\xBC + p->port_no = port_no; // COM\x83|\x81[\x83g\x94ԍ\x86 + p->friendly_name = str_friendly_name; // Device Description + p->property = str_prop; // \x91S\x8Fڍ\xEE\x95\xF1 + +#if 0 + { + char *a, *b, *c; + a = ToCharW(p->port_name); + b = ToCharW(p->friendly_name); + c = ToCharW(p->property); + OutputDebugPrintf("%s: [%s] [%d] [%s] [%s]\n", __FUNCTION__, + a, p->port_no, b, c + ); + free(a); + free(b); + free(c); + } +#endif + } + + /* \x83|\x81[\x83g\x96\xBC\x8F\x87\x82ɕ\xC0\x82ׂ\xE9 */ + qsort(comport_infos, comport_count, sizeof(comport_infos[0]), sort_sub); + + *count = comport_count; + return comport_infos; +} + +void WINAPI ComPortInfoFree(ComPortInfo_t *info, int count) +{ + for (int i=0; i< count; i++) { + ComPortInfo_t *p = &info[i]; + free(p->port_name); + free(p->friendly_name); + free(p->property); + } + free(info); +} Copied: branches/tootip_classify/teraterm/ttpcmn/comportinfo.h (from rev 8229, branches/tootip_classify/teraterm/teraterm/ttwinman.h) =================================================================== --- branches/tootip_classify/teraterm/ttpcmn/comportinfo.h (rev 0) +++ branches/tootip_classify/teraterm/ttpcmn/comportinfo.h 2019-09-25 17:59:23 UTC (rev 8230) @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2019 TeraTerm Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#pragma once + +#include <windows.h> // for WORD + +#ifdef __cplusplus +extern "C" { +#endif + +#if !defined(DllExport) +#define DllExport __declspec(dllimport) +#endif + +typedef struct { + wchar_t *port_name; // \x83|\x81[\x83g\x96\xBC + int port_no; // 0..128(9x)/255(xp) + wchar_t *friendly_name; + wchar_t *property; +} ComPortInfo_t; + +DllExport ComPortInfo_t * WINAPI ComPortInfoGet(int *count, const char *lang); +DllExport void WINAPI ComPortInfoFree(ComPortInfo_t *info, int count); + +#ifdef __cplusplus +} +#endif Added: branches/tootip_classify/teraterm/ttpcmn/devpkey_teraterm.h =================================================================== --- branches/tootip_classify/teraterm/ttpcmn/devpkey_teraterm.h (rev 0) +++ branches/tootip_classify/teraterm/ttpcmn/devpkey_teraterm.h 2019-09-25 17:59:23 UTC (rev 8230) @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2019 TeraTerm Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#pragma once + +/* + * Visual Studio 2005\x82Ńr\x83\x8B\x83h\x82\xF0\x92ʂ\xB7\x82\xBD\x82߂ɂ͉\xBA\x8BL\x82̒\xE8\x8B`\x82\xAA\x95K\x97v\x81B + * Visual Studio 2019\x82ł͕s\x97v\x81B + */ +#if _MSC_VER == 1400 +typedef ULONG DEVPROPTYPE, *PDEVPROPTYPE; + +typedef GUID DEVPROPGUID, *PDEVPROPGUID; +typedef ULONG DEVPROPID, *PDEVPROPID; + +typedef struct _DEVPROPKEY { + DEVPROPGUID fmtid; + DEVPROPID pid; +} DEVPROPKEY, *PDEVPROPKEY; +#endif + +#undef DEFINE_DEVPROPKEY +#define DEFINE_DEVPROPKEY(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8, pid) EXTERN_C const DEVPROPKEY DECLSPEC_SELECTANY name = { { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }, pid } + +/* + * Platform SDK\x82\xCCdevpkey.h\x82\xE6\x82\xE8 + */ + +DEFINE_DEVPROPKEY(DEVPKEY_Device_FriendlyName, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 14); // DEVPROP_TYPE_STRING +DEFINE_DEVPROPKEY(DEVPKEY_Device_InstanceId, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 256); // DEVPROP_TYPE_STRING +DEFINE_DEVPROPKEY(DEVPKEY_Device_Manufacturer, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 13); // DEVPROP_TYPE_STRING +DEFINE_DEVPROPKEY(DEVPKEY_Device_DriverProvider, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 9); // DEVPROP_TYPE_STRING +DEFINE_DEVPROPKEY(DEVPKEY_Device_DriverDate, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 2); // DEVPROP_TYPE_FILETIME +DEFINE_DEVPROPKEY(DEVPKEY_Device_DriverVersion, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 3); // DEVPROP_TYPE_STRING + Modified: branches/tootip_classify/teraterm/ttpcmn/ttpcmn.v10.vcxproj =================================================================== --- branches/tootip_classify/teraterm/ttpcmn/ttpcmn.v10.vcxproj 2019-09-25 17:59:21 UTC (rev 8229) +++ branches/tootip_classify/teraterm/ttpcmn/ttpcmn.v10.vcxproj 2019-09-25 17:59:23 UTC (rev 8230) @@ -124,6 +124,7 @@ <ItemGroup> <ClCompile Include="..\common\codeconv.cpp" /> <ClCompile Include="..\common\i18n.c" /> + <ClCompile Include="comportinfo.cpp" /> <ClCompile Include="language.c" /> <ClCompile Include="..\common\servicenames.c" /> <ClCompile Include="ttcmn.c" /> @@ -131,6 +132,8 @@ </ItemGroup> <ItemGroup> <ClInclude Include="..\common\i18n.h" /> + <ClInclude Include="comportinfo.h" /> + <ClInclude Include="devpkey_teraterm.h" /> <ClInclude Include="language.h" /> <ClInclude Include="..\common\servicenames.h" /> <ClInclude Include="..\common\ttlib.h" /> Modified: branches/tootip_classify/teraterm/ttpcmn/ttpcmn.v11.vcxproj =================================================================== --- branches/tootip_classify/teraterm/ttpcmn/ttpcmn.v11.vcxproj 2019-09-25 17:59:21 UTC (rev 8229) +++ branches/tootip_classify/teraterm/ttpcmn/ttpcmn.v11.vcxproj 2019-09-25 17:59:23 UTC (rev 8230) @@ -130,6 +130,7 @@ <ItemGroup> <ClCompile Include="..\common\codeconv.cpp" /> <ClCompile Include="..\common\i18n.c" /> + <ClCompile Include="comportinfo.cpp" /> <ClCompile Include="language.c" /> <ClCompile Include="..\common\servicenames.c" /> <ClCompile Include="ttcmn.c" /> @@ -137,6 +138,8 @@ </ItemGroup> <ItemGroup> <ClInclude Include="..\common\i18n.h" /> + <ClInclude Include="comportinfo.h" /> + <ClInclude Include="devpkey_teraterm.h" /> <ClInclude Include="language.h" /> <ClInclude Include="..\common\servicenames.h" /> <ClInclude Include="..\common\ttlib.h" /> Modified: branches/tootip_classify/teraterm/ttpcmn/ttpcmn.v12.vcxproj =================================================================== --- branches/tootip_classify/teraterm/ttpcmn/ttpcmn.v12.vcxproj 2019-09-25 17:59:21 UTC (rev 8229) +++ branches/tootip_classify/teraterm/ttpcmn/ttpcmn.v12.vcxproj 2019-09-25 17:59:23 UTC (rev 8230) @@ -130,6 +130,7 @@ <ItemGroup> <ClCompile Include="..\common\codeconv.cpp" /> <ClCompile Include="..\common\i18n.c" /> + <ClCompile Include="comportinfo.cpp" /> <ClCompile Include="..\common\ttlib.c" /> <ClCompile Include="language.c" /> <ClCompile Include="..\common\servicenames.c" /> @@ -137,6 +138,8 @@ </ItemGroup> <ItemGroup> <ClInclude Include="..\common\i18n.h" /> + <ClInclude Include="comportinfo.h" /> + <ClInclude Include="devpkey_teraterm.h" /> <ClInclude Include="..\common\ttlib.h" /> <ClInclude Include="language.h" /> <ClInclude Include="..\common\servicenames.h" /> Modified: branches/tootip_classify/teraterm/ttpcmn/ttpcmn.v14.vcxproj =================================================================== --- branches/tootip_classify/teraterm/ttpcmn/ttpcmn.v14.vcxproj 2019-09-25 17:59:21 UTC (rev 8229) +++ branches/tootip_classify/teraterm/ttpcmn/ttpcmn.v14.vcxproj 2019-09-25 17:59:23 UTC (rev 8230) @@ -130,6 +130,7 @@ <ItemGroup> <ClCompile Include="..\common\codeconv.cpp" /> <ClCompile Include="..\common\i18n.c" /> + <ClCompile Include="comportinfo.cpp" /> <ClCompile Include="..\common\ttlib.c" /> <ClCompile Include="language.c" /> <ClCompile Include="..\common\servicenames.c" /> @@ -137,6 +138,8 @@ </ItemGroup> <ItemGroup> <ClInclude Include="..\common\i18n.h" /> + <ClInclude Include="comportinfo.h" /> + <ClInclude Include="devpkey_teraterm.h" /> <ClInclude Include="..\common\ttlib.h" /> <ClInclude Include="language.h" /> <ClInclude Include="..\common\servicenames.h" /> Modified: branches/tootip_classify/teraterm/ttpcmn/ttpcmn.v15.vcxproj =================================================================== --- branches/tootip_classify/teraterm/ttpcmn/ttpcmn.v15.vcxproj 2019-09-25 17:59:21 UTC (rev 8229) +++ branches/tootip_classify/teraterm/ttpcmn/ttpcmn.v15.vcxproj 2019-09-25 17:59:23 UTC (rev 8230) @@ -134,6 +134,7 @@ <ClCompile Include="..\common\codeconv.cpp" /> <ClCompile Include="..\common\i18n.c" /> <ClCompile Include="..\common\ttlib.c" /> + <ClCompile Include="comportinfo.cpp" /> <ClCompile Include="language.c" /> <ClCompile Include="..\common\servicenames.c" /> <ClCompile Include="ttcmn.c" /> @@ -141,6 +142,8 @@ <ItemGroup> <ClInclude Include="..\common\i18n.h" /> <ClInclude Include="..\common\ttlib.h" /> + <ClInclude Include="comportinfo.h" /> + <ClInclude Include="devpkey_teraterm.h" /> <ClInclude Include="language.h" /> <ClInclude Include="..\common\servicenames.h" /> </ItemGroup> @@ -153,4 +156,4 @@ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"> </ImportGroup> -</Project> +</Project> \ No newline at end of file Modified: branches/tootip_classify/teraterm/ttpcmn/ttpcmn.v15.vcxproj.filters =================================================================== --- branches/tootip_classify/teraterm/ttpcmn/ttpcmn.v15.vcxproj.filters 2019-09-25 17:59:21 UTC (rev 8229) +++ branches/tootip_classify/teraterm/ttpcmn/ttpcmn.v15.vcxproj.filters 2019-09-25 17:59:23 UTC (rev 8230) @@ -37,6 +37,9 @@ <ClCompile Include="..\common\codeconv.cpp"> <Filter>Source Files</Filter> </ClCompile> + <ClCompile Include="comportinfo.cpp"> + <Filter>Source Files</Filter> + </ClCompile> </ItemGroup> <ItemGroup> <ClInclude Include="..\common\i18n.h"> @@ -51,6 +54,12 @@ <ClInclude Include="..\common\ttlib.h"> <Filter>Header Files</Filter> </ClInclude> + <ClInclude Include="devpkey_teraterm.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="comportinfo.h"> + <Filter>Source Files</Filter> + </ClInclude> </ItemGroup> <ItemGroup> <None Include="ttpcmn.def"> @@ -62,4 +71,4 @@ <Filter>Resource Files</Filter> </ResourceCompile> </ItemGroup> -</Project> +</Project> \ No newline at end of file Modified: branches/tootip_classify/teraterm/ttpcmn/ttpcmn.v16.vcxproj =================================================================== --- branches/tootip_classify/teraterm/ttpcmn/ttpcmn.v16.vcxproj 2019-09-25 17:59:21 UTC (rev 8229) +++ branches/tootip_classify/teraterm/ttpcmn/ttpcmn.v16.vcxproj 2019-09-25 17:59:23 UTC (rev 8230) @@ -134,6 +134,7 @@ <ClCompile Include="..\common\codeconv.cpp" /> <ClCompile Include="..\common\i18n.c" /> <ClCompile Include="..\common\ttlib.c" /> + <ClCompile Include="comportinfo.cpp" /> <ClCompile Include="language.c" /> <ClCompile Include="..\common\servicenames.c" /> <ClCompile Include="ttcmn.c" /> @@ -141,6 +142,8 @@ <ItemGroup> <ClInclude Include="..\common\i18n.h" /> <ClInclude Include="..\common\ttlib.h" /> + <ClInclude Include="comportinfo.h" /> + <ClInclude Include="devpkey_teraterm.h" /> <ClInclude Include="language.h" /> <ClInclude Include="..\common\servicenames.h" /> </ItemGroup> @@ -153,4 +156,4 @@ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"> </ImportGroup> -</Project> +</Project> \ No newline at end of file Modified: branches/tootip_classify/teraterm/ttpcmn/ttpcmn.v16.vcxproj.filters =================================================================== --- branches/tootip_classify/teraterm/ttpcmn/ttpcmn.v16.vcxproj.filters 2019-09-25 17:59:21 UTC (rev 8229) +++ branches/tootip_classify/teraterm/ttpcmn/ttpcmn.v16.vcxproj.filters 2019-09-25 17:59:23 UTC (rev 8230) @@ -37,6 +37,9 @@ <ClCompile Include="..\common\codeconv.cpp"> <Filter>Source Files</Filter> </ClCompile> + <ClCompile Include="comportinfo.cpp"> + <Filter>Source Files</Filter> + </ClCompile> </ItemGroup> <ItemGroup> <ClInclude Include="..\common\i18n.h"> @@ -51,6 +54,12 @@ <ClInclude Include="..\common\ttlib.h"> <Filter>Header Files</Filter> </ClInclude> + <ClInclude Include="devpkey_teraterm.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="comportinfo.h"> + <Filter>Source Files</Filter> + </ClInclude> </ItemGroup> <ItemGroup> <None Include="ttpcmn.def"> @@ -62,4 +71,4 @@ <Filter>Resource Files</Filter> </ResourceCompile> </ItemGroup> -</Project> +</Project> \ No newline at end of file Modified: branches/tootip_classify/teraterm/ttpcmn/ttpcmn.v9.vcproj =================================================================== --- branches/tootip_classify/teraterm/ttpcmn/ttpcmn.v9.vcproj 2019-09-25 17:59:21 UTC (rev 8229) +++ branches/tootip_classify/teraterm/ttpcmn/ttpcmn.v9.vcproj 2019-09-25 17:59:23 UTC (rev 8230) @@ -210,6 +210,10 @@ > </File> <File + RelativePath=".\comportinfo.cpp" + > + </File> + <File RelativePath="..\common\i18n.c" > </File> @@ -235,6 +239,14 @@ Filter="h;hpp;hxx;hm;inl;fi;fd" > <File + RelativePath=".\comportinfo.h" + > + </File> + <File + RelativePath=".\devpkey_teraterm.h" + > + </File> + <File RelativePath="..\common\i18n.h" > </File> Modified: branches/tootip_classify/teraterm/ttpcmn/ttpcmn.vcproj =================================================================== --- branches/tootip_classify/teraterm/ttpcmn/ttpcmn.vcproj 2019-09-25 17:59:21 UTC (rev 8229) +++ branches/tootip_classify/teraterm/ttpcmn/ttpcmn.vcproj 2019-09-25 17:59:23 UTC (rev 8230) @@ -211,6 +211,10 @@ > </File> <File + RelativePath=".\comportinfo.cpp" + > + </File> + <File RelativePath="..\common\i18n.c" > </File> @@ -236,6 +240,14 @@ Filter="h;hpp;hxx;hm;inl;fi;fd" > <File + RelativePath=".\comportinfo.h" + > + </File> + <File + RelativePath=".\devpkey_teraterm.h" + > + </File> + <File RelativePath="..\common\i18n.h" > </File> Modified: branches/tootip_classify/teraterm/ttpdlg/ttdlg.c =================================================================== --- branches/tootip_classify/teraterm/ttpdlg/ttdlg.c 2019-09-25 17:59:21 UTC (rev 8229) +++ branches/tootip_classify/teraterm/ttpdlg/ttdlg.c 2019-09-25 17:59:23 UTC (rev 8230) @@ -48,6 +48,8 @@ #include "svnversion.h" #include "ttdlg.h" #include "tipwin.h" +#include "comportinfo.h" +#include "codeconv.h" // Oniguruma: Regular expression library #define ONIG_EXTERN extern @@ -123,6 +125,11 @@ "14400","19200","38400","57600","115200", "230400", "460800", "921600", NULL}; +/* + * COM\x83|\x81[\x83g\x82Ɋւ\xB7\x82\xE9\x8Fڍ\xEE\x95\xF1 + */ +static ComPortInfo_t *ComPortInfoPtr; +static int ComPortInfoCount; static INT_PTR CALLBACK TermDlg(HWND Dialog, UINT Message, WPARAM wParam, LPARAM lParam) { @@ -1168,15 +1175,21 @@ */ static void serial_dlg_set_comport_info(HWND dlg, int portno, char *desc) { - char buf[1024]; + int i; + ComPortInfo_t *p; + char *strA; - // WindowsNT4.0\x88ȑO\x82͏ڍ\xEE\x95擾\x82ł\xAB\x82Ȃ\xA2\x81B - if (desc == NULL) + for (i = 0 ; i < ComPortInfoCount ; i++) { + p = &ComPortInfoPtr[i]; + if (p->port_no == portno) + break; + } + if (i >= ComPortInfoCount) // \x8AY\x93\x96\x82\xB7\x82\xE9COM\x83|\x81[\x83g\x82\xAA\x8C\xA9\x82\xA9\x82\xE7\x82Ȃ\xA9\x82\xC1\x82\xBD return; - _snprintf_s(buf, sizeof(buf), _TRUNCATE, "%s\r\n", desc); - - SendDlgItemMessage(dlg, IDC_SERIALTEXT, WM_SETTEXT, 0, (LPARAM)(char *)buf); + strA = ToCharW(p->property); + SetDlgItemTextA(dlg, IDC_SERIALTEXT, strA); + free(strA); } /* @@ -1312,6 +1325,11 @@ EnableDlgItem(Dialog, IDC_SERIALPORT_LABEL, IDC_SERIALPORT_LABEL); EnableDlgItem(Dialog, IDOK, IDOK); + // COM\x83|\x81[\x83g\x82̏ڍ\xEE\x95\xF1\x82\xF0\x8E擾\x82\xB7\x82\xE9\x81B + // COM\x82̐ڑ\xB1\x8F͓s\x93x\x95ς\xED\x82邽\x82߁A\x83_\x83C\x83A\x83\x8D\x83O\x82\xF0\x95\\x8E\xA6\x82\xB7\x82\xE9\x93x\x82Ɏ擾\x82\xB7\x82\xE9\x81B + // \x95s\x97v\x82ɂȂ\xC1\x82\xBD\x82\xE7\x81AComPortInfoFree()\x82Ń\x81\x83\x82\x83\x8A\x82\xF0\x89\xF0\x95\xFA\x82\xB7\x82邱\x82ƁB + ComPortInfoPtr = ComPortInfoGet(&ComPortInfoCount, UILanguageFile); + w = 0; if ((comports = DetectComPorts(ComPortTable, ts->MaxComPort, ComPortDesc)) > 0) { @@ -1416,6 +1434,13 @@ return TRUE; + case WM_DESTROY: + // COM\x83|\x81[\x83g\x82̏ڍ\xEE\x95\xF1\x82\xF0\x89\xF0\x95\xFA\x82\xB7\x82\xE9\x81B + ComPortInfoFree(ComPortInfoPtr, ComPortInfoCount); + ComPortInfoPtr = NULL; + ComPortInfoCount = 0; + break; + case WM_COMMAND: switch (LOWORD(wParam)) { case IDOK: Modified: branches/tootip_classify/teraterm/ttpdlg/ttpdlg.rc =================================================================== --- branches/tootip_classify/teraterm/ttpdlg/ttpdlg.rc 2019-09-25 17:59:21 UTC (rev 8229) +++ branches/tootip_classify/teraterm/ttpdlg/ttpdlg.rc 2019-09-25 17:59:23 UTC (rev 8230) @@ -125,7 +125,7 @@ EDITTEXT IDC_LOCALE_EDIT,59,140,63,13,ES_AUTOHSCROLL END -IDD_SERIALDLG DIALOGEX 20, 20, 190, 205 +IDD_SERIALDLG DIALOGEX 20, 20, 234, 214 STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Tera Term: Serial port setup and connection" FONT 14, "System", 0, 0, 0x0 @@ -142,15 +142,15 @@ COMBOBOX IDC_SERIALSTOP,75,67,48,40,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP CONTROL "&Flow control:",IDC_SERIALFLOW_LABEL,"Static",SS_LEFTNOWORDWRAP,15,84,54,8 COMBOBOX IDC_SERIALFLOW,75,82,48,53,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP - GROUPBOX "Transmit delay",IDC_SERIALDELAY,19,104,152,32 - LTEXT "msec/&char",IDC_SERIALDELAYCHAR_LABEL,53,118,42,10 - EDITTEXT IDC_SERIALDELAYCHAR,29,116,20,12,ES_AUTOHSCROLL | ES_NUMBER - LTEXT "msec/&line",IDC_SERIALDELAYLINE_LABEL,124,118,42,10 - EDITTEXT IDC_SERIALDELAYLINE,100,116,20,12,ES_AUTOHSCROLL | ES_NUMBER - DEFPUSHBUTTON "OK",IDOK,138,9,40,45,BS_LEFT | BS_MULTILINE | WS_GROUP - PUSHBUTTON "Cancel",IDCANCEL,138,60,40,16,BS_LEFT - PUSHBUTTON "&Help",IDC_SERIALHELP,138,84,40,16,BS_LEFT - EDITTEXT IDC_SERIALTEXT,10,141,170,59,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | WS_VSCROLL | WS_HSCROLL + GROUPBOX "Transmit delay",IDC_SERIALDELAY,41,104,152,32 + LTEXT "msec/&char",IDC_SERIALDELAYCHAR_LABEL,75,118,42,10 + EDITTEXT IDC_SERIALDELAYCHAR,51,116,20,12,ES_AUTOHSCROLL | ES_NUMBER + LTEXT "msec/&line",IDC_SERIALDELAYLINE_LABEL,146,118,42,10 + EDITTEXT IDC_SERIALDELAYLINE,122,116,20,12,ES_AUTOHSCROLL | ES_NUMBER + DEFPUSHBUTTON "OK",IDOK,138,9,87,18,BS_CENTER | BS_MULTILINE | WS_GROUP + PUSHBUTTON "Cancel",IDCANCEL,138,38,87,16,BS_CENTER + PUSHBUTTON "&Help",IDC_SERIALHELP,138,64,86,16,BS_CENTER + EDITTEXT IDC_SERIALTEXT,10,141,212,70,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | WS_VSCROLL | WS_HSCROLL END IDD_TCPIPDLG DIALOGEX 20, 20, 222, 157 @@ -403,6 +403,11 @@ #ifdef APSTUDIO_INVOKED GUIDELINES DESIGNINFO BEGIN + IDD_SERIALDLG, DIALOG + BEGIN + RIGHTMARGIN, 232 + END + IDD_HOSTDLG, DIALOG BEGIN LEFTMARGIN, 4 Modified: branches/tootip_classify/ttssh2/ttxssh/CMakeLists.txt =================================================================== --- branches/tootip_classify/ttssh2/ttxssh/CMakeLists.txt 2019-09-25 17:59:21 UTC (rev 8229) +++ branches/tootip_classify/ttssh2/ttxssh/CMakeLists.txt 2019-09-25 17:59:23 UTC (rev 8230) @@ -6,7 +6,7 @@ include(${CMAKE_CURRENT_SOURCE_DIR}/../../libs/lib_openssl.cmake) if (MSVC) - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DELAYLOAD:dnsapi.dll") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DELAYLOAD:user32.dll /DELAYLOAD:dnsapi.dll") endif() add_library( Modified: branches/tootip_classify/ttssh2/ttxssh/auth.c =================================================================== --- branches/tootip_classify/ttssh2/ttxssh/auth.c 2019-09-25 17:59:21 UTC (rev 8229) +++ branches/tootip_classify/ttssh2/ttxssh/auth.c 2019-09-25 17:59:23 UTC (rev 8230) @@ -243,34 +243,6 @@ } } -static LRESULT CALLBACK username_proc(HWND hWnd, UINT msg, - WPARAM wParam, LPARAM lParam) -{ - const WNDPROC ProcOrg = (WNDPROC)GetWindowLongPtr(hWnd, GWLP_USERDATA); - const LRESULT result = CallWindowProc(ProcOrg, hWnd, msg, wParam, lParam); - switch (msg) { - case WM_CHAR: - case WM_SETTEXT: { - // \x83\x86\x81[\x83U\x81[\x96\xBC\x82\xAA\x93\xFC\x97͂\xB3\x82\xEA\x82Ă\xA2\x82\xBD\x8Fꍇ\x81A\x83I\x83v\x83V\x83\x87\x83\x93\x82\xF0\x8Eg\x82\xA4\x82\xB1\x82Ƃ͂Ȃ\xA2\x82̂ŁA - // tab\x82ł̃t\x83H\x81[\x83J\x83X\x88ړ\xAE\x8E\x9E\x81A\x83I\x83v\x83V\x83\x87\x83\x93\x83{\x83^\x83\x93\x82\xF0\x83p\x83X\x82\xB7\x82\xE9\x82悤\x82ɂ\xB7\x82\xE9 - // \x8F]\x97\x88\x82Ɠ\xAF\x82\xB6\x83L\x81[\x91\x80\x8D\xEC\x82Ń\x86\x81[\x83U\x81[\x96\xBC\x82ƃp\x83X\x83t\x83\x8C\x81[\x83Y\x82\xF0\x93\xFC\x97͉\\x82Ƃ\xB7\x82\xE9 - const HWND dlg = GetParent(hWnd); - const HWND hWndOption = GetDlgItem(dlg, IDC_USERNAME_OPTION); - const int len = GetWindowTextLength(hWnd); - LONG_PTR style = GetWindowLongPtr(hWndOption, GWL_STYLE); - if (len > 0) { - // \x95s\x97vtabstop - style = style & (~(LONG_PTR)WS_TABSTOP); - } else { - // \x97vtabstop - style = style | WS_TABSTOP; - } - SetWindowLongPtr(hWndOption, GWL_STYLE, style); - } - } - return result; -} - static void init_auth_dlg(PTInstVar pvar, HWND dlg, BOOL *UseControlChar) { const static DlgTextInfo text_info[] = { @@ -330,14 +302,6 @@ SetDlgItemText(dlg, IDC_SSHUSETIS, pvar->ts->UIMsg); } - // username\x82̃T\x83u\x83N\x83\x89\x83X\x89\xBB - { - HWND hWndUserName = GetDlgItem(dlg, IDC_SSHUSERNAME); - LONG_PTR ProcOrg = - SetWindowLongPtr(hWndUserName, GWLP_WNDPROC, (LONG_PTR)username_proc); - SetWindowLongPtr(hWndUserName, GWLP_USERDATA, ProcOrg); - } - if (pvar->auth_state.user != NULL) { SetDlgItemText(dlg, IDC_SSHUSERNAME, pvar->auth_state.user); EnableWindow(GetDlgItem(dlg, IDC_SSHUSERNAME), FALSE); @@ -816,7 +780,6 @@ } -BOOL autologin_sent_none; static INT_PTR CALLBACK auth_dlg_proc(HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam) { @@ -825,9 +788,11 @@ const int IDC_TIMER3 = 302; // challenge \x82\xC5 ask4passwd \x82\xC5CheckAuthListFirst \x82\xAA FALSE \x82̂Ƃ\xAB const int autologin_timeout = 10; // \x83~\x83\x8A\x95b PTInstVar pvar; + static BOOL autologin_sent_none; static BOOL UseControlChar; static BOOL ShowPassPhrase; static HICON hIconDropdown; + static size_t username_str_len; TCHAR uimsg[MAX_UIMSG]; switch (msg) { @@ -838,6 +803,7 @@ UseControlChar = TRUE; ShowPassPhrase = FALSE; + username_str_len = 0; init_auth_dlg(pvar, dlg, &UseControlChar); // "\x81\xA5"\x89摜\x82\xF0\x83Z\x83b\x83g\x82\xB7\x82\xE9 @@ -1002,35 +968,63 @@ return TRUE; case IDC_SSHUSERNAME: - // \x83\x86\x81[\x83U\x96\xBC\x82\xAA\x83t\x83H\x81[\x83J\x83X\x82\xF0\x8E\xB8\x82\xC1\x82\xBD\x82Ƃ\xAB (2007.9.29 maya) - if (!(pvar->ssh_state.status_flags & STATUS_DONT_SEND_USER_NAME) && - (pvar->ssh_state.status_flags & STATUS_HOST_OK) && - HIWORD(wParam) == EN_KILLFOCUS) { - // \x90ݒ肪\x97L\x8C\xF8\x82ł܂\xBE\x8E\xE6\x82\xE8\x82ɍs\x82\xC1\x82Ă\xA2\x82Ȃ\xA2\x82Ȃ\xE7 - if (SSHv2(pvar) && - pvar->session_settings.CheckAuthListFirst && - !pvar->tryed_ssh2_authlist) { - // \x83_\x83C\x83A\x83\x8D\x83O\x82̃\x86\x81[\x83U\x96\xBC\x82f - if (pvar->auth_state.user == NULL) { - pvar->auth_state.user = - alloc_control_text(GetDlgItem(dlg, IDC_SSHUSERNAME)); - } + switch (HIWORD(wParam)) { + case EN_KILLFOCUS: { + // \x83\x86\x81[\x83U\x96\xBC\x82\xAA\x83t\x83H\x81[\x83J\x83X\x82\xF0\x8E\xB8\x82\xC1\x82\xBD\x82Ƃ\xAB (2007.9.29 maya) + if (!(pvar->ssh_state.status_flags & STATUS_DONT_SEND_USER_NAME) && + (pvar->ssh_state.status_flags & STATUS_HOST_OK)) { + // \x90ݒ肪\x97L\x8C\xF8\x82ł܂\xBE\x8E\xE6\x82\xE8\x82ɍs\x82\xC1\x82Ă\xA2\x82Ȃ\xA2\x82Ȃ\xE7 + if (SSHv2(pvar) && + pvar->session_settings.CheckAuthListFirst && + !pvar->tryed_ssh2_authlist) { + // \x83_\x83C\x83A\x83\x8D\x83O\x82̃\x86\x81[\x83U\x96\xBC\x82f + if (pvar->auth_state.user == NULL) { + pvar->auth_state.user = + alloc_control_text(GetDlgItem(dlg, IDC_SSHUSERNAME)); + } - // \x83\x86\x81[\x83U\x96\xBC\x82\xAA\x93\xFC\x97͂\xB3\x82\xEA\x82Ă\xA2\x82邩\x83`\x83F\x83b\x83N\x82\xB7\x82\xE9 - if (strlen(pvar->auth_state.user) == 0) { - return FALSE; - } + // \x83\x86\x81[\x83U\x96\xBC\x82\xAA\x93\xFC\x97͂\xB3\x82\xEA\x82Ă\xA2\x82邩\x83`\x83F\x83b\x83N\x82\xB7\x82\xE9 + if (strlen(pvar->auth_state.user) == 0) { + return FALSE; + } - // \x83\x86\x81[\x83U\x96\xBC\x82\xF0\x95ύX\x82\xB3\x82\xB9\x82Ȃ\xA2 - EnableWindow(GetDlgItem(dlg, IDC_SSHUSERNAME), FALSE); - EnableWindow(GetDlgItem(dlg, IDC_USERNAME_OPTION), FALSE); + // \x83\x86\x81[\x83U\x96\xBC\x82\xF0\x95ύX\x82\xB3\x82\xB9\x82Ȃ\xA2 + EnableWindow(GetDlgItem(dlg, IDC_SSHUSERNAME), FALSE); + EnableWindow(GetDlgItem(dlg, IDC_USERNAME_OPTION), FALSE); - // \x94F\x8F\x81\x83\\x83b\x83h none \x82𑗂\xE9 - do_SSH2_userauth(pvar); - return TRUE; + // \x94F\x8F\x81\x83\\x83b\x83h none \x82𑗂\xE9 + do_SSH2_userauth(pvar); + return TRUE; + } } + return FALSE; } + case EN_CHANGE: { + // \x83\x86\x81[\x83U\x81[\x96\xBC\x82\xAA\x93\xFC\x97͂\xB3\x82\xEA\x82Ă\xA2\x82\xBD\x8Fꍇ\x81A\x83I\x83v\x83V\x83\x87\x83\x93\x82\xF0\x8Eg\x82\xA4\x82\xB1\x82Ƃ͂Ȃ\xA2\x82̂ŁA + // tab\x82ł̃t\x83H\x81[\x83J\x83X\x88ړ\xAE\x8E\x9E\x81A\x83I\x83v\x83V\x83\x87\x83\x93\x83{\x83^\x83\x93\x82\xF0\x83p\x83X\x82\xB7\x82\xE9\x82悤\x82ɂ\xB7\x82\xE9 + // \x8F]\x97\x88\x82Ɠ\xAF\x82\xB6\x83L\x81[\x91\x80\x8D\xEC\x82Ń\x86\x81[\x83U\x81[\x96\xBC\x82ƃp\x83X\x83t\x83\x8C\x81[\x83Y\x82\xF0\x93\xFC\x97͉\\x82Ƃ\xB7\x82\xE9 + HWND hWnd = (HWND)lParam; + const int len = GetWindowTextLength(hWnd); + if ((username_str_len == 0 && len != 0) || + (username_str_len != 0 && len == 0)) { + // \x83\x86\x81[\x83U\x81[\x96\xBC\x82̕\xB6\x8E\x9A\x92\xB7\x82\xAA 0\x82ɂȂ\xE9 or 0\x82ł͂Ȃ\xAD\x82Ȃ\xE9 \x8E\x9E\x82̂ݏ\x88\x97\x9D + const HWND hWndOption = GetDlgItem(dlg, IDC_USERNAME_OPTION); + LONG_PTR style = GetWindowLongPtr(hWndOption, GWL_STYLE); + if (len > 0) { + // \x95s\x97vtabstop + style = style & (~(LONG_PTR)WS_TABSTOP); + } + else { + // \x97vtabstop + style = style | WS_TABSTOP; + } + SetWindowLongPtr(hWndOption, GWL_STYLE, style); + } + username_str_len = len; + return FALSE; + } + } return FALSE; case IDC_SSHUSEPASSWORD: @@ -1458,6 +1452,7 @@ HWND cur_active = GetActiveWindow(); DLGPROC dlg_proc; LPCTSTR dialog_template; + INT_PTR r; switch (pvar->auth_state.mode) { case TIS_AUTH_MODE: @@ -1470,10 +1465,11 @@ dlg_proc = auth_dlg_proc; } - if (!DialogBoxParam(hInst, dialog_template, - cur_active != - NULL ? cur_active : pvar->NotificationWindow, - dlg_proc, (LPARAM) pvar) == -1) { + r = DialogBoxParam(hInst, dialog_template, + cur_active != + NULL ? cur_active : pvar->NotificationWindow, + dlg_proc, (LPARAM) pvar); + if (r == -1) { UTIL_get_lang_msg("MSG_CREATEWINDOW_AUTH_ERROR", pvar, "Unable to display authentication dialog box.\n" "Connection terminated.");