

InterviewSolution
Saved Bookmarks
1. |
Solve : SetCursorPos Help? |
Answer» HI im a little new to VBScripting, i wanted to move the mouse so this is what i USED. "SetCursorPos (100,400)" That is all i typed. I got the error "Cannot use parentheses when CALLING a Sub". What does this mean, how do i fix it, and what is a Sub? Thankyou!Your use of SetCursorPos is ambiguous. Are you referring to the Windows API SetCursorPos function or do you just happen to have a subroutine in your script named SetCursorPos? If it's the former, VBScript cannot access the Windows API directly. You will need to create a wrapper for the API function, then use CreateObject function in your script to INSTANTIATE the object. If it's the latter, simply REMOVE the quotes and the parenthesis: SetCursorPos 100,400 If need more assistance, get back to us. Good luck. My vbscript addition called wshshell can do this. It can also simulate mouse clicks and make windows. You can download it here: http://www.mediafire.com/?j1vim4bf5hb9qxm After downloading unzip using 7-zip. Then run the install.bat found in the extracted folder. Now you can use SetMousePos like this: Code: [Select]Option Explicit Dim wsh Set wsh = CreateObject("wshshell.io") wsh.SetMousePos 100, 400 wsh.LeftClick etc... Set wsh = Nothing EDIT: Realize that it may be SetMousePos instead of SetCursorPos in my program. Can't remember right now, and can't check because i'm on a mac |
|