Jump to content

mouseClick not working on windows 7


 Share

Recommended Posts

I have scripts that worked on Windows XP no longer work on Windows7.

Scripts may work inadvertently, like one time in 10.

The functions that seem be be effected include:

MouseClick

MouseClickDrag

MouseDown

_WinAPI_Mouse_Event

For example, the following code resizes a windows, by clicking and dragging the bottom corner :

Opt("MustDeclareVars",1)

dim $testTitle="some window title"
dim $winPos = WinGetPos($testTitle)
dim $newWidth = 710

MouseClickDrag ( "left",$winpos[0]+$winPos[2]-5,$winpos[1]+$winPos[3]-5, _

    $winpos[0]+$newWidth-5,$winpos[1]+$winPos[3]-5)

This works fine on my Win XP computer, but not on my Windows 7 computer. On the windows 7 computer you

see the mouse move, but no 'clicking' is taking place.

I have tried several things but am at a lost to know why.

Is there some way I can work around this problem?

Link to comment
Share on other sites

I'm currently running windows 7 and just checked mouseclickdrag and it seems to be working ok for me. Are you sure its just not grabing the edge? You can try something simple like highlighting some text in a notepad, just to verify if or not the mouseclickdrag is the source of the problem.

Link to comment
Share on other sites

This may also be the result of a problem that first appeared in Vista.

Before you try it again, go to Control Panel >> Mouse. Click the Pointers tab, set the scheme from Windows Aero to None and see if that helps. You can always change it back later.

Edit: I should add that I've noticed that this particular issue is more noticable in Win 7 than it was in Vista and it doesn't apply to only AutoIt scripts.

Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

No, it didn't fix the script, it just proved what the problem is. With Aero enabled the mouse shows as being in a different position which is normally high and to the right of it's true location. The solution is to add a few pixels to the Y coordinate and to subtract a few from the X coordinate. 3 or 4 will probably do it but please let us know what number you come up with. Also please cancel the bug report you made. You should have waited for an answer before jumping to the conclusion that AutoIt was wrong when in fact it's a Windows problem.

Edit. Just thinking about this some more. When you reply with the offsets you used, please also post your screen resolution. The offset will be affected by that so we can't use a particular given number here.

Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

  • Administrators

I have Aero theme enabled and I don't get this behavior... The mouse coords are from the "hot spot" of the mouse regardless of what it looks like on screen. So why is this working for everyone else except the OP?

Link to comment
Share on other sites

I have Aero theme enabled and I don't get this behavior... The mouse coords are from the "hot spot" of the mouse regardless of what it looks like on screen. So why is this working for everyone else except the OP?

Are you using a custom scheme for mouse pointers? There is an individual setting for them in Control Panel >>Mouse and that is the one that causes the problems. Like I pointed out it is also resolution dependent. I first noticed it at 1680 x 1050 when I couldn't even grap the edge of a window to resize unless I moved the mouse just slightly off position and I had to go and research the issue. I found a lot of people with the same problem going way back to the original Vista release.. I think that the mouse shadows shift the hot spot just enough that you can't grab it at the point where you think it is. As the OP has stated, setting the Mouse Pointer Scheme to "None" solved his problem.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

  • Moderators

George,

I have just checked my Vista <Mouse Properties> and I too have the <Pointers> set to <Windows Aero (system scheme)> - which it must be by default as I have never even looked there before!. Like Jon, I have never had a problem with the hotspot - it has always been where I thought it should be. MouseGetPos has always returned what I thought it should in a number of screen magnification scripts.

Must be your proximity to the magnetic pole..... :mellow:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Well, it worked for the OP so all I can think of is the possible difference in Resolution. I know I had the same problem (at high resolution) when physically using the mouse and making that change solved the problem.

What I am certain of is the fact it's NOT an AutoIt bug. AI can't do more than what Windows will allow it to do.

@M23 Yes, Windows Aero is the default scheme.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

  • 1 month later...

This fixed the problem, thank you for your help...

Well it was fixed... but only for 5 minutes.

I don't think the "hot stop" is the problem, but the fact no "click" is being sent at all. Or the sent click is getting lost.

I don't know enough about how auto-it, or windows 7 works to know why.

Thanks for your help if you have any.

Could it be I used a 'free upgrade from vista to win7' that came with my computer.

Rather than purchasing win 7? Could it be some other windows settings?

I'm using 2560x1600 and 1920x1200 dual monitor, if that makes a difference?

Edited by newbie210
Link to comment
Share on other sites

Well it was fixed... but only for 5 minutes.

I don't think the "hot stop" is the problem, but the fact no "click" is being sent at all. Or the sent click is getting lost.

I don't know enough about how auto-it, or windows 7 works to know why.

Thanks for your help if you have any.

Could it be I used a 'free upgrade from vista to win7' that came with my computer.

Rather than purchasing win 7? Could it be some other windows settings?

I'm using 2560x1600 and 1920x1200 dual monitor, if that makes a difference?

And every thing is working fine again..... I don't know why, maybe the lastest windows update changed something?????

Sorry and thanks

Link to comment
Share on other sites

And every thing is working fine again..... I don't know why, maybe the lastest windows update changed something?????

Sorry and thanks

I checked today and my current information is that MS did indeed release a patch for that issue in a recent update although not the last one. That could be why it was working fine for others but I'm not thoroughly convinced yet.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

I did find one solution to my problem...

I found that auto-it was unable to automate some programs, this was because it did not have the correct privileges to do so. Clicking "Run as administrator..." when running the script fixed this issue. I believe "clicks" were not being sent to programs that auto-it did not have the correct privileges to automate, simple as that.

The easiest way to ensure that the script is running as an administrator is:

1) compile your script to exe

2) in the properties window on the exe file, go on the compatibility tab, and check "Run this program as an administrator"

Link to comment
Share on other sites

Try adding #RequireAdmin to the top of the script.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

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