winget not always working but did it under mouse only Topic is solved

Get help with using AutoHotkey and its commands and hotkeys

winget not always working but did it under mouse only  Topic is solved

20 Oct 2017, 10:26

Hello i got a problem to move certain type of windows from python coding, they are all like a mini window on the edge of the screen to be able to switch the real window titled tk, some of them wors with the code below but not all and i dont get same ahk_id that why i think it is not always working, i made a script to make possible all windows titled tk move to the second screen.

The main problem reside in the fact that i dont get same ahk_id the most often times if i use winget with the mouse under the window( or the mini window switcher) or what the script does with the winget function.

Using the class does not simply never works, it worked only using winget and the windows title.

Loop {

;WinGet, id, list,ahk_class TkTopLevel ; not works
WinGet, id, list,tk
Loop, %id%
this_id := id%A_Index%
;StringTrimRight, this_id, id%A_Index%, 0
WinGetPos, X, Y, Width, Height, ahk_id %this_id%
Xposplus:=(1920 + (X/1.4))
;msgbox, %this_id%
IfLess, X, 1900;fix corner top right of first screen is not to second monitor
;msgbox, %Xposplus%
WinActivate, ahk_id %this_id%
WinWait, ahk_id %this_id%
WinMove, ahk_id %this_id%,,%Xposplus%, %Yposplus% ;,Width, Height


How can i achieve to move all windows , if i use a script that wait window under mouse and winget it ll works well but i want it automatically working, because windows close and open often.

Re: winget not always working but did it under mouse only

20 Oct 2017, 19:39

Please delete this


-Space after 1900 and before ;
-no need activate and waiting windows

Return to “Ask For Help”

Who is online

Users browsing this forum: joe7dust and 40 guests