This one really has me scratching my head, so much so that I've resorted to the help of wonderful friendly internet people.
So I made a simple script to move and resize half a dozen windows into their proper positions for my twitch stream.
The problem is that one of these windows does not want to cooperate.
Here is my script:
#include <Array.au3>
HotKeySet("{END}", "_Terminate")
HotKeySet("{INSERT}", "_WinMove")
Global $aWin[][] = _
[["Chat - Twitch", 1051, 557, 872, 495] _
, ["Raid and Host - Twitch", 0, 625, 404, 397] _
, ["Stream Information - Twitch", 808, 261, 242, 763] _
, ["Stream Markers - Twitch", 406, 625, 400, 399] _
, ["Stats - Twitch", 807, 0, 243, 261] _
, ["OBS", 1050, 0, 873, 557] _
, ["Diablo", 0, 0, "", ""]]
;_ArrayDisplay($aWin)
While 1
Sleep(50)
WEnd
Func _WinMove()
;$d2hndle = WinGetHandle("Diablo II")
;WinActivate($d2hndle)
;WinMove($d2hndle, "", 0, 0)
For $i = 0 To 6
$aWinHan = WinActivate($aWin[$i][0])
WinWaitActive($aWinHan)
Sleep(50)
WinMove($aWinHan, "", $aWin[$i][1], $aWin[$i][2], $aWin[$i][3], $aWin[$i][4])
Next
EndFunc
Func _Terminate()
Exit
EndFunc
So I set up an array with all the data I want to use and then use a loop to move all the windows. The diablo window is the only window that will not move to the x, y location specified. As a test I made a text file with "Diablo II" in its title and tested the script on that, it moves the text window to 0, 0 as expected.
The Diablo 2 window responds to WinActivate but it will not move to the 0, 0 position (or any position) using the WinMove function for reasons I can't comprehend. I specifically recall using AutoIt to do this exact same thing several years ago.