Jump to content

Recommended Posts

Posted (edited)
hello,
 
i added following codes for mouse move. but could not see any mouse movements
need your valuable help
 
thanks
 
 
 
 
 
Local $hPrev = _WinAPI_GetThreadDesktop(_WinAPI_GetCurrentThreadId())
Local $hDesktop = _WinAPI_CreateDesktop('MyDesktop', BitOR($DESKTOP_CREATEWINDOW, $DESKTOP_SWITCHDESKTOP))
 
 
If Not $hDesktop Then
    MsgBox(BitOR($MB_ICONERROR, $MB_SYSTEMMODAL), 'Error', 'Unable to create desktop.')
    Exit
EndIf
 
; Switch to the newly created desktop
_WinAPI_SwitchDesktop($hDesktop)
 
; Run "calc.exe" on "MyDesktop" and wait until a process will not be closed by user
Local $pText = _WinAPI_CreateString('MyDesktop')
Local $tProcess = DllStructCreate($tagPROCESS_INFORMATION)
Local $tStartup = DllStructCreate($tagSTARTUPINFO)
DllStructSetData($tStartup, 'Size', DllStructGetSize($tStartup))
DllStructSetData($tStartup, 'Desktop', $pText)
 
 
;_WinAPI_CreateProcess('', @SystemDir & 'calc.exe', 0, 0, 0, $CREATE_NEW_PROCESS_GROUP, 0, 0, DllStructGetPtr($tStartup), DllStructGetPtr($tProcess))
;~ Then
 
_WinAPI_Mouse_Event($MOUSEEVENTF_MOVE,100,100)
_WinAPI_Mouse_Event($MOUSEEVENTF_MOVE, 653, 454)
_WinAPI_Mouse_Event($MOUSEEVENTF_MOVE, 100, 0, 0, 0)
_WinAPI_Mouse_Event(BitAND($MOUSEEVENTF_ABSOLUTE, $MOUSEEVENTF_MOVE), 100, 0, 0, 0)
 
;~ ProcessWaitClose(DllStructGetData($tProcess, 'ProcessID'))
MouseMove(1329,99)
Edited by afimafis
Posted (edited)

Hi,

Welcome to the autoit forum :)

Please use autoit code tags to post your code, and also post a working code (here the includes are missing).

Br, FireFox.

Edited by FireFox
Posted

"The desktops associated with the interactive window station, Winsta0, can be made to display a user interface and receive user input, but only one of these desktops at a time is active. This active desktop, also known as the input desktop, is the one that is currently visible to the user and that receives user input."

http://msdn.microsoft.com/en-us/library/windows/desktop/ms682573%28v=vs.85%29.aspx

Use controlsend() / controlclick() instead.

Posted

"The desktops associated with the interactive window station, Winsta0, can be made to display a user interface and receive user input, but only one of these desktops at a time is active. This active desktop, also known as the input desktop, is the one that is currently visible to the user and that receives user input."

http://msdn.microsoft.com/en-us/library/windows/desktop/ms682573%28v=vs.85%29.aspx

Use controlsend() / controlclick() instead.

 

thanks i tried controlsend and controlclick . but they did not work

codes below do not work ?

_WinAPI_Mouse_Event($MOUSEEVENTF_MOVE,100,100)
_WinAPI_Mouse_Event($MOUSEEVENTF_MOVE, 653, 454)
_WinAPI_Mouse_Event($MOUSEEVENTF_MOVE, 100, 0, 0, 0)
Posted

The control* functions are the only ones which WILL work. Test your application automation on the default desktop first to ensure the calls are all right. Only after that add the functions to run it one a new (not visible) desktop.

Posted

i tested many times my application but no any reaction from "control functions". it works well in normal windows screen.. any help ??

thanks

  • 2 weeks later...
Posted

Seriously?

OK....

Locked as in you have to enter a password to get back the desktop.

no bro. so problem still exists . any idea ? thanks

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...