#include #include "detours/include/detours.h" #include #include HRESULT (WINAPI *RealCoCreateInstance)(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID riid, LPVOID *ppv) = CoCreateInstance; HRESULT WINAPI MyCoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID riid, LPVOID *ppv) { return RealCoCreateInstance(rclsid, pUnkOuter, dwClsContext, riid, ppv); } int main(int argc, char *argv[]) { DetourTransactionBegin(); long l = DetourAttach(&(PVOID&)RealCoCreateInstance, MyCoCreateInstance); if (l != 0) { qWarning() << "Attach failed. Error" << l; } else { qInfo() << "Attach success!"; } DetourTransactionCommit(); QCoreApplication::setOrganizationName("Org"); QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QApplication app(argc, argv); QWebEngineView view; view.resize(800, 600); view.show(); return app.exec(); }