Jump to content
Sign in to follow this  
keelaji

Winmove not working on windows 10

Recommended Posts

keelaji

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

Share this post


Link to post
Share on other sites
keelaji
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.

Share this post


Link to post
Share on other sites
keelaji
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.

Share this post


Link to post
Share on other sites
keelaji
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.

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  

  • Similar Content

    • Dreamfire
      By Dreamfire
      Hi,
      Since today, exe's are being flagged as having a trojan by Windows Defender (Fuery.B!cl)
      Version:  3.3.14.3 - SciTE Version 3.7.3



       

    • PramodR
      By PramodR
      Hello,
      I have to execute below block of code in elevated previllage, as that particular wmic class will work only with admin previlage.
      i am getting out put when i launch autoit as administrator,  but i will not be able to launch autoit as admin in this particular case but my user have admin rights.
      is there any better way i can run those command as administrator.?
      tried below steps:
      i have tried #RequireAdmin but that creates a user prompt  Tried using Runas command but gives error as wrong username or password , stuck with that step.  
       
    • dwaynek
      By dwaynek
      traytip isn't working in windows 10. nothing happens when i use the Traytip command.
      here's a simple script i used:
      TrayTip("I'm a title", "I'm the message", 5) i tried changing the registry setting HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced ( which didn't have EnableBalloonTips) and creating a DWORD entry called EnableBalloonTips and setting it to 1 and logging off then back in. that did not resolve the problem.
      i'm running Windows 10 v1709 b16299.431
    • antonioj84
      By antonioj84
      Hi all to the forum guru and expert I am trying to  automate this. in the registry  I have the network profile name network 2 and network   I want to  change their  CATEGORY  to Private .  Can someone lead me in the right direction.
      Private is 1 and Public is 0
      #RequireAdmin Global $sHKLMRoot = @OSArch = "x64" ? "HKLM64" : "HKLM" RegWrite($sHKLMRoot &"\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\NewNetworks" ,'/v NetworkList /t REG_MULTI_SZ /d 00000000 /f') see  attached picture below
      Much appreaciate
       

    • PhoenixPRO
      By PhoenixPRO
      When I try to automate this install program I can not get any of the buttons to click with the "ControlClick" function or any mouse movement to move the mouse to the and click it.  My OS is Windows 10 64Bit.  I have tried both 32bit and 64bit installs of Autoit V3 to no avail.
      I could not even get the run command to start the program until I used the variation of the command below in the script.
      With the script below the install program starts but will not click the "Next" button no matter what I do.
      Any help will be greatly appreciated.
      Thanks in advance.
       
      #include <MsgBoxConstants.au3>
      Opt("MouseCoordMode", 0) ;1=absolute, 0=relative to active window, 2=client
      Local $Success
      Run(@ComSpec & " /c " & 'C:\PhoenixPro_Install\RDXUtil\RDX_Tools_setup.exe', "C:\PhoenixPro_Install\RDXUtil", @SW_HIDE )

      WinWait("RDX Tools 1.62 - InstallShield Wizard", "Welcome to the InstallShield Wizard for RDX Tools 1.62")
      WinActivate("RDX Tools 1.62 - InstallShield Wizard", "Welcome to the InstallShield Wizard for RDX Tools 1.62")
      ControlClick ("RDX Tools 1.62 - InstallShield Wizard", "Welcome to the InstallShield Wizard for RDX Tools 1.62", 1639, "left", 1) ;Next Button
×