Sign in to follow this  
Followers 0
VeryUniqueUsername

Send MouseMove to background window

18 posts in this topic

#1 ·  Posted (edited)

Hi, I need to send an actual mouse move to not active window without getting it activated, not just to change it's coordinates, but an actual move of the cursor by strict amount of pixels, how can I do it with AutoIt and is it possible at all, help please, I hope to see some examples if possible.

Edited by VeryUniqueUsername

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Yes it is.

Something like this

$aWinPos = WinGetPos("NonActiveWindowTitle")

If Not @error Then
    MouseMove($aWinPos[0] + ($aWinPos[2] / 2), $aWinPos[1] + ($aWinPos[3] / 2))
    Exit
EndIf

MsgBox(0,"Error","WinGetPos Error")
Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

Yes it is.

Something like this

Sad, but it moves my mouse when I'm doing something, so it doesn't affect the needed background window.

Share this post


Link to post
Share on other sites

Ok, Then I dont understand you, a mouse move moves the mouse, thats all it does.

The whole problem is that part of the information is hidden in the topic title. :)

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Should I understand developers words as it is impossible with AutoIt, and I have to continue my searches?

Share this post


Link to post
Share on other sites

Should I understand developers words as it is impossible with AutoIt, and I have to continue my searches?

Understand them however you wish, but you could try explaining your need a little more clearly.

I'm not the worlds greatest interpreter but I cannot be alone here.


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

I must have drank my coffee from the silly cup this morning Jos, cause I still dont get it :)

Unless OP is meaning the cursor maybe.

I'll try to explain it other way: I need to send a some kind of an event, that will tell the background (not active) process/window information that mouse was moved, so the program can react on it.

Share this post


Link to post
Share on other sites

Try to understand this as you follow the concept.

Lets just say you have 3 windows open Window A and Window B and Window C. It makes no difference at all which window is on top and active because the Mouse is in a layer above all of those. The Mouse cursor is always above all windows. and I think what you are wanting to do is a click-through action. That has nothing what so ever to do with moving the mouse. MouseMove() will do exactly as the function name suggests, it will MOVE the mouse with absolutely no regard for whatever windows are under it.

Now if you are talking about clicking something with the mouse; then it becomes a different story but only up to a point. The window directly below the given mouse position is the window that will be acted on which may not be the top window at all. It might just be an empty spot on the desktop or some other place.

Now, if you are looking to perform a mouse button action on another Window; you should be delving into the help file and looking at the Window Management >> Controls section to see the functions that are available to you there; some of which will work on a non-active window.

I have seen apps that did allow a click-through action but none using AutoIt code and they were always apps that were A) small Windows and :) had a transparency ability.

I have one installed on my wifes computer as a matter of fact but I've never had enough interest to even look to see what language it was written in on top of which the click-through option very quickly became a pain in the a55 so I disabled it.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

Sad, but I don't need to click at all. I'll try to explain it again, with example for now. Let's say we have some shooter game, and we need to turn character to the left or to the right for strict 50px, and we want to do it automatically while working or doing other stuff.

Share this post


Link to post
Share on other sites

Wow, you need to read the Forum rules >> http://www.autoitscript.com/forum/forum-2/announcement-13-forum-rules/


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

I said "for example" I don't know how to explain more informative due to lack of language knowledge, if people don't understand. Soft requires precise mouse movement to work, what can I do.

If I'd need something for gaming there is a lot of other stuff to use.

Edited by VeryUniqueUsername

Share this post


Link to post
Share on other sites

Simple answer is in the explaination I posted above. The functionality you want is not limited by AutoIt, it is limited by Windows.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

Simple answer is in the explaination I posted above. The functionality you want is not limited by AutoIt, it is limited by Windows.

Thanks, that's all I need to know.

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0