Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
678 B
2
Indexable
Never
#include <iostream>
#include <Windows.h>
#include <ShlObj.h>
#include <string>

std::wstring GetSaveFilePath() {
    PWSTR localAppDataPath;
    if (SUCCEEDED(SHGetKnownFolderPath(FOLDERID_LocalAppData, 0, NULL, &localAppDataPath))) {
        std::wstring saveFilePath = std::wstring(localAppDataPath) + L"\\Growtopia\\Save.dat";
        CoTaskMemFree(localAppDataPath);
        return saveFilePath;
    }
    return L"";
}

int main() {
    std::wstring filePath = GetSaveFilePath();

    if (!filePath.empty()) {
        std::wcout << L"Dosya yolu: " << filePath << std::endl;
    } else {
        std::wcout << L"Dosya yolu bulunamadı." << std::endl;
    }

    return 0;
}