diff --git a/READMEJP.txt b/READMEJP.txt index f4fa19e8..a1fab6cd 100644 --- a/READMEJP.txt +++ b/READMEJP.txt @@ -217,7 +217,7 @@ エクスポートを修正・標準化。 エクスポート方法を選べるようにエクスポート オプションを追加。 "resource.h"の更新を使いやすく修正。 - 2018.XX.YY ver.4.0 + 2018.03.20 ver.4.0 バックアップをもっと安全に。 バックアップを5世代までに制限。 非標準のリソースIDの解釈を改善。 diff --git a/src/RisohEditor.cpp b/src/RisohEditor.cpp index 00d75325..13d5ceb3 100644 --- a/src/RisohEditor.cpp +++ b/src/RisohEditor.cpp @@ -1468,6 +1468,7 @@ class MMainWnd : public MWindowBase void OnOpenReadMe(HWND hwnd); void OnOpenReadMeJp(HWND hwnd); void OnOpenLicense(HWND hwnd); + void OnOpenHyojunka(HWND hwnd); void OnDebugTreeNode(HWND hwnd); void OnAdviceResH(HWND hwnd); void OnUnloadResH(HWND hwnd); @@ -2807,6 +2808,36 @@ void MMainWnd::OnOpenReadMeJp(HWND hwnd) ShellExecuteW(hwnd, NULL, szPath, NULL, NULL, SW_SHOWNORMAL); } +void MMainWnd::OnOpenHyojunka(HWND hwnd) +{ + WCHAR szPath[MAX_PATH]; + GetModuleFileNameW(NULL, szPath, _countof(szPath)); + LPWSTR pch = wcsrchr(szPath, L'\\'); + if (pch == NULL) + return; + + ++pch; + size_t diff = pch - szPath; + StringCchCopyW(pch, diff, L"HYOJUNKA.txt"); + if (GetFileAttributesW(szPath) == INVALID_FILE_ATTRIBUTES) + { + StringCchCopyW(pch, diff, L"..\\HYOJUNKA.txt"); + if (GetFileAttributesW(szPath) == INVALID_FILE_ATTRIBUTES) + { + StringCchCopyW(pch, diff, L"..\\..\\HYOJUNKA.txt"); + if (GetFileAttributesW(szPath) == INVALID_FILE_ATTRIBUTES) + { + StringCchCopyW(pch, diff, L"..\\..\\..\\HYOJUNKA.txt"); + if (GetFileAttributesW(szPath) == INVALID_FILE_ATTRIBUTES) + { + return; + } + } + } + } + ShellExecuteW(hwnd, NULL, szPath, NULL, NULL, SW_SHOWNORMAL); +} + void MMainWnd::OnOpenLicense(HWND hwnd) { WCHAR szPath[MAX_PATH]; @@ -7186,6 +7217,9 @@ void MMainWnd::OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify) case ID_OPENLICENSE: OnOpenLicense(hwnd); break; + case ID_OPENHYOJUNKA: + OnOpenHyojunka(hwnd); + break; case ID_DEBUGTREENODE: OnDebugTreeNode(hwnd); break; diff --git a/src/lang/ja-JP.rc b/src/lang/ja-JP.rc index c2d52ea2..fe333853 100644 --- a/src/lang/ja-JP.rc +++ b/src/lang/ja-JP.rc @@ -127,6 +127,8 @@ IDR_MAINMENU MENU MENUITEM "&README.txtを開く", ID_OPENREADME MENUITEM "README&JP.txtを開く", ID_OPENREADMEJP MENUITEM SEPARATOR + MENUITEM "&HYOJUNKA.txtを開く", ID_OPENHYOJUNKA + MENUITEM SEPARATOR MENUITEM "&LICENSE.txtを開く", ID_OPENLICENSE MENUITEM SEPARATOR MENUITEM "バージョン情報(&A)...", ID_ABOUT diff --git a/src/resource.h b/src/resource.h index a749f6ab..8054a71b 100644 --- a/src/resource.h +++ b/src/resource.h @@ -151,6 +151,7 @@ #define ID_IDJUMP09 230 #define ID_SHOWLANGS 231 #define ID_SHOWHIDETOOLBAR 232 +#define ID_OPENHYOJUNKA 233 #define IDD_REPLACERES 100 #define IDD_ADDICON 101