You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.1 KiB
C++
51 lines
1.1 KiB
C++
/*!
|
|
*FileName: SystemTool.h
|
|
*Author: Pan Yingdong
|
|
*Email: bob.pan@hzleaper.com
|
|
*Created:2020/6/15 15:14
|
|
*Note:
|
|
*/
|
|
#ifndef _H_SYSTEMTOOL_H_
|
|
#define _H_SYSTEMTOOL_H_
|
|
#include <vector>
|
|
#include <windows.h>
|
|
#include <process.h>
|
|
#include <Tlhelp32.h>
|
|
#include <winbase.h>
|
|
#include <string.h>
|
|
#define PSAPI_VERSION 1
|
|
#include <psapi.h>
|
|
#pragma comment(lib,"psapi.lib")
|
|
|
|
#include <vector>
|
|
#include <QString>
|
|
namespace SystemTool
|
|
{/*bReset == true ÖØÆô; false ¹Ø»ú*/
|
|
bool SystemShutDown(bool bReset);
|
|
inline char* UnicodeToAnsi(const wchar_t* szStr)
|
|
{
|
|
int nLen = WideCharToMultiByte(CP_ACP, 0, szStr, -1, NULL, 0, NULL, NULL);
|
|
if (nLen == 0)
|
|
{
|
|
return NULL;
|
|
}
|
|
char* pResult = new char[nLen];
|
|
WideCharToMultiByte(CP_ACP, 0, szStr, -1, pResult, nLen, NULL, NULL);
|
|
return pResult;
|
|
}
|
|
std::string TCHAR2STRING(TCHAR *STR);
|
|
bool isProcessRunning(const char* processName);
|
|
|
|
void GetProcessPath(DWORD dwProcessID, TCHAR* buffer);
|
|
|
|
std::vector<DWORD> getPIDByName(const char* processName);
|
|
void killZombieProcess(const char *curAppName);
|
|
|
|
QString SecondTimeString(quint64 value);
|
|
void ReflashBarIcon();
|
|
}
|
|
|
|
|
|
#endif
|
|
|