# MouseClick behaves differently after some time - (Moved)

## Recommended Posts

Hi,

I have a very strange problem concerning MouseClick function.

I need to start Control Panel, navigate it on the Display Section (Adjust screen resolution link), click on it, and from the next Dialog choose Intel Graphic tool tab and navigate into it when it opens.

I wasn't using MouseClick() at first when I tried to use Control IDs, but I was fed up with the Autoit Window Info poor and inaccurate info (It flickers and the moment I click on the control the control ID and class disappear) so I ended up choosing the easiest way.

The code I'm posting worked OK until two weeks ago, the mouse clicks were accurately performed and the Script reached the end with no errors...and I was happy.

All of a sudden, between one try and the other, I noticed the cursor not flying exactly where it was supposed to, namely to the Control Panel ->Display->Adjust screen resolution link   but it clicked some 30 pixels below and some 30 pixels to the left, choosing obviously and undesired function and from that point it screwed the whole thing up. And from that moment onward, it seems I can no longer regain the mouse to click on that sequence.

Could it be because my Control Panel ->Display form moved slightly from one test to another and therefore I got that small offside?

If you believe this is the reason, I should then re position the Control Panel ->Display window to 0,0 and recalculate all the clicks.

do you have a suggestion?

Thanks a lot

Dave

##### Share on other sites

Moved to the appropriate forum, as the AutoIt Example Scripts forum very clearly states:

Quote

Share your cool AutoIt scripts, UDFs and applications with others.

Do not post general support questions here, instead use the AutoIt Help and Support forums.

Moderation Team

Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

##### Share on other sites

Well, one of the most precious suggestion would be to not use mouse clicks to automate something, since you have tried on your own the reliability of these kind of "automation styles".

Couldn't you use another way to do what you are trying to do?

Edited by FrancescoDiMuro

Spoiler

Thoughts:

• I will always thank you for the time you spent for me.
I'm here to ask, and from your response, I'd like to learn.
By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

##### Share on other sites

Control IDs are better than mouseclicks. Easy is not better, it's just easier, but often problematic.

you need to learn how to wait for the controls you seek before poking them

My resources are limited. You must ask the right questions

##### Share on other sites

Or you can do a one line powershell script

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

##### Share on other sites

My end goal was to click on Advance Settings link on the Screen Resolution Page of the control Panel. Advance Settings link is not a control and doesn't have an ID. Clicking on that would allow me to open the INTEL Graphic tool dialog and from there I can keep navigating it through controls. so it's the damned Advance Settings link on control Panel that it's stopping my whole thing.

##### Share on other sites

Does Intel Graphic tool have any command line switches or anything else that doesn't require an automation like that?

Spoiler

Thoughts:

• I will always thank you for the time you spent for me.
I'm here to ask, and from your response, I'd like to learn.
By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

##### Share on other sites

Not that I'm aware of but I suppose they have a sort of way to do automatic configurations, either via Command line or via XML. The problem I have was the "Time". Would it take longer to contact INTEL, get in the middle of their support channel and get from them  the info, or would it be faster to try to automate a dozen of "clicks" with Autoit? I figured the latter was the best option for me...

##### Share on other sites

Another approach would be to navigate to the Control Panel using the command "control" followed by the panel you want to open.

You may find useful these commands (or not)

Spoiler

Thoughts:

• I will always thank you for the time you spent for me.
I'm here to ask, and from your response, I'd like to learn.
By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

##### Share on other sites

I'm already in control Panel ->Display with a single function call:

Run("rundll32.exe shell32.dll,Control_RunDLL desk.cpl")

but I can't go further. I need to get into Advanced Settings and that is not a control.

##### Share on other sites

What happens if  you try to run the Intel graphics settings program directly, rather than trying to get the control panel to start it?

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

##### Share on other sites

I resorted to call it through this messy navigation of Control Panel because I found no batch file/No executable/No services to start that. Posted a call into INTEL support forum but I was dragged here and there for weeks in an helpless attempt to find someone that gives me a hint. 3 months later the call was closed automatically.

##### Share on other sites
Just now, lonardd said:

found no batch file/No executable/No services to start that.

I find that hard to believe, I've worked with numerous Intel drivers and the control panels they install, there's always an .exe that runs when you open the Intel graphics settings panel.

Perhaps you looked in the wrong place, first you should open the panel manually, and look in the task manager, look at the processes tab to see what windows are running, right click it and go to details, you'll find the exe that runs that panel. A screen shot of the processes tab would be good if you can't find it, or perhaps do a ConsoleWrite of all processes running using ProcessList.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

