afimafis Posted May 26, 2014 Share Posted May 26, 2014 (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 May 26, 2014 by afimafis Link to comment Share on other sites More sharing options...
FireFox Posted May 26, 2014 Share Posted May 26, 2014 (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 May 26, 2014 by FireFox Link to comment Share on other sites More sharing options...
KaFu Posted May 26, 2014 Share Posted May 26, 2014 "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. OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
afimafis Posted May 26, 2014 Author Share Posted May 26, 2014 "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) Link to comment Share on other sites More sharing options...
KaFu Posted May 26, 2014 Share Posted May 26, 2014 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. OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
afimafis Posted June 2, 2014 Author Share Posted June 2, 2014 i tested many times my application but no any reaction from "control functions". it works well in normal windows screen.. any help ?? thanks Link to comment Share on other sites More sharing options...
Bert Posted June 3, 2014 Share Posted June 3, 2014 Is the screen locked when you test? The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
afimafis Posted June 13, 2014 Author Share Posted June 13, 2014 Is the screen locked when you test? locked means ? Link to comment Share on other sites More sharing options...
Bert Posted June 13, 2014 Share Posted June 13, 2014 locked means ? Seriously? OK.... Locked as in you have to enter a password to get back the desktop. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
afimafis Posted June 14, 2014 Author Share Posted June 14, 2014 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 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now