Sign in to follow this  
Followers 0
Brestell

Strange behavior ControlClick

2 posts in this topic

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.

Share this post


Link to post
Share on other sites



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. :naughty:

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._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0