Answer the question
In order to leave comments, you need to log in
How to include a library in Qt?
Good day everyone.
I'm trying to work with the mhook library in Qt 5.
The code:
#include <windows.h>
#include <iostream>
#include "mhook-lib\mhook.h"
NTSTATUS (NTAPI * CurRtlQueryElevationFlags)(DWORD* pFlags) = NULL;
NTSTATUS NTAPI TimedRtlQueryElevationFlags(DWORD* pFlag)
{
NTSTATUS ret = CurRtlQueryElevationFlags(pFlag);
*pFlag = 0;
return ret;
}
int main(int argc, char* argv[])
{
CurRtlQueryElevationFlags = (NTSTATUS (NTAPI * )(DWORD* ))GetProcAddress(GetModuleHandle(L"ntdll.dll"), "RtlQueryElevationFlags");
<b>if (Mhook_SetHook((PVOID*)&CurRtlQueryElevationFlags, (PVOID)TimedRtlQueryElevationFlags))</b>
MessageBeep(MB_OK);
if ((INT)ShellExecuteW(NULL, L"open", L"regedit.exe", NULL, NULL, SW_SHOWNORMAL) > 32)
{
printf("Success\n");
return 0;
}
return 0;
}
Answer the question
In order to leave comments, you need to log in
except for the headers, nothing was connected.
The error is that you didn't include the library itself, but only its headers. There are, of course, times when this is sufficient. But judging by the error - not in your case.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question