Jump to content

Recommended Posts

Posted

I did a search of the help file as well as the forum with no results.

Is there a way that I can capture an up or down mouse scroll like you can capture a mouse click using _IsPressed?

I would like to use the scrolling activity as means of focusing on that particular window. Any help would be appreciated.

Posted

I did a search of the help file as well as the forum with no results.

Is there a way that I can capture an up or down mouse scroll like you can capture a mouse click using _IsPressed?

I would like to use the scrolling activity as means of focusing on that particular window. Any help would be appreciated.

Hrm, I'm slightly confused, doesnt the window have to be active for the mousewheel to affect it? I'm not sure how to do what you are looking for, maybe we can suggest another method or idea if we know more of what you are trying to do though!

  • Moderators
Posted

I think he's trying to accomplish what happens if your using SciTe, and you hold shift and scroll with the middle mouse button. It zooms in and out. Maybe Jdeb knows the answer to this one.

Sorry I don't have the solution, I was only trying to reitterate what I understood your post to be, please correct me if I'm wrong.

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 (edited)

Thanks for the answers.

Let me clarify.

I work daily with a program that has two frames in its main window. The programmers were sloppy. It takes two clicks on the main frame in order for it to comes into focus. It is counterintuitive. By the end of the day, I may make a thousand unnecessary clicks. I hate that.

Wouldn't it be great if I could use the scrolling feature to focus the page. In other words, move the mouse over the main frame, scroll and focus.

Anyway, I found a better way of doing it.

While 1

$i = MouseGetPos()

If WinActive ("Program") AND $i[0] > 294 Then ControlFocus ("Program", "", "TRichEdit1")

Sleep (10)

Wend

In other words, every time the mouse moves over the border of the two frames ($i[0] > 294) focus goes to the main frame.

Isn't that elegant? For a newbie I am pleased.

Edited by fmen
  • Moderators
Posted

Good job, I saw the word focus in this last post and immediately thought of ControlFocus() :P

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.

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