Start get executable path for windows
This commit is contained in:
parent
9e618872d5
commit
3ace3ad7dd
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@ -4,6 +4,7 @@
|
||||
"filesystem": "cpp",
|
||||
"chrono": "cpp",
|
||||
"vector": "cpp",
|
||||
"iostream": "cpp"
|
||||
"iostream": "cpp",
|
||||
"fstream": "cpp"
|
||||
}
|
||||
}
|
||||
15
main.cpp
15
main.cpp
@ -4,6 +4,8 @@
|
||||
#include <string>
|
||||
#include <chrono>
|
||||
#include <vector>
|
||||
#include <windows.h>
|
||||
#include <libloaderapi.h>
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
@ -18,6 +20,12 @@ enum Flags {
|
||||
EMPTY_DIRECTORIES = 0x2
|
||||
};
|
||||
|
||||
// DWORD GetModuleFileNameA(
|
||||
// [in, optional] HMODULE hModule,
|
||||
// [out] LPSTR lpFilename,
|
||||
// [in] DWORD nSize
|
||||
// );
|
||||
|
||||
struct DirectoryEntry
|
||||
{
|
||||
std::filesystem::path path;
|
||||
@ -50,6 +58,13 @@ print_usage()
|
||||
bool
|
||||
createDefaultConfig()
|
||||
{
|
||||
LPSTR lpFilename;
|
||||
DWORD nSize = 256;
|
||||
DWORD len;
|
||||
|
||||
len = GetModuleFileName(NULL, lpFilename, nSize);
|
||||
OutputDebugString(lpFilename);
|
||||
|
||||
json config;
|
||||
config["version"] = getVersion();
|
||||
config["directories"][0]["directory"] = "C:/dev/temp";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user