Jump to content

having problems with controlclicking to a window at the 2nd monitor


 Share

Recommended Posts

The monitor is not set as my main screen, and i would appriciate it if there would be any solutions to fix this problem without having to set that monitor to become the main screen.

I tried it on my other screen, and it worked perfectly fine, i didn't even have to activate the window i wanted it to click inside, it did that automatically. Now im trying to drag the window over to the second monitor which has a higher resolution (of course i adjusted click coordinates etc.) but it doesn't seem to be working, any ideas?

ControlClick("the tab name i had here> - Google Chrome","Chrome Legacy Window",95719488,"left",1,2078, 285

edit: spelling

Edited by lowzix
Link to comment
Share on other sites

The parameter for the coordinates are NOT the coordinates of the control, they are supposed to be the coordinates within the control. The center of the control is the default but sometimes you'd need to click somewhere other than the middle of the control so that's when you'd use them.

Are you sure that the Control's handle is correct? Are you sure that the title and text are matching, the parameters are case-sensitive so unless they match 100% it won't find the correct window/control to click.

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

Link to comment
Share on other sites

I'd look up the chrome udf on the sample scripts forum, so you can click on the DOM objects on the page, rather than attempt a relative coordinate.

Edited by jdelaney
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.
Link to comment
Share on other sites

Thanks for the answers guys, yes, everything is 100% correctly written in as it did work at my main monitor. other than that, i have no idea what you are talking about BrewManNH as i am not super expert when it comes to this stuff.

Thanks for the tips jdelaney, i will be looking into this kind of stuff as it will of course be alot more practical not having to adjust click coordinates when i want the script to be running on different monitors with different resolution etc.

Still looking for a temprorary solution though.

edit: It is not the actual click coordinates that gets wrong, the problem is that it doesn't even try to click, as the window doesn't get focused, on my other screen it focused the window, it does not do this whilest on the 2nd monitor

Edited by lowzix
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...