#include "commonunits.h"
/*
用于定义一个全局的静态变量(线程安全的).用它来初始化一个对象指针(函数指针).
Q_GLOBAL_STATIC_WITH_ARGS(type, name, arguments):
type:类型
name:变量名称
arguments:参数
*/
/*
Q_GLOBAL_STATIC_WITH_ARGS(CFileLogger, mainLogger, ("AssistLog"))
Q_GLOBAL_STATIC_WITH_ARGS(CFileLogger, transferLogger, ("DataTransfer"))
Q_GLOBAL_STATIC_WITH_ARGS(CFileLogger, minorLogger, ("MinorLog"))
Q_GLOBAL_STATIC_WITH_ARGS(CFileLogger, errorLogger, ("ErrorLog"))
Q_GLOBAL_STATIC_WITH_ARGS(CFileLogger, socketLogger, ("SocketLog"))
Q_GLOBAL_STATIC_WITH_ARGS(CFileLogger, testLogger, ("testLogger"))
Q_GLOBAL_STATIC(NoLOG, noLogger)
*/
bool g_bInit = false;
QStringList g_TipList;
void showWndTopMost(HWND hwnd)
{
RECT rect;
GetWindowRect(hwnd, &rect);
SetWindowPos(hwnd, HWND_TOPMOST, rect.left, rect.top, abs(rect.right - rect.left), abs(rect.bottom - rect.top), SWP_SHOWWINDOW | SWP_NOACTIVATE);
}
/*
CFileLogger *getTranferLog()
{
return transferLogger();
}
CFileLogger *getMainLog()
{
return mainLogger();
}
CFileLogger *getMinorLog()
{
return minorLogger();
}
CFileLogger *getErrorLog()
{
return errorLogger();
}
CFileLogger *getSocketLog()
{
return socketLogger();
}
CFileLogger *getTest()
{
return testLogger();
}
NoLOG *getNoLog()
{
return noLogger();
}
*/
// 定义是否将专项车同货车一样判断
#define CHECKSPTRUCK
bool IsTruck(int nVT)
{
if (nVT >= VT_Truck1 && nVT <= VT_Truck6)
return true;
#ifdef CHECKSPTRUCK
else if (nVT >= VT_SpTruck1 && nVT <= VT_SpTruck6)
return true;
#endif
else
return false;
}
bool likeVehPlate(const QString &sVLP1, const QString &sVLP2)
{
int n = 0;
for (int i = sVLP1.size() - 1, j = sVLP2.size() - 1; i >= 0 && j >= 0; i--, j--)
{
if (sVLP1.at(i) == sVLP2.at(j))
{
n++;
}
}
if (n >= 5)
return true;
else
return false;
}
QString getMemoryInfo()
{
HANDLE handle = GetCurrentProcess();
PROCESS_MEMORY_COUNTERS pmc;
//GetProcessMemoryInfo(handle, &pmc, sizeof(pmc));
QString sInfo = QString("内存:%1K,峰值内存:%2K,虚拟内存:%3K,峰值虚拟内存:%4K").arg(pmc.WorkingSetSize / 1024).arg(pmc.PeakWorkingSetSize / 1024).arg(pmc.PagefileUsage / 1024).arg(pmc.PeakPagefileUsage / 1024);
return sInfo;
}
void analysisInfo(const LMap &vehMapInfo, const QVariantList &checkListInfo, QString &sAnalyseInfo, QString &sAbnInfo, LHash &info)
{
if (!vehMapInfo.empty())
{
int nTravelCount = vehMapInfo.value("veh_stat_travel_totaldrivenum").toInt();
sAnalyseInfo.append(QString("•总行驶高速次数-%1\n").arg(nTravelCount));
int nTypeCount = vehMapInfo.value("veh_stat_trade_cashnum").toInt();
int nType = 1;
int nTmpCount = vehMapInfo.value("veh_stat_trade_othernum").toInt();
if (nTmpCount > nTypeCount)
{
nType = 2;
nTypeCount = nTmpCount;
}
nTmpCount = vehMapInfo.value("veh_stat_trade_unionpaynum").toInt();
if (nTmpCount > nTypeCount)
{
nType = 3;
nTypeCount = nTmpCount;
}
nTmpCount = vehMapInfo.value("veh_stat_trade_etcnum").toInt();
if (nTmpCount > nTypeCount)
{
nType = 4;
nTypeCount = nTmpCount;
}
nTmpCount = vehMapInfo.value("veh_stat_trade_alipaynum").toInt();
if (nTmpCount > nTypeCount)
{
nType = 6;
nTypeCount = nTmpCount;
}
nTmpCount = vehMapInfo.value("veh_stat_trade_wechatnum").toInt();
if (nTmpCount > nTypeCount)
{
nType = 7;
nTypeCount = nTmpCount;
}
info.insert("usualpayType", nType);
int nETCCont = vehMapInfo.value("veh_stat_medium_exwasteetcpassnum").toInt();
int nCPCCont = vehMapInfo.value("veh_stat_medium_exwastecpcpassnum").toInt();
sAnalyseInfo.append(QString("•CPC通行次数-%1,ETC通行次数-%2\n").arg(nCPCCont).arg(nETCCont));
if (nCPCCont > 0 || nETCCont >0)
{
if (nCPCCont > nETCCont)
info.insert(InF_UsualMedia, "CPC");
else
info.insert(InF_UsualMedia, "OBU");
}
int nVehGreenCount = vehMapInfo.value("veh_stat_ltc_num").toInt();
if (nVehGreenCount > 0)
{
sAnalyseInfo.append(QString("•绿通车检验合格比-%1%\n").arg(vehMapInfo.value("veh_stat_ltc_qualifiedpercent").toDouble()));
}
int nErrCount = vehMapInfo.value("veh_stat_travel_violationsnum").toInt();
sAnalyseInfo.append(QString("•违规次数-%1\n").arg(nErrCount));
//TODO 入口出口站样式 站代码还是名字
QString sOfenEnSta = vehMapInfo.value("veh_stat_travel_entollstationoftenly").toString();
QString sOfenExSta = vehMapInfo.value("veh_stat_travel_extollstationoftenly").toString();
if (sOfenEnSta.size())
sAnalyseInfo.append(QString("•常走入口站-%1\n").arg(sOfenEnSta));
if (sOfenExSta.size())
sAnalyseInfo.append(QString("•常走出口站-%1\n").arg(sOfenExSta));
if (sAnalyseInfo.size())
sAnalyseInfo.chop(1);
}
// 解析稽核信息
foreach (auto iter, checkListInfo)
{
LMap tMap = iter.toMap();
QString sExTime = tMap.value("extime").toDateTime().toString("yyyy-MM-dd hh:mm:ss");
QString sExStaName = tMap.value("exstaname").toString();
double dMoney = tMap.value("owefee").toInt() * 1.0 / 100;
sAbnInfo.append(QString("•[%1][%2]漏收%3元\n").arg(sExTime).arg(sExStaName).arg(dMoney, 0, 'f', 2, '0'));
}
if (sAbnInfo.size())
sAbnInfo.chop(1);
}
QString GetProcessFilePath(HANDLE hProcess)
{
QString sDir;
TCHAR tsFileDosPath[MAX_PATH + 1];
ZeroMemory(tsFileDosPath, sizeof(TCHAR)*(MAX_PATH + 1));
//if (0 == GetProcessImageFileName(hProcess, tsFileDosPath, MAX_PATH + 1))
// return "";
UINT uiLen = GetLogicalDriveStrings(0, NULL);
if (0 == uiLen)
return "";
PTSTR pLogicDriveString = new TCHAR[uiLen + 1];
ZeroMemory(pLogicDriveString, uiLen + 1);
uiLen = GetLogicalDriveStrings(uiLen, pLogicDriveString);
if (0 == uiLen)
{
delete[]pLogicDriveString;
return "";
}
TCHAR szDrive[3] = TEXT(" :");
PTSTR pDosDriveName = new TCHAR[MAX_PATH];
PTSTR pLogicIndex = pLogicDriveString;
do
{
szDrive[0] = *pLogicIndex;
uiLen = QueryDosDevice(szDrive, pDosDriveName, MAX_PATH);
if (0 == uiLen)
{
if (ERROR_INSUFFICIENT_BUFFER != GetLastError())
break;
delete[]pDosDriveName;
pDosDriveName = new TCHAR[uiLen + 1];
uiLen = QueryDosDevice(szDrive, pDosDriveName, uiLen + 1);
if (0 == uiLen)
break;
}
QString s1 = QString::fromWCharArray(tsFileDosPath);
QString s2 = QString::fromWCharArray(pDosDriveName);
if (s2.size() > 0 && s1.startsWith(s2))
{
sDir = QString::fromWCharArray(szDrive) + s1.mid(s2.size());
break;
}
while (*pLogicIndex++);
} while (*pLogicIndex);
delete[]pLogicDriveString;
delete[]pDosDriveName;
return sDir;
}
bool isTractor(int nVehClass)
{
if ((nVehClass == VC_GbContainer) || (nVehClass == VC_GbTractor) || (nVehClass == VC_GbContainer2))
return true;
return false;
}
bool compareTipInfo(const QString &arg1, const QString &arg2)
{
if (false == g_bInit)
{
g_bInit = true;
没有合适的资源?快使用搜索试试~ 我知道了~
windows hook SetWindowsHookEx 捕获键盘组合键 钩子
共105个文件
h:71个
cpp:9个
o:8个
需积分: 5 2 下载量 166 浏览量
2023-07-04
14:03:47
上传
评论
收藏 6.47MB RAR 举报
温馨提示
windows hook SetWindowsHookEx 捕获键盘组合键 QT ,调出主界面。 组合键配置在./conf/Assist.ini 文件中,目前是M+N 按键。钩子捕获按键.在qt 5.7.0 下编译运行没有问题。
资源推荐
资源详情
资源评论
收起资源包目录
windows hook SetWindowsHookEx 捕获键盘组合键 钩子 (105个子文件)
q736594722.htm.0 21KB
commonunits.cpp 11KB
watchcontrol.cpp 6KB
moc_watchcontrol.cpp 5KB
moc_DownloadManager.cpp 5KB
DownloadManager.cpp 4KB
moc_mainwindow.cpp 3KB
mainwindow.cpp 815B
commondef.cpp 632B
main.cpp 187B
Makefile.Debug 76KB
Log4qtd.dll 25.14MB
libeay32.dll 1.2MB
Log4qt.dll 496KB
ssleay32.dll 285KB
NetworkReply.exe 3.34MB
log4qt.h 24KB
commondef.h 15KB
logerror.h 15KB
logger.h 15KB
factory.h 15KB
logmanager.h 12KB
initialisationhelper.h 8KB
loggingevent.h 7KB
ttcclayout.h 6KB
appenderskeleton.h 6KB
fileappender.h 6KB
configuratorhelper.h 6KB
dailyrollingfileappender.h 5KB
datetime.h 5KB
propertyconfigurator.h 5KB
ilogmsg.h 5KB
writerappender.h 5KB
optionconverter.h 4KB
patternformatter.h 4KB
binaryfileappender.h 4KB
rollingfileappender.h 4KB
patternlayout.h 4KB
listappender.h 4KB
level.h 4KB
properties.h 3KB
consoleappender.h 3KB
levelrangefilter.h 3KB
layout.h 3KB
appender.h 3KB
asyncappender.h 3KB
rollingbinaryfileappender.h 3KB
appenderattachable.h 3KB
debugappender.h 3KB
levelmatchfilter.h 3KB
qmllogger.h 3KB
stringmatchfilter.h 3KB
colorconsoleappender.h 3KB
binarylogger.h 3KB
dailyfileappender.h 2KB
mainthreadappender.h 2KB
hierarchy.h 2KB
classlogger.h 2KB
commonunits.h 2KB
systemlogappender.h 2KB
ui_mainwindow.h 2KB
filter.h 2KB
mdc.h 2KB
simplelayout.h 2KB
loggerrepository.h 2KB
ndc.h 2KB
nullappender.h 2KB
binaryloggingevent.h 2KB
denyallfilter.h 2KB
simpletimelayout.h 2KB
signalappender.h 2KB
dispatcher.h 2KB
logstream.h 2KB
basicconfigurator.h 1KB
binarylayout.h 1KB
binarywriterappender.h 1KB
watchcontrol.h 994B
DownloadManager.h 921B
log4qtsharedptr.h 878B
binaryeventfilter.h 839B
binarytotextlayout.h 817B
wdcappender.h 579B
mainwindow.h 482B
binarylogstream.h 482B
binaryclasslogger.h 475B
log4qtshared.h 400B
xmllayout.h 375B
q736594722.htm 21KB
82917333.html 172KB
Assist.ini 113B
Assist.ini 113B
Makefile 24KB
DownloadManager.o 569KB
watchcontrol.o 546KB
mainwindow.o 518KB
commonunits.o 505KB
main.o 483KB
moc_DownloadManager.o 439KB
moc_mainwindow.o 406KB
moc_watchcontrol.o 309KB
共 105 条
- 1
- 2
资源评论
hymaliang1120
- 粉丝: 1
- 资源: 68
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功