Jump to content

getting the coordinate desktop height and width of active window


foolove
 Share

Recommended Posts

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

Link to comment
Share on other sites

  • Moderators

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)

"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

How to get your question answered on this forum!

Link to comment
Share on other sites

  • Moderators

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

"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

How to get your question answered on this forum!

Link to comment
Share on other sites

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
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...