##### Share on other sites

You are actually giving me a good suggestion.

Not that I haven't tried that because I remember I took a close look of the processes, but..... I might have been baffled by some other things back then when I tried

Let me try that again when I'll be back in the LAB, hopefully  by Monday. Thanks for your HELP, I appreciate  !!!

##### Share on other sites

Hey BrewManNH

I want to give you some feedback on this Call.

You are right! Went back to the LAB and found out the executable that runs the INTEL Graphic Tools. It's c:\Windows\System32\igfxcfg.exe. That's exactly what I was looking for. Plus, unlike Control Panel window, this tool is a regular Windows form with controls like Tabs, Combo Boxes and buttons, all objects I can control easily from my Autoit program.

Thanks

Dave

## Create an account

Register a new account

• ### Similar Content

• Hi All,
I am trying to login into our application using AutoIT. When I launch the application a splash screen appears and the login screen goes behind it. At this point the script pauses and I loose control of everything. I have literally tried everything for the past two days but nothing has worked yet. Any suggestions would be appreciated.
RunWait("\\mchsv411.siplaceworld.net\splmshare\int00\conf\start_apps\windows\start_nx110.bat en portal_client int00 tc112", "", @SW_MAXIMIZE)
AutoItSetOption("SendKeyDelay", 200)
Local $hWnd = WinWaitActive("Teamcenter Login") MouseClick("left", @DesktopWidth / 2, @DesktopHeight / 2) The splash screen has title "Teamcenter" and is static. I tried to click on the center to get control of login window. I have tried WinActivate, WinSetState, ControlCommand and a lot of other things. • By lonardd I need to open an INTEL Graphic Tool clicking on a Win7 Tray Icon. This icon is not shown on the Win7 Tray but it is shown once you click on a button that shows a little arrow-up. This button opens up an extension of the tray and there is my INTEL Graphic Tool Icon. The first ControlClick('[Class:Shell_TrayWnd]', '', 1502 ) at line 26 of my source code (Rotatedisplays.au3) works fine as it clicks on the up-arrow shown on the uparrowfirst Menu.jpg picture and opens up an extension of the tray. Then I'm trying to click on the INTEL Graphic Tool Icon which is the first blue icon (up-left) of the tray extension but I failed all my attempts. Can somebody help me out? Thanks Dave RotateDisplays.au3 • By c1one Something simple enough, and I am sure it's an oversight, but I have not been able to track this down. The entire script is attached, but here is the point of failure. Note: I am getting the "Error: subscript used on non-accessible variable" but I thought the initial line of: AutoItSetOption('MouseCoordMode', 0) Should address that issue? <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ; Install updates (minimized and updating for many minutes) ; Updates Not Installed Screen ; Wait for updates to complete WinWait("ProSeries Update") ; Wait just over 9 minutes to ensure popup is ready (test alternative to WinWait) Sleep(550000) ; Set focus on Product Licenses window WinActivate("ProSeries Update") ; Send Mouse Click to Install Now button MouseClick ( "left" [, 581, 362 [, clicks = 1 [, speed = 10]]] ) ; end Installing Updates screen >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Thanks for any insights! c1one ProSeries2017_No_Customer_Info.au3 • By dadalt Hi! I have a button where I need to close it! I was doing through clicking same position in screen but there are some id's that have different sizes. What are the possible ways to click this closable button? Is there a way to close it through id? Is there a way to get it's position through it's ID? Thanks in advance! • Hello I got this script works below and I want to do not move cursor on screen when action is performed. Opt("MouseCoordMode", 1) ; cause it gets whole screen coords Local$x, $y Local$search = _ImageSearch('item.bmp', 0, $x,$y, 0) If $search = 1 Then MouseMove($x, $y,0) MouseClick("right",$x, $y)) MouseMove($xMiddle, $yMiddle,0) MouseClick("left",$xMiddle, $yMiddle) EndIf I changed this above to this below and what happen is. It clicks right button and then left button but not move mouse to$x $y and then to$xMiddle $yMiddle. Opt("MouseCoordMode", 1) ; cause it gets whole screen coords Local$x, $y Local$search = _ImageSearch('item.bmp', 0, $x,$y, 0) If $search = 1 Then ControlClick("","",0,"secondary",1,$x,$y) ControlClick("","",0,"primary",1,$xMiddle,$yMiddle) EndIf If needed I got handle in var$hwnd
Please tell me how parameters in ControlClick would like be
×

• Wiki

• Back

• #### Beta

• Git
• FAQ
• Our Picks
×
• Create New...