我正在围绕 .NET 和 Win API 创建一个层。在用户进入主函数之前我需要准备一些东西,比如调用GetMessage
函数。
是否可以从 dll 启动程序,然后在单独的线程上调用自定义主函数?
如果我让在不同的线程上GetMessage
运行会更容易,但是一旦我调用主要威胁,鼠标就会大大减慢几乎一分钟,就好像我根本没有调用一样。但是当我在 Visual Studio 中调试时,它确实输入了,所以这不是问题。SetWindowsHookEx
WH_MOUSE_LL
GetMessage
GetMessage
希望有人可以提供帮助。
更新
这就是我想要实现的目标。
用户源(cpp)
include MyDLL
custom main(this main is defined by a user)
{
}
我的DLL (cpp)
main(real starting point of the application)
{
set the windows hooks
call the main defined by the user on a different thread
message loop
}