Ele*_*ios 1 winapi cmd batch-file user32 rundll32
我如何SetCursorPos从Windows RunDll32应用程序正确调用该函数?
如果我试试这个,它会将光标发送到右下角:
RunDll32.exe user32.dll,SetCursorPos 100, 100
Run Code Online (Sandbox Code Playgroud)
但是我将正确的值传递给它的参数:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms648394%28v=vs.85%29.aspx
PS:我对NirCMD应用程序等替代品不感兴趣,我知道它们,我只想知道我所做问题的答案,谢谢.
这是不可能的.RunDll32只能使用此签名调用函数:
void CALLBACK EntryPoint(HWND hwnd, HINSTANCE hinst, LPSTR lpszCmdLine, int nCmdShow);
Run Code Online (Sandbox Code Playgroud)
所以,如果你这样做
RunDll32.exe user32.dll,SetCursorPos 100 100
Run Code Online (Sandbox Code Playgroud)
你告诉你RunDll32.exe这样做:
SetCursorPos(0x314159, 0x265358, "100 100", 1)
Run Code Online (Sandbox Code Playgroud)
...前两个参数不在您的控制范围内(例如,在我的机器中,调用将光标移动到右上角).
来自文档的更多信息:
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 displayed
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2677 次 |
| 最近记录: |