get application directory
char path[MAX_PATH] = { 0 }; GetModuleFileNameA(NULL, path, MAX_PATH); strrchr(path, '\\')[0] = '\0';