klukkluk Posted December 13, 2010 Share Posted December 13, 2010 (edited) Hello i want to do some few shortcut actions when some keys are pressed however this doesnt work if i have any window open :[ so how do i do something like this in background? MouseMove (,,) MouseDown () MouseMove (,,) MouseUp () hope someone can help Edited December 13, 2010 by klukkluk Link to comment Share on other sites More sharing options...
wakillon Posted December 13, 2010 Share Posted December 13, 2010 (edited) Hello i want to do some few shortcut actions when some keys are pressed however this doesnt work if i have any window open :[ so how do i do something like this in background? MouseMove (,,) MouseDown () MouseMove (,,) MouseUp () hope someone can help See help file for Mouse functions : MouseMove, MouseClick, MouseDown, MouseUp and _IsPressed... Be more precise, what action do you want to do ? Edited December 13, 2010 by wakillon AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
klukkluk Posted December 13, 2010 Author Share Posted December 13, 2010 what i got now is ControlClcik (windowtitle, left, x, y,) but i cant write Controlclick (windowtitle, mousedownleft, x, y) Link to comment Share on other sites More sharing options...
wakillon Posted December 13, 2010 Share Posted December 13, 2010 what i got now is ControlClcik (windowtitle, left, x, y,) but i cant write Controlclick (windowtitle, mousedownleft, x, y) HelpFile : ControlClick ( "title", "text", controlID [, button [, clicks [, x [, y ]]]] ) I don't see the "text" and controlID part... Use autoitWindowinfo tool for get them ! AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
klukkluk Posted December 15, 2010 Author Share Posted December 15, 2010 HelpFile : ControlClick ( "title", "text", controlID [, button [, clicks [, x [, y ]]]] ) I don't see the "text" and controlID part... Use autoitWindowinfo tool for get them ! but my script moves the mouse to a postion and then holds down the left mouse button, then moves to another position and the realeses the left mousebutton, cant get controlclick to make that work :/ Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 15, 2010 Moderators Share Posted December 15, 2010 klukkluk,my script moves the mouse to a postion and then holds down the left mouse button, then moves to another position and the realeses the left mousebutton, cant get controlclick to make that workQuite correct - but did you look at the Mouse commands in the Help file? Perhaps not or MouseClickDrag might have seemed something to try! M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
JohnOne Posted December 15, 2010 Share Posted December 15, 2010 but my script moves the mouse to a postion and then holds down the left mouse button, then moves to another position and the realeses the left mousebutton, cant get controlclick to make that work :/There isnt a way I have found to do what you want, I have tried in the past, and failed.I'm not suggesting it is impossible, rather trying to save you wasting time, I have searched the forums from top to bottom, quite some time back and come up blank.I also tried _WinAPI_Mouse_Event() messages unsuccessfully. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 15, 2010 Moderators Share Posted December 15, 2010 JohnOne,Did you see my post above? MouseClickDrag does exactly that - here it is moving the GUI: #include <GuiConstantsEx.au3> $hGUI = GUICreate("Test", 300, 200) GUISetState() Sleep(1000) $aPos = WinGetPos($hGUI) MouseClickDrag("primary", $aPos[0] + 100, $aPos[1] + 10, $aPos[0] + 250, $aPos[1] + 250, 25) While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit EndSwitch WEndM23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
JohnOne Posted December 15, 2010 Share Posted December 15, 2010 Yes M23, I did see it, but I think the author if after something else (with mentioning background) The way I understand it, as ControlClick is to MouseClick, the OP is would be wanting ControlClickDrag, kind of emulating MouseClickDrag, but without the Apparent moving of the mouse. Although I have been known to interpret a question incorrectly in the past. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Altometer Posted December 15, 2010 Share Posted December 15, 2010 I believe that the OP wants to manipulate background windows with mouse movements without interfering with their foreground. IE: Your computer will play minesweeper while you browse the internet on Google chrome. I know how to automate multiple windows using http://cpnmouse.sourceforge.net/ and having multiple cursors, but as far as I know, you can only operate the mouse on one layer with autoit. so in other words, it WILL inter fear with what you are already working with. Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted December 15, 2010 Share Posted December 15, 2010 Maybe you could send WM_MOUSEMOVE and stuff. Try that. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
TFransen Posted April 27, 2012 Share Posted April 27, 2012 I know this is a necropost, but here you go. Helped me a lot. Func ControlClickDrag($wHandle, $Button="left", $X1="", $Y1="", $X2="", $Y2="") Local $MK_LBUTTON = 0x0001 Local $WM_LBUTTONDOWN = 0x0201 Local $WM_LBUTTONUP = 0x0202 Local $MK_RBUTTON = 0x0002 Local $WM_RBUTTONDOWN = 0x0204 Local $WM_RBUTTONUP = 0x0205 Local $WM_MOUSEMOVE = 0x0200 Local $i = 0 Select Case $Button = "left" $Button = $MK_LBUTTON $ButtonDown = $WM_LBUTTONDOWN $ButtonUp = $WM_LBUTTONUP Case $Button = "right" $Button = $MK_RBUTTON $ButtonDown = $WM_RBUTTONDOWN $ButtonUp = $WM_RBUTTONUP EndSelect DllCall("user32.dll", "int", "SendMessage", "hwnd", $wHandle, "int", $ButtonDown, "int", $Button, "long", _MakeLong($X1, $Y1)) DllCall("user32.dll", "int", "SendMessage", "hwnd", $wHandle, "int", $ButtonUp, "int", $Button, "long", _MakeLong($X2, $Y2)) EndFunc Func _MakeLong($LoWord,$HiWord) Return BitOR($HiWord * 0x10000, BitAND($LoWord, 0xFFFF)) EndFunc Link to comment Share on other sites More sharing options...
ntprohd Posted June 14, 2016 Share Posted June 14, 2016 On 28/4/2012 at 1:56 AM, TFransen said: I know this is a necropost, but here you go. Helped me a lot. Func ControlClickDrag($wHandle, $Button="left", $X1="", $Y1="", $X2="", $Y2="") Local $MK_LBUTTON = 0x0001 Local $WM_LBUTTONDOWN = 0x0201 Local $WM_LBUTTONUP = 0x0202 Local $MK_RBUTTON = 0x0002 Local $WM_RBUTTONDOWN = 0x0204 Local $WM_RBUTTONUP = 0x0205 Local $WM_MOUSEMOVE = 0x0200 Local $i = 0 Select Case $Button = "left" $Button = $MK_LBUTTON $ButtonDown = $WM_LBUTTONDOWN $ButtonUp = $WM_LBUTTONUP Case $Button = "right" $Button = $MK_RBUTTON $ButtonDown = $WM_RBUTTONDOWN $ButtonUp = $WM_RBUTTONUP EndSelect DllCall("user32.dll", "int", "SendMessage", "hwnd", $wHandle, "int", $ButtonDown, "int", $Button, "long", _MakeLong($X1, $Y1)) DllCall("user32.dll", "int", "SendMessage", "hwnd", $wHandle, "int", $ButtonUp, "int", $Button, "long", _MakeLong($X2, $Y2)) EndFunc Func _MakeLong($LoWord,$HiWord) Return BitOR($HiWord * 0x10000, BitAND($LoWord, 0xFFFF)) EndFunc I tried but it did not work Link to comment Share on other sites More sharing options...
BrewManNH Posted June 14, 2016 Share Posted June 14, 2016 You necroposted a necropost to tell the user, who hasn't been here in 4 years, that it didn't work, but completely failed to say what didn't work. Also you didn't show what your script looks like so no one will be able to help you. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
ntprohd Posted June 18, 2016 Share Posted June 18, 2016 On 14/6/2016 at 9:39 AM, BrewManNH said: Bạn necroposted một necropost để nói cho người dùng, người đã không được ở đây trong 4 năm, nó đã không làm việc, nhưng hoàn toàn không nói gì không làm việc. Ngoài ra bạn không hiển thị những gì kịch bản của bạn trông giống như vậy sẽ không có ai có thể giúp bạn. I just want a func like ControlClickDrag Link to comment Share on other sites More sharing options...
Developers Jos Posted June 18, 2016 Developers Share Posted June 18, 2016 3 hours ago, ntprohd said: I just want a func like ControlClickDrag That doesn't tell us anything. What is it you want to do and what isn't working for you in the example posted in this thread? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
ntprohd Posted June 19, 2016 Share Posted June 19, 2016 (edited) I tried to drag the mouse up and down while using "Func ControlClickDrag" TightVNC Viewer window but it did not work, who can give me a complete example. thank you very much. #include <SendMessage.au3> #Include <WinAPI.au3> Global $wHandle = "iPhone - TightVNC Viewer" ControlClickDrag($wHandle,"left",100,500,100,80) Func ControlClickDrag($wHandle, $Button="left", $X1="", $Y1="", $X2="", $Y2="") Local $MK_LBUTTON = 0x0001 Local $WM_LBUTTONDOWN = 0x0201 Local $WM_LBUTTONUP = 0x0202 Local $MK_RBUTTON = 0x0002 Local $WM_RBUTTONDOWN = 0x0204 Local $WM_RBUTTONUP = 0x0205 Local $WM_MOUSEMOVE = 0x0200 Local $i = 0 Select Case $Button = "left" $Button = $MK_LBUTTON $ButtonDown = $WM_LBUTTONDOWN $ButtonUp = $WM_LBUTTONUP Case $Button = "right" $Button = $MK_RBUTTON $ButtonDown = $WM_RBUTTONDOWN $ButtonUp = $WM_RBUTTONUP EndSelect DllCall("user32.dll", "int", "SendMessage", "hwnd", $wHandle, "int", $ButtonDown, "int", $Button, "long", _MakeLong($X1, $Y1)) DllCall("user32.dll", "int", "SendMessage", "hwnd", $wHandle, "int", $ButtonUp, "int", $Button, "long", _MakeLong($X2, $Y2)) EndFunc Func _MakeLong($LoWord,$HiWord) Return BitOR($HiWord * 0x10000, BitAND($LoWord, 0xFFFF)) EndFunc Edited June 19, 2016 by ntprohd Link to comment Share on other sites More sharing options...
Developers Jos Posted June 19, 2016 Developers Share Posted June 19, 2016 Looks like you are using a window handle as control handle? What does Au3Info tell you for the control you are trying to drag&Drop? by the way: Doubt that this will work on a VNC sessions as that probably is very graphical, but not sure. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
ntprohd Posted June 19, 2016 Share Posted June 19, 2016 4 hours ago, Jos said: Looks like you are using a window handle as control handle? What does Au3Info tell you for the control you are trying to drag&Drop? by the way: Doubt that this will work on a VNC sessions as that probably is very graphical, but not sure. Jos Here is what I get from Au3Info Link to comment Share on other sites More sharing options...
Developers Jos Posted June 19, 2016 Developers Share Posted June 19, 2016 So, is this whole window this control or are there actually multiple controls of the VNC window that can be separately addressed? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. 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