@@ -64,24 +64,24 @@ std::filesystem::path CControlProcess::GetIniFileName() const
64
64
*/
65
65
std::filesystem::path CControlProcess::GetPrivateIniFileName (const std::wstring& exeIniPath, const std::wstring& filename) const
66
66
{
67
+ const auto nFolder = ::GetPrivateProfileInt (L" Settings" , L" UserRootFolder" , 0 , exeIniPath.c_str ());
67
68
KNOWNFOLDERID refFolderId;
68
- switch (int nFolder = :: GetPrivateProfileInt ( L" Settings " , L" UserRootFolder " , 0 , exeIniPath. c_str ()) ) {
69
+ switch (nFolder) {
69
70
case 1 :
71
+ case 3 :
70
72
refFolderId = FOLDERID_Profile; // ユーザーのルートフォルダー
71
73
break ;
72
74
case 2 :
73
75
refFolderId = FOLDERID_Documents; // ユーザーのドキュメントフォルダー
74
76
break ;
75
- case 3 :
76
- refFolderId = FOLDERID_Desktop; // ユーザーのデスクトップフォルダー
77
- break ;
77
+
78
78
default :
79
79
refFolderId = FOLDERID_RoamingAppData; // ユーザーのアプリケーションデータフォルダー
80
80
break ;
81
81
}
82
82
83
83
PWSTR pFolderPath = nullptr ;
84
- ::SHGetKnownFolderPath (refFolderId, KF_FLAG_DEFAULT, nullptr , &pFolderPath);
84
+ ::SHGetKnownFolderPath (refFolderId, KF_FLAG_DEFAULT_PATH, NULL , &pFolderPath);
85
85
std::filesystem::path privateIniPath (pFolderPath);
86
86
::CoTaskMemFree (pFolderPath);
87
87
@@ -92,6 +92,9 @@ std::filesystem::path CControlProcess::GetPrivateIniFileName(const std::wstring&
92
92
{
93
93
subFolder = L" sakura" ;
94
94
}
95
+ if (nFolder == 3 ) {
96
+ privateIniPath.append (" Desktop" );
97
+ }
95
98
privateIniPath.append (subFolder);
96
99
97
100
if (const auto * pCommandLine = CCommandLine::getInstance (); pCommandLine->IsSetProfile () && *pCommandLine->GetProfileName ()) {
0 commit comments