Jump to content
Sign in to follow this  
foolove

getting the coordinate desktop height and width of active window

Recommended Posts

foolove

I was wondering of the best approach to getting the coordinate desktop height and width of active window

I am not sure if this is the best approach my end goal is to do a series of mousclicks but make my program portable to others so it can be used with their monitor and their resolutions

Share this post


Link to post
Share on other sites
JLogan3o13

Hi, Foolove. I'm not sure I'm following, but it sounds like you want to do Mouseclicks on your app's window, but want to ensure it hits in the right area. You could always make a call to WinMove to make the window the size you would like it to be:

WinMove("[CLASS:Notepad]", "", Default, Default, 300, 300)

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
foolove

From here can I do calls to the window and use the coordinates of the given window based on size so if i give my program to another person they can use it?

If so how do I call a mouse click based on the window?

Share this post


Link to post
Share on other sites
JLogan3o13

You should be able to, however it is difficult to say with certainty without a clearer idea of your goal. If you could post a portion of the script you're working on, to give us an idea exactly what it is you're trying to accomplish, we would be much better suited to assist :D


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
foolove

Sure

HotKeySet("{ESC}", "Terminate")
Func Terminate()
    Exit 0
EndFunc
WinSetState("[CLASS:SunAwtFrame]", "", @SW_MAXIMIZE)
WinWaitActive ("[CLASS:SunAwtFrame]")
WinMove("[CLASS:SunAwtFrame]", "", Default, Default, 1200, 600)
Send("{CTRLDOWN}")
Send("{ALTDOWN}")
Send("z")
Send("{CTRLUP}")
Send("{ALTUP}")
sleep(2000)
Send("{ENTER}")
#cs
Need a MoveMouse here in accordance to active window
sleep(2000)
MouseClick("Right")
#ce

Share this post


Link to post
Share on other sites
foolove

All I am trying to do is make a MouseClick program that will work on other computers that are using the same program :D

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  

×