fast/Platform/util.h

31 lines
583 B
C
Raw Normal View History

2025-01-20 10:30:01 +08:00
#ifndef UITIL_H
#define UITIL_H
#ifdef WIN32
#include <Windows.h>
#include <wingdi.h>
#include <tlhelp32.h>
#include <WinUser.h>
#include <wtsapi32.h>
#include <UserEnv.h>
#endif
#include <string>
class Uitil
{
public:
Uitil();
static std::wstring stringToWString(const std::string &string);
static HANDLE getCurrentUserToken();
static bool runProgAsCurUser(HANDLE token, const std::string &progPath, const std::string &progArgs);
static bool RunProgAsCurUserAdminPrivilege(const std::string &progPath, const std::string &progArgs);
};
#endif // UITIL_H