Skip to content

Commit

Permalink
improve XgGenerateNumberingFilename
Browse files Browse the repository at this point in the history
  • Loading branch information
katahiromz committed Apr 18, 2024
1 parent 0f55235 commit 14644e4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion GUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2814,13 +2814,16 @@ BOOL __fastcall XgOnOpen(HWND hwnd)
return FALSE;
}

XGStringW __fastcall XgGenerateNumberingFilename(HWND hwnd, LPCWSTR pszText, LPSYSTEMTIME pLocalTime, INT iFile)
// 連番ファイル名を生成する。
XGStringW __fastcall
XgGenerateNumberingFilename(HWND hwnd, LPCWSTR pszText, LPSYSTEMTIME pLocalTime, INT iFile)
{
WCHAR szN[32], szN1[32], szN2[32], szN3[32], szN4[32], szN5[32], szN6[32];
WCHAR szW[32], szH[32];
WCHAR szYear[32], szMonth[32], szDay[32];
WCHAR szHour[32], szMinute[32], szSecond[32];
WCHAR szComputer[64], szUser[64];
LPCWSTR aszWeekDay[7] = { L"Sun", L"Mon", L"Tue", L"Wed", L"Thu", L"Fri", L"Sat" };

XGStringW str = pszText;

Expand Down Expand Up @@ -2856,6 +2859,7 @@ XGStringW __fastcall XgGenerateNumberingFilename(HWND hwnd, LPCWSTR pszText, LPS
xg_str_replace_all(str, L"%h", szHour);
xg_str_replace_all(str, L"%m", szMinute);
xg_str_replace_all(str, L"%s", szSecond);
xg_str_replace_all(str, L"%w", aszWeekDay[pLocalTime->wDayOfWeek]);

DWORD cchComputer = _countof(szComputer);
GetComputerNameW(szComputer, &cchComputer);
Expand All @@ -2865,6 +2869,8 @@ XGStringW __fastcall XgGenerateNumberingFilename(HWND hwnd, LPCWSTR pszText, LPS
GetUserNameW(szUser, &cchUser);
xg_str_replace_all(str, L"%U", szUser);

xg_str_replace_all(str, L"%%", L"%");

return str;
}

Expand Down

0 comments on commit 14644e4

Please sign in to comment.