Jump to content

Winmove not working on windows 10


keelaji
 Share

Recommended Posts

Hello,

first of all i searched in the forum but i didn't found any solution to my problem.

I am using windows 10.

I made a script that is supposed to change the title to the active window, resize it to the smallest size possible (should be around 800 x 600) and move to (0, 0).

I can change the title but i fail to do the other 2 tasks.

i use wingettitle [active] copied from the F1 help tool (and this works), i i put the title in a variable and than i use

winsettitle ($variable, "one") (this works too)

winmove ("one", 0, 0, 800, 600) (doesn't do anything)

i also tried

local $x = winget ( "one")

msgbox (0, "", $x) (i get a completely white box so i suppose winget can't have any data about my window ??)

any suggestion ?

Edited by keelaji
Link to comment
Share on other sites

9 hours ago, Danp2 said:

I would suggest something like this --

$hWnd = WinGetHandle("[Active]")
WinSetTitle($hWnd, "new title")
WinMove($hwnd, "", 0, 0, 800, 600)

 

I tried this and it works, but not completly, it doesn't get resized, but it get moved to the top left corner. I have to double click on the window title to see it resized and i have a little spaze like 3-4 mm from the monitor left border to my window left border.

Link to comment
Share on other sites

10 hours ago, Danp2 said:

I would suggest something like this --

$hWnd = WinGetHandle("[Active]")
WinSetTitle($hWnd, "new title")
WinMove($hwnd, "", 0, 0, 800, 600)

 

I tried this and it works, but not completly, it doesn't get resized, but it get moved to the top left corner. I have to double click on the window title to see it resized and i have a little spaze like 3-4 mm from the monitor left border to my window left border.

Link to comment
Share on other sites

48 minutes ago, Danp2 said:

Have you tried using different values for the width and height parameters?

Is there a reason you aren't using WinSetState to maximize the window?

Please ignore the last post i updated the page and posted it twice.

i tried using another size yes, but no difference, it works but it doesn't resize immediatly the window.

 

im not so expert in the use of autoit, so no there is no specific reason why i am not using winsetstate.

i don't know what winsetstate does but i will check it when i will back home.

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

×
×
  • Create New...