Jump to content

Recommended Posts

Posted
Example()

Func Example()
    ; Run Notepad
    ShellExecute("C:\free\acc 3 - Chrome.lnk")

    ; Wait 10 seconds for the Notepad window to appear.
    Local $hWnd = WinWait("[CLASS:Chrome_WidgetWin_1]", "", 10)

    ; Retrieve the position as well as the height and width of the Notepad window. We will use this when we have to move the window back to the original position.
    Local $aPos = WinGetPos($hWnd)

    ; Move the Notepad to the x, y position of 0, 0 and set the height and width at 200, 200.
    WinMove($hWnd, "", 0, 0, 230, 858)

    ; Wait for 2 seconds to display the new position of the Notepad window.
    Sleep(2000)

    ; Move the Notepad window back to the original position by using the array returned by WinGetPos.
;~     WinMove($hWnd, "", $aPos[0], $aPos[1], $aPos[2], $aPos[3])

    ; Wait for 2 seconds to display the original position of the Notepad window.
    Sleep(2000)

    ; Close the Notepad window using the handle returned by WinWait.
;~     WinClose($hWnd)
EndFunc   ;==>Example

 

Posted
Global $sWinTitle = "Neuer Tab - Google Chrome"
Global $avWinList = WinList($sWinTitle)

;~ ; Create 5 instances of notepad
While $avWinList[0][0] < 3
    Run($sRunCmd)
    Sleep(250); Wait for new process to create its GUI
    $avWinList = WinList($sWinTitle)
WEnd

; Move and ID each instance

For $n = 1 To $avWinList[0][0]
    WinActivate($avWinList[$n][1])
    WinMove($avWinList[$n][1], "", 0, 0, 230, 858)
Next

For $n = 2 To $avWinList[0][0]
    WinActivate($avWinList[$n][1])
    WinMove($avWinList[$n][1], "",539, 0, 230, 858)
Next

For $n = 3 To $avWinList[0][0]
    WinActivate($avWinList[$n][1])
    WinMove($avWinList[$n][1], "", 1083, 1, 230, 858)
Next

this orders all windows like id like to have them but

Posted
ShellExecute("C:\free\acc 1 - Chrome.lnk")
ShellExecute("C:\free\acc 2 - Chrome.lnk")
ShellExecute("C:\free\acc 3 - Chrome.lnk")
WinWait("Neuer Tab - Google Chrome","")
;~ Global $sRunCmd = "notepad.exe"
Global $sWinTitle = "Neuer Tab - Google Chrome"
Global $avWinList = WinList($sWinTitle)

;~ ; Create 5 instances of notepad
While $avWinList[0][0] < 3
;~     Run($sRunCmd)
    Sleep(250); Wait for new process to create its GUI
    $avWinList = WinList($sWinTitle)
WEnd

; Move and ID each instance

For $n = 1 To $avWinList[0][0]
    WinActivate($avWinList[$n][1])
    WinMove($avWinList[$n][1], "", 0, 0, 230, 858)
;~     ControlSetText($avWinList[$n][1], "", "Edit1", "This is notepad.exe instance no." & $n)
Next

For $n = 2 To $avWinList[0][0]
    WinActivate($avWinList[$n][1])
    WinMove($avWinList[$n][1], "",539, 0, 230, 858)
;~     ControlSetText($avWinList[$n][1], "", "Edit1", "This is notepad.exe instance no." & $n)
Next

For $n = 3 To $avWinList[0][0]
    WinActivate($avWinList[$n][1])
    WinMove($avWinList[$n][1], "", 1083, 1, 230, 858)
;~     ControlSetText($avWinList[$n][1], "", "Edit1", "This is notepad.exe instance no." & $n)
Next

well this opens three profiles and aranges them on the screen

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...