topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Saturday December 14, 2024, 5:10 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Trying to learn AHK - stuck with Click command. Any help?  (Read 4785 times)

wreckedcarzz

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 1,626
    • View Profile
    • Donate to Member
OK for everyone who knows how to do this or has any ideas...
I am coding an automatic computer maintenance program (see here: https://www.donation...p?topic=8345.new#new) and I have 2 problematic programs that REQUIRE the user to click - no Tab or Alt keyboard commands work. So, I went ahead and (I am still using the Quick Start Tutorial, I don't feel comfortable on my own quite yet) looked up how to do it. OK, easy enough. I added it into the script, tried it out, and it clicked off on Windows Sidebar instead of on the button I gave the coordinates to. So I went back and used the coordinates in relevance to the active window (I am assuming its from pixel 1x1 of the window) and that did something similar. So I have currently got it set to move the mouse to 0, 0 and THEN click the coordinates (relevant to the whole screen). It STILL does not work...I am going to give it another go with the active window coordinates, but please someone tell me if I am doing something right/something wrong/another way to click.
Thanks,
-Brandon

wr975

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 369
    • View Profile
    • Donate to Member
Re: Trying to learn AHK - stuck with Click command. Any help?
« Reply #1 on: June 15, 2007, 01:29 AM »
Just a wild guess, but I think you didn't use CoordMode

If this command is not used, all commands except those documented otherwise (e.g. WinMove and InputBox) use coordinates that are relative to the active window.

Screen: Coordinates are relative to the desktop (entire screen).
Relative: Coordinates are relative to the active window.

CoordMode,Mouse,Screen
Click,300,350

« Last Edit: June 15, 2007, 01:34 AM by wr975 »

wreckedcarzz

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 1,626
    • View Profile
    • Donate to Member
Re: Trying to learn AHK - stuck with Click command. Any help?
« Reply #2 on: June 15, 2007, 01:50 AM »
No, I looked at it but it was kind of confusing - too many commands for me. So I would have to put in...
CoordMode, Mouse, Screen
Click x, y

instead of my current setup, simply being...
Click 808, 771

OK, I will give that a go.

wreckedcarzz

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 1,626
    • View Profile
    • Donate to Member
Re: Trying to learn AHK - stuck with Click command. Any help?
« Reply #3 on: June 15, 2007, 02:07 AM »
Holy cow it worked! It worked! I spent like 2 hours on this ;D- thanks so much! :-* :)
-Brandon