_WinAPI_GetWorkingArea()
Func _WinAPI_GetWorkingArea() ; http://azjio.ucoz.ru/publ/vychislenie_koordinat_dochernego_okna/6-1-0-29
Local Const $SPI_GETWORKAREA = 48
Local $stRECT = DllStructCreate("long; long; long; long")
Local $SPIRet = DllCall("User32.dll", "int", "SystemParametersInfo", "uint", $SPI_GETWORKAREA, "uint", 0, "ptr", DllStructGetPtr($stRECT), "uint", 0)
If @error Then Return 0
If $SPIRet[0] = 0 Then Return 0
Local $sLeftArea = DllStructGetData($stRECT, 1)
Local $sTopArea = DllStructGetData($stRECT, 2)
Local $sRightArea = DllStructGetData($stRECT, 3)
Local $sBottomArea = DllStructGetData($stRECT, 4)
Local $aRet[4] = [$sLeftArea, $sTopArea, $sRightArea, $sBottomArea]
Global $x = @DesktopWidth /5
Global $y = (@DesktopHeight - (@DesktopHeight - $sBottomArea))/3
;$x = @DesktopWidth /5
;$y = (@DesktopHeight-30)/3; 30 -Высота панеля задач (приблизительно)
Return $aRet
EndFunc
Run("Explorer.exe " & @ProgramFilesDir)
$sTitle = StringRegExpReplace(@ProgramFilesDir, "^.*\\", "")
$hWin = WinWait('[REGEXPCLASS:(Cabinet|Explore)WClass;REGEXPTITLE:.*\Q' & $sTitle & '\E.*]', '', 5)
If $hWin Then
WinMove ($sTitle, "", @DesktopWidth - $x, 0, $x, $y)
WinSetOnTop($hWin, "", 1)
EndIf
Sleep(100)
Run("Explorer.exe " & @TempDir)
$sTitle2 = StringRegExpReplace(@TempDir, "^.*\\", "")
$hWin2 = WinWait('[REGEXPCLASS:(Cabinet|Explore)WClass;REGEXPTITLE:.*\Q' & $sTitle2 & '\E.*]', '', 5)
If $hWin2 Then
WinMove ($sTitle2, "", @DesktopWidth - $x, $y, $x, $y)
WinSetOnTop($hWin2, "", 1)
EndIf
Sleep(100)
Run("Explorer.exe " & @DesktopDir)
$sTitle3 = StringRegExpReplace(@DesktopDir, "^.*\\", "")
$hWin3 = WinWait('[REGEXPCLASS:(Cabinet|Explore)WClass;REGEXPTITLE:.*\Q' & $sTitle3 & '\E.*]', '', 5)
If $hWin3 Then
WinMove ($sTitle3, "", @DesktopWidth - $x, $y * 2, $x, $y)
WinSetOnTop($hWin3, "", 1)
EndIf