31 lines
583 B
C
31 lines
583 B
C
|
#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
|
||
|
|