Jump to content

Recommended Posts

Posted

Hello, i'm new to this language. I've searched in the help chm for a way to change what happens when user clicks a button...i woould need some help plz..is it is possible

Posted

Thanks. I've read the examples from gui reference; good to know. What i want to do: being given a window not from a gui I made), I want to have my program in the background and, when a user click a specific button in that window, my program to show a message box(par example).

I don't know how to react to an event from an outside window. I can though get the position of the button i want to catch and use some mouse events when the user clicks in that area, but i didn't find the events on mouse click, just functions to perform clicks and other mouse operations.

Posted

If you want to do OnEvent Mode (I prefer it)

At the begging of the script write a line of code: Opt("GUIOnEventMode",1) to set the mode to OnEvent

After creating the control have a line of code: GUIControlSetOnEvent($button,"Function") to set the Event to the control

Then define the function

Func Function()
     MsgBox(0,"Title","Text")
EndFunc
  • Moderators
Posted

WinExists() + WinActive() + ControlGetFocus() + _IsPressed()

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Posted

If you want to do OnEvent Mode (I prefer it)

At the begging of the script write a line of code: Opt("GUIOnEventMode",1) to set the mode to OnEvent

After creating the control have a line of code: GUIControlSetOnEvent($button,"Function") to set the Event to the control

Then define the function

Func Function()
     MsgBox(0,"Title","Text")
EndFunc
I did not create the control, and $button shoul be the controlID as returned by the fucntion GUICtrlCreate(..)..

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
  • Recently Browsing   0 members

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