Brestell Posted August 30, 2012 Share Posted August 30, 2012 I've been trying to send a mouse click to an inactive window, with ControlClick, but I can only get it to work when the window is active.Then I tried using ControlClick with AutoHotkey and it worked#n::ControlClick, x400 y200, GameTitle; This works with inactive window. #n::ControlClick,, GameTitle,,,, NA x400 y200 ; This does NOT work with inactive window.Then I tried again using ControlClick in Autoit, and this time it worked all of a sudden.$handle = WinGetHandle ( "GameTitle" ) ControlClick($handle,"","","",1,400,200)However, after a while AutoIt didn't work with the inactive window anymore.Later I found that it works if I do this:*Let the game be inactive and use AutoHotkey to send a mouse click*Now the AutoIt Script will work, as long as I don't activate the game window. If I do, AutoIt won't work if I inactivate the window again.I've tried analyzing the source code of AutoHotKey to see why it works but AutoIt doesn't, but I haven't solved it. I see that AutoHotkey is using SetActiveWindow(), but the game window actually never becomes active, its still in the background. But if I use AutoHotkey on any other software like Firefox, then it brings the Firefox window to the foreground.Also, AutoIt ControlClick does work on Firefox when its inactive. So it seems like it's the game that is wierd and not responding as it's supposed to. Any thoughts?I've also tried PostMessage, and SendMessage, but it doesn't work when the game is inactive. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 30, 2012 Moderators Share Posted August 30, 2012 Brestell,Welcome to the AutoIt forum. Unfortunately you appear to have missed the Forum Rules on your way in. Please read them now - particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked. See you soon with a legitimate question I hope. 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...
Recommended Posts