Sign in to follow this  
Followers 0
Just_Plain_Cool

Differences in Mouse operations under XP PRo?

8 posts in this topic

#1 ·  Posted (edited)

Hello all,

I have written an automation script that has the user select where to click the mouse to open a section in a listview, and then actually does the double click to be sure they have selected where they want. The code is working perfectly for all users except for one person who is running XP Pro. When this code runs on her machine, it minimizes the window?!?! The code looks like this:

MsgBox(0, "Setting Up", "Please center the mouse over DoSomething in program's listview, and then hit <Enter>" & @CRLF & @CRLF & "Please DO NOT use the mouse to cancel this requester.")
Sleep(50)
$Pos = MouseGetPos()
$MouseX = $Pos[0]
$MouseY = $Pos[1]   
WinActivate (Window Title Info)
Sleep(200)
MouseClick($Primary, $MouseX, $MouseY, 1, 0)
MouseClick($Primary, $MouseX, $MouseY, 1, 0)
$Response = MsgBox(4, "Testing", "Did MyProgram open the DoSomething section in the Listview?")
If $Response = 7 Then
    MsgBox(0, "Error", "Please contact me")
    Exit
EndIf

I have no experience with XP Pro, nor do I have local access to anyone who has it installed. :ph34r:

Any help / suggestions would be greatly appreciated.

Thanks,

Just_Plain_Cool :(

Edited by Just_Plain_Cool

Share this post


Link to post
Share on other sites



have you looked at AutoItSetOption("MouseCoordMode", 0)? set it or not?


"I'm not even supposed to be here today!" -Dante (Hicks)

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Hi emmanuel,

Actually, I have that set earlier in the code.

Thanks,

Just_Plain_Cool :ph34r:

Edited by Just_Plain_Cool

Share this post


Link to post
Share on other sites

Turns out the problem is not XP Pro. The user's system is set up for a single click to launch applications. Running the script on an XP Pro system that uses the standard double click works properly. Now if I could just find where the setting is to change that behavior, her problem would be solved.

Any ideas on this one?

Thanks again,

Just_Plain_Cool :ph34r:

Share this post


Link to post
Share on other sites

Windows Explorer - Tools - Folder Options - General Tab - Custom Settings - Click items - Choose Double Click. This is what works on Windows 98. I was not able to find it on the NT 4.5 box here at work.


David Nuttall
Nuttall Computer Consulting

An Aquarius born during the Age of Aquarius

AutoIt allows me to re-invent the wheel so much faster.

I'm off to write a wizard, a wonderful wizard of odd...

Share this post


Link to post
Share on other sites

But, do you really want to force a change on your user's behavior? Wouldn't it be better to have your script detect the click settings and adjust accordingly?


"I'm not even supposed to be here today!" -Dante (Hicks)

Share this post


Link to post
Share on other sites

If you install TweakUI, there is a checkbox in the Explorer tweaking section called "Detect accidental double clicks"

On my system, the registry key is:

$keyname = "HKEY_USERS\S-1-5-21-1801674531-920026266-839522115-1003\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
RegWrite($keyname, "UseDoubleClickTimer", 1);use 0 to disable

Now the S-1-5-21-1801674531-920026266-839522115-1003 will be different on each computer, so you would need to use a recent "unstable" version of AutoIt that supports the following RegEnumKey function:

Dim $i = 0
Do
   $key = RegEnumKey("HKEY_USERS", $i)
   $i = $i + 1
Until StringLen($key) > 32
$fullkey = "HKEY_USERS\" & $key & "\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
; you might want to backup the original key value if it exists......
RegWrite($fullkey, "UseDoubleClickTimer", 1);use 0 to disable

But I'm not sure if the change takes effect by simply modifying the registry key... you might have to manually refresh the system......

According to RegShot, the setting that controls whether single or double clicking is used is:

HKEY_USERS\S-1-5-21-1801674531-920026266-839522115-1003\Software\Microsoft\Windows\CurrentVersion\Explorer\ShellState: 24 00 00 00 38 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 0D 00 00 00 00 00 00 00 00 00 00 00

HKEY_USERS\S-1-5-21-1801674531-920026266-839522115-1003\Software\Microsoft\Windows\CurrentVersion\Explorer\ShellState: 24 00 00 00 1A 88 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 0D 00 00 00 00 00 00 00 01 00 00 00

It would be just as easy to launch Folder options and change double-clicking to single-clicking.... I think There is an easy way to run Folder optaions if you search the forums.

Hope that helps


Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

After speaking to the end user of this script, she didn't want her system using single click, she just didn't know how to change it.

Thank you all for your help,

Just_Plain_Cool :ph34r:

Share this post


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
Sign in to follow this  
Followers 0