如何正确地从windows SetCursorPos应用程序调用RunDll32函数?
如果我尝试这样做,它会将光标发送到右下角:
RunDll32.exe user32.dll,SetCursorPos 100, 100但我将适当的值传递给它的参数:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms648394%28v=vs.85%29.aspx
PS:我对诸如NirCMD应用程序这样的替代方案不感兴趣,我知道它们,我只想知道我所做的问题的答案,谢谢。
发布于 2015-04-04 13:31:35
这是不可能的RunDll32只能调用具有此签名的函数:
void CALLBACK EntryPoint(HWND hwnd, HINSTANCE hinst, LPSTR lpszCmdLine, int nCmdShow);所以如果你这么做
RunDll32.exe user32.dll,SetCursorPos 100 100您是在告诉RunDll32.exe这样做:
SetCursorPos(0x314159, 0x265358, "100 100", 1)...were前两个参数不在您的控制范围内(例如,在我的机器中,调用将光标移动到右上角)。
更多信息从医生那里
hwnd - window handle that should be used as the owner window for
any windows your DLL creates
hinst - your DLL's instance handle
lpszCmdLine - ASCIIZ command line your DLL should parse
nCmdShow - describes how your DLL's windows should be displayedhttps://stackoverflow.com/questions/29446864
复制相似问题