Skip to content

Commit

Permalink
Merge branch 'master' into tatsu_documents
Browse files Browse the repository at this point in the history
  • Loading branch information
Tatsu-syo committed Feb 12, 2024
2 parents e26008d + 35c09fe commit adede07
Show file tree
Hide file tree
Showing 18 changed files with 124 additions and 28 deletions.
4 changes: 3 additions & 1 deletion lang/default.lng
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; noMeiryoUI (C) 2005,2012-2022 Tatsuhiko Shoji,mon-jai
; noMeiryoUI (C) 2005,2012-2024 Tatsuhiko Shoji,mon-jai
; The sources for noMeiryoUI are distributed under the MIT open source license

;In RESOURCE section,
Expand All @@ -16,8 +16,10 @@ MENU_PRESET=&Preset
MENU_PRESET_8=Windows 8/8.1
MENU_PRESET_10=Windows 10
MENU_TOOLS=&Tools
MENU_TOOLS_CHOICE_APP_FONT=Choice No!! Meiryo UI application &font
MENU_TOOLS_THREAD=Set system fonts in separated thread
MENU_TOOLS_SEVEN=Calculate font size same as Windows 7
MENU_TOOLS_NO_MULTI_RUN=&Don't run multiply
MENU_HELP=&Help
MENU_HELP_HELP=&Help
MENU_HELP_ABOUT=&About No!! Meiryo UI
Expand Down
4 changes: 3 additions & 1 deletion lang/en.lng
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; noMeiryoUI (C) 2005,2012-2022 Tatsuhiko Shoji,mon-jai
; noMeiryoUI (C) 2005,2012-2024 Tatsuhiko Shoji,mon-jai
; The sources for noMeiryoUI are distributed under the MIT open source license

;In RESOURCE section,
Expand All @@ -16,8 +16,10 @@ MENU_PRESET=&Preset
MENU_PRESET_8=Windows 8/8.1
MENU_PRESET_10=Windows 10
MENU_TOOLS=&Tools
MENU_TOOLS_CHOICE_APP_FONT=Choice No!! Meiryo UI application &font
MENU_TOOLS_THREAD=Set system fonts in separated thread
MENU_TOOLS_SEVEN=Calculate font size same as Windows 7
MENU_TOOLS_NO_MULTI_RUN=&Don't run multiply
MENU_HELP=&Help
MENU_HELP_HELP=&Help
MENU_HELP_ABOUT=&About No!! Meiryo UI
Expand Down
4 changes: 3 additions & 1 deletion lang/ja-JP.lng
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; noMeiryoUI (C) 2005,2012-2023 Tatsuhiko Shoji
; noMeiryoUI (C) 2005,2012-2024 Tatsuhiko Shoji
; The sources for noMeiryoUI are distributed under the MIT open source license

;In RESOURCE section,
Expand All @@ -16,8 +16,10 @@ MENU_PRESET=プリセット(&P)
MENU_PRESET_8=Windows 8/8.1
MENU_PRESET_10=Windows 10
MENU_TOOLS=ツール(&T)
MENU_TOOLS_CHOICE_APP_FONT=Meiryo UIも大っきらい!! のフォントを選択する(&F)
MENU_TOOLS_THREAD=別スレッドでフォントを変更する(&A)
MENU_TOOLS_SEVEN=フォントサイズをWindows 7と同様に扱う(&7)
MENU_TOOLS_NO_MULTI_RUN=二重起動をしない(&D)
MENU_HELP=ヘルプ(&H)
MENU_HELP_HELP=ヘルプの表示(&C)
MENU_HELP_ABOUT=バージョン情報(&A)...
Expand Down
4 changes: 3 additions & 1 deletion lang/ko-KR.lng
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; noMeiryoUI (C) 2005,2012-2021 Tatsuhiko Shoji
; noMeiryoUI (C) 2005,2012-2024 Tatsuhiko Shoji
; The sources for noMeiryoUI are distributed under the MIT open source license

;In RESOURCE section,
Expand All @@ -16,8 +16,10 @@ MENU_PRESET=프리셋(&P)
MENU_PRESET_8=Windows 8/8.1
MENU_PRESET_10=Windows 10
MENU_TOOLS=도구(&T)
MENU_TOOLS_CHOICE_APP_FONT=Choice No!! Meiryo UI application &font
MENU_TOOLS_THREAD=개별 스레드에서 시스템 글꼴 설정(&A)
MENU_TOOLS_SEVEN=Windows 7 방식의 글꼴 크기 계산(&7)
MENU_TOOLS_NO_MULTI_RUN=&Don't run multiply
MENU_HELP=도움말(&H)
MENU_HELP_HELP=도움말(&H)
MENU_HELP_ABOUT=No!! Meiryo UI에 대하여(&A)...
Expand Down
4 changes: 3 additions & 1 deletion lang/pt-BR.lng
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; noMeiryoUI (C) 2005,2012-2022 Tatsuhiko Shoji
; noMeiryoUI (C) 2005,2012-2024 Tatsuhiko Shoji
; The sources for noMeiryoUI are distributed under the MIT open source license

