Sign in to follow this  
Followers 0
lowzix

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

5 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

OK, I'm being simpleminded here, but have you tried a WinActivate after moving the window to the other screen?

_aleph_


Meds.  They're not just for breakfast anymore. :'(

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