Jump to content

What are the underlying differenced between ControlClick() and Click()


Recommended Posts

ControlClick() and Click()

I'm curious what the underlying differences in AutoIt's code are between those two functions when sending the input to a background window.

The reason:

Click() doesn't seem to work as far as sending input to the window of a game when it is in the background whereas ControlClick() does succeed.

I have also attempted to use PostMessage in C# without success on sending the click to an un-focused window.

Link to comment
Share on other sites

Click works by acting just like the mouse pointer when clicking. Can you take a mouse pointer and click on a window that is behind another window? Of course not.

Control click sends a click to the control of a window. It makes no difference if the window is active or not for you are sending it to a control.

Link to comment
Share on other sites

You mean MouseClick(). MouseClick() preforms it's action using either mouse_event or SendInput with additional processing to transform the raw string to VK_* values as necessary. <- in the case of Send(), wasn't concentrating...

ControlClick() uses several calls to AttachThreadInput if the window is in background to preform the task of sending the input through an active window medium (not sure though). Refer to this post about the subject. AutoIt is currently using better code than what the code source of pre AI releases.

Edited by Authenticity
Link to comment
Share on other sites

You mean MouseClick(). MouseClick() preforms it's action using either mouse_event or SendInput with additional processing to transform the raw string to VK_* values as necessary. <- in the case of Send(), wasn't concentrating...

ControlClick() uses several calls to AttachThreadInput if the window is in background to preform the task of sending the input through an active window medium (not sure though). Refer to this post about the subject. AutoIt is currently using better code than what the code source of pre AI releases.

Ah ok, thanks for this information.

Link to comment
Share on other sites

You mean MouseClick(). MouseClick() preforms it's action using either mouse_event or SendInput with additional processing to transform the raw string to VK_* values as necessary. <- in the case of Send(), wasn't concentrating...

ControlClick() uses several calls to AttachThreadInput if the window is in background to preform the task of sending the input through an active window medium (not sure though). Refer to this post about the subject. AutoIt is currently using better code than what the code source of pre AI releases.

what you said! :)
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...