;In RESOURCE section,
Expand All @@ -16,8 +16,10 @@ MENU_PRESET=&Pré-Definição
MENU_PRESET_8=Windows 8/8.1
MENU_PRESET_10=Windows 10
MENU_TOOLS=&Ferramentas
MENU_TOOLS_CHOICE_APP_FONT=Choice No!! Meiryo UI application &font
MENU_TOOLS_THREAD=Definir as fontes do sistema em encadeamentos separados
MENU_TOOLS_SEVEN=Calcular o tamanho das fontes igual ao Windows 7
MENU_TOOLS_NO_MULTI_RUN=&Don't run multiply
MENU_HELP=Aju&da
MENU_HELP_HELP=Aju&da
MENU_HELP_ABOUT=&Sobre o No!! Meiryo UI
Expand Down
4 changes: 3 additions & 1 deletion lang/zh-CN.lng
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; noMeiryoUI (C) 2005,2012-2023 Tatsuhiko Shoji,Gekka Tachibana,kingofotaku,LucidLoli,Luke Luo,HSSadboy
; noMeiryoUI (C) 2005,2012-2024 Tatsuhiko Shoji,Gekka Tachibana,kingofotaku,LucidLoli,Luke Luo,HSSadboy
; The sources for noMeiryoUI are distributed under the MIT open source license

[RESOURCE]
Expand All @@ -15,8 +15,10 @@ MENU_PRESET_8=Windows 8/8.1
MENU_PRESET_10=Windows 10
MENU_PRESET_11=Windows 11
MENU_TOOLS=工具(&T)
MENU_TOOLS_CHOICE_APP_FONT=Choice No!! Meiryo UI application &font
MENU_TOOLS_THREAD=在分开的线程中更改系统字体
MENU_TOOLS_SEVEN=采用与 Windows 7 中相同的方法计算文字大小
MENU_TOOLS_NO_MULTI_RUN=&Don't run multiply
MENU_HELP=帮助(&H)
MENU_HELP_HELP=显示帮助(&H)
MENU_HELP_ABOUT=关于 No!! Meiryo UI(&A)
Expand Down
4 changes: 3 additions & 1 deletion lang/zh-TW.lng
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; noMeiryoUI (C) 2005,2012-2023 Tatsuhiko Shoji,Gekka Tachibana,kingofotaku,Austin Chang,HSSadBoy,abc0922001
; noMeiryoUI (C) 2005,2012-2024 Tatsuhiko Shoji,Gekka Tachibana,kingofotaku,Austin Chang,HSSadBoy,abc0922001
; The sources for noMeiryoUI are distributed under the MIT open source license

[RESOURCE]
Expand All @@ -15,8 +15,10 @@ MENU_PRESET_8=Windows 8/8.1
MENU_PRESET_10=Windows 10
MENU_PRESET_11=Windows 11
MENU_TOOLS=工具(&T)
MENU_TOOLS_CHOICE_APP_FONT=Choice No!! Meiryo UI application &font
MENU_TOOLS_THREAD=在另一執行緒中變更字型(&A)
MENU_TOOLS_SEVEN=將字型大小視為與 Windows 7 相同(&7)
MENU_TOOLS_NO_MULTI_RUN=&Don't run multiply
MENU_HELP=說明(&H)
MENU_HELP_HELP=檢視說明(&C)
MENU_HELP_ABOUT=關於 No!! Meiryo UI (&A)
Expand Down
2 changes: 1 addition & 1 deletion program/country/default.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
noMeiryoUI (C) 2005,2012-2023 Tatsuhiko Shoji
noMeiryoUI (C) 2005,2012-2024 Tatsuhiko Shoji
The sources for noMeiryoUI are distributed under the MIT open source license
*/

Expand Down
2 changes: 1 addition & 1 deletion program/country/japan.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
noMeiryoUI (C) 2005,2012-2023 Tatsuhiko Shoji
noMeiryoUI (C) 2005,2012-2024 Tatsuhiko Shoji
The sources for noMeiryoUI are distributed under the MIT open source license
*/

Expand Down
2 changes: 1 addition & 1 deletion program/country/korea.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
noMeiryoUI (C) 2005,2012-2023 Tatsuhiko Shoji
noMeiryoUI (C) 2005,2012-2024 Tatsuhiko Shoji
The sources for noMeiryoUI are distributed under the MIT open source license
*/
#include <string.h>
Expand Down
2 changes: 1 addition & 1 deletion program/country/korea.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
noMeiryoUI (C) 2005,2012-2023 Tatsuhiko Shoji
noMeiryoUI (C) 2005,2012-2024 Tatsuhiko Shoji
The sources for noMeiryoUI are distributed under the MIT open source license
*/
namespace korea {
Expand Down
3 changes: 3 additions & 0 deletions program/langresource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,5 +280,8 @@ void readResourceFile(TCHAR *file)
readResourceItem(file, _T("MENU_TOOLS_CHOICE_APP_FONT"),
_T("Choice No!! Meiryo UI application &font")
);
readResourceItem(file, _T("MENU_TOOLS_NO_MULTI_RUN"),
_T("&Don't run multiply")
);
}

1 change: 1 addition & 0 deletions program/langresource.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ The sources for noMeiryoUI are distributed under the MIT open source license
#define MSG_WARNING 84
#define MSG_WIN11_22H2RESTRICTION 85
#define MENU_CHOICE_APP_FONT 86
#define MENU_DONT_RUN_MULTIPLY 87

extern void readResourceFile(TCHAR *file);

Expand Down
96 changes: 84 additions & 12 deletions program/noMeiryoUI.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
noMeiryoUI (C) 2005,2012-2023 Tatsuhiko Shoji
noMeiryoUI (C) 2005,2012-2024 Tatsuhiko Shoji
The sources for noMeiryoUI are distributed under the MIT open source license
*/
// noMeiryoUI.cpp : アプリケーションのエントリ ポイントを定義します。
Expand Down Expand Up @@ -37,6 +37,8 @@ static bool use7Compat = true;
bool has8Preset = true;
bool has10Preset = true;
bool has11Preset = true;
// 複数起動を許すか
bool multiRun = true;
TCHAR helpFileName[MAX_PATH];
RECT myMonitorLect;
bool firstMonitor = false;
Expand Down Expand Up @@ -268,6 +270,7 @@ int NoMeiryoUI::OnAppliStart(TCHAR *lpCmdLine)
usePreset = false;

loadConfig();
handleMultipleRun();

// メジャーバージョンを取得する
DWORD dwVersion = GetVersionForApp(majorVersion, minorVersion, buildNumber);
Expand Down Expand Up @@ -405,6 +408,9 @@ INT_PTR NoMeiryoUI::OnInitDialog()
appMenu->setEnabled(IDM_SET_8, has8Preset);
appMenu->setEnabled(IDM_SET_10, has10Preset);
appMenu->setEnabled(IDM_SET_11, has11Preset);
if (!multiRun) {
appMenu->CheckMenuItem(IDM_NO_MULTI_RUN, true);
}

// 先発のOSではフォントがない場合があるので
// 後発OS用のプリセットを使用不可とする。
Expand Down Expand Up @@ -861,6 +867,7 @@ void NoMeiryoUI::applyDisplayText()
appMenu->setText(IDM_SET_10, langResource[9].c_str(), FALSE);
appMenu->setText(2, langResource[10].c_str(), TRUE);
appMenu->setText(IDM_CHOICE_APP_FONT, langResource[MENU_CHOICE_APP_FONT].c_str(), FALSE);
appMenu->setText(IDM_NO_MULTI_RUN, langResource[MENU_DONT_RUN_MULTIPLY].c_str(), FALSE);
appMenu->setText(IDM_ANOTHER, langResource[MENU_TOOLS_THREAD].c_str(), FALSE);
appMenu->setText(IDM_COMPAT7, langResource[MENU_TOOLS_SEVEN].c_str(), FALSE);
appMenu->setText(3, langResource[13].c_str(), TRUE);
Expand Down Expand Up @@ -1180,14 +1187,11 @@ INT_PTR NoMeiryoUI::OnCommand(WPARAM wParam)
}
return (INT_PTR)0;
case IDM_COMPAT7:
if (appMenu->isChecked(IDM_COMPAT7)) {
appMenu->CheckMenuItem(IDM_COMPAT7, false);
WIN8_SIZE = true;
} else {
appMenu->CheckMenuItem(IDM_COMPAT7, true);
WIN8_SIZE = false;
}
updateDisplay();
toggleWin7aliculate();

return (INT_PTR)0;
case IDM_NO_MULTI_RUN:
toggleMultiRun();

return (INT_PTR)0;
case IDM_HELPTOPIC:
Expand All @@ -1201,6 +1205,39 @@ INT_PTR NoMeiryoUI::OnCommand(WPARAM wParam)

}

/**
* @brief Windows 7式計算のトグル処理
*/
void NoMeiryoUI::toggleWin7aliculate()
{
if (appMenu->isChecked(IDM_COMPAT7)) {
appMenu->CheckMenuItem(IDM_COMPAT7, false);
WIN8_SIZE = true;
}
else {
appMenu->CheckMenuItem(IDM_COMPAT7, true);
WIN8_SIZE = false;
}
updateDisplay();
}

/**
* @brief 複数起動フラグ切り替え
*/
void NoMeiryoUI::toggleMultiRun()
{
if (appMenu->isChecked(IDM_NO_MULTI_RUN)) {
appMenu->CheckMenuItem(IDM_NO_MULTI_RUN, false);
multiRun = true;
}
else {
appMenu->CheckMenuItem(IDM_NO_MULTI_RUN, true);
multiRun = false;
saveConfig();
}
saveConfig();
}

/**
* フォントを選択する。
*
Expand Down Expand Up @@ -2606,8 +2643,10 @@ void NoMeiryoUI::getWin10Ver(TCHAR *buf, DWORD major, DWORD minor)
break;
case 11:
_tcscpy_s(calledVer, _T("11"));
if (buildNumber > 22631) {
if (buildNumber > 26999) {
_tcscat_s(calledVer, _T(" Insider"));
} else if (buildNumber > 26000) {
_tcscat_s(calledVer, _T(" 2024 Update"));
} else if (buildNumber == 22631) {
_tcscat_s(calledVer, _T(" 2023 Update"));
} else if (buildNumber >= 22621) {
Expand Down Expand Up @@ -2770,7 +2809,7 @@ void NoMeiryoUI::showVersion(void)

_stprintf(version, verString, appName);
_stprintf(aboutContent,
_T("%s\n\nProgrammed By Tatsuhiko Syoji(Tatsu) 2005,2012-2023\nTranslated by %s"),
_T("%s\n\nProgrammed By Tatsuhiko Syoji(Tatsu) 2005,2012-2024\nTranslated by %s"),
version, transAuthor);

MessageBox(hWnd,
Expand All @@ -2790,6 +2829,8 @@ void NoMeiryoUI::saveConfig(void)
TCHAR drive[_MAX_DRIVE + 1];
TCHAR cDir[_MAX_DIR + 1];
HMODULE hModule;
int multiRunValue = 1;
TCHAR multiRunString[8];

// 実行ファイルのディレクトリを得る。
hModule = GetModuleHandle(EXE_NAME);
Expand All @@ -2804,10 +2845,18 @@ void NoMeiryoUI::saveConfig(void)

WritePrivateProfileString(CONFIG_SECTION, UIFONT_KEY, (LPCTSTR)(langResource[0].c_str()), iniFile);

if (multiRun) {
multiRunValue = 1;
} else {
multiRunValue = 0;
}
_stprintf(multiRunString, _T("%d"), multiRunValue);
WritePrivateProfileString(CONFIG_SECTION, MULTI_RUN_KEY, multiRunString, iniFile);

}

/**
* @brief 設定ファイルを保存する
* @brief 設定ファイルを読み込む
*/
void NoMeiryoUI::loadConfig(void)
{
Expand All @@ -2819,6 +2868,8 @@ void NoMeiryoUI::loadConfig(void)
TCHAR fontName[33];
HMODULE hModule;
int read;
int multiRunValue = 1;
TCHAR multiRunString[8];

// 実行ファイルのディレクトリを得る。
hModule = GetModuleHandle(EXE_NAME);
Expand All @@ -2837,6 +2888,27 @@ void NoMeiryoUI::loadConfig(void)
langResource[0] = fontName;
}

GetPrivateProfileString(CONFIG_SECTION, MULTI_RUN_KEY, _T("1"), multiRunString, 8, iniFile);
multiRunValue = _ttoi(multiRunString);
if (multiRunValue != 0) {
multiRun = true;
} else {
multiRun = false;
}

}

/**
* @brief 複数起動関連処理
*/
void NoMeiryoUI::handleMultipleRun(void)
{
if (multiRun) {
return;
}
HWND hWnd = FindWindow(NULL, langResource[TITLE].c_str());
if (hWnd != NULL) {
// Already running
ExitProcess(0);
}
}
5 changes: 5 additions & 0 deletions program/noMeiryoUI.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ The sources for noMeiryoUI are distributed under the MIT open source license
#define INI_FILE _T("noMeiryoUI.ini")
#define CONFIG_SECTION _T("Settings")
#define UIFONT_KEY _T("UIFontName")
#define MULTI_RUN_KEY _T("RunMultiple")

void initializeLocale(void);
BOOL CALLBACK MonitorNearMouseCallback(
Expand Down Expand Up @@ -149,10 +150,14 @@ class NoMeiryoUI : public DialogAppliBase {
void adjustWindowSize(void);
void saveConfig(void);
void loadConfig(void);
void toggleWin7aliculate();
void toggleMultiRun();
void handleMultipleRun(void);

protected:
INT_PTR OnCommand(WPARAM wParam);


public:
BaseDialog *createBaseDialog();
int OnAppliStart(TCHAR *lpCmdLine);
Expand Down
Loading

0 comments on commit adede07

Please sign in to comment.