Jump to content

Recommended Posts

Posted

This is my first post.  I'm using the below script in my PowerShell script to resize and move some windows.  My question is, when I move the window to 0,0 it doesn't go all the way to the top left corner.  It leaves a small gap.  What's the reason for that?  

I'm new to AutoIT, and so far, I found it very helpful in working with GUI.

https://www.autoitscript.com/autoit3/docs/functions/WinMove.htm

MoveWindow()

Func MoveWindow()
    Run("notepad.exe")
    Local $hWnd = WinWait("[CLASS:Notepad]", "", 10)
    WinMove($hWnd, "", 0, 0, 200, 200)
EndFunc 

Thanks,

Tony

Posted

Unfortunately sometimes when you copy the code from the forum it contains some hidden text, paste it in NotePadd++ or delete the EndFunc line and write it manually.

Posted

I figured it out.  Apparently, if you do -7 it will snap all the way to 0,0.  I found this info from another Windows forum.  

Posted

It could be -8 also (too small to notice).  I just went with -7 because someone mentioned it in a tech forum.  I don't remember where exactly.

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
×
×
  • Create New...