Jump to content

Newbie Q: Way to tell if user clicked a window?

Recommended Posts

Sorry, my question was put wrongly.

I mean to find out if a user has hit a *control* in a window, or hit enter for the default control of the window.

I want to trap inputs on a simple dialog and send them to another app which has a lousy interface.

PS I am just coming across the GUI aspects of the beta AutoIt, and that will prob. be best to just make a new simple dialog.


If I am too verbose, just say so. You don't need to run on and on.

Link to post
Share on other sites

You could do something kinda wacky and put a huge transparent GUI over the screen (can you do that?) and just get the X and Y of each click and send that to the other app?

"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
Link to post
Share on other sites

For trapping mouse, you can try the code in http://www.autoitscript.com/fileman/users/public/CyberSlug/autowriter.zip. It uses a hidden GUI with the magic of GuiGetCursorInfo to trap mouse clicks, and it supports rudimentary support for detecting button clicks..... It generates an output file on the Desktop....

Maybe something like this for trapping Enter:

HotKeySet("{Enter}", "TrapEnter")

While 1

Func TrapEnter()
   If WinActive("nameOfWindow") Then
    ; do stuff
   Else;act as if Enter was not trapped
      HotKeySet("{Enter}");unregister hotkey
      HotKeySet("{Enter}", "TrapEnter");re-register
Edited by CyberSlug
Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...