Jump to content

How to move active IE window


qwert
 Share

Recommended Posts

I want to use WinMove to shift the currently-active (on top) Explorer window up a couple of hundred pixels. But WinMove requires the "title", which is not something my script knows (since Explorer titles depend on the content being viewed).

I can't get a handle (no pun intended) on how to approach this. I first thought this might be easy, but my searches haven't led me to anything I can recognize as a solution. And IE.au3 doesn't seem to work with the window, itself.

Thanks in advance for any suggestions.

Link to comment
Share on other sites

$pos = WinGetPos("[Active]")
WinMove("[Active]", "", $pos[0], $pos[1] - 100)

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

No problem. Good luck!

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

Here's the resulting script. Now, if only window height could be set larger than @DesktoHeight+12, then I could have even more viewable space in a browser window. But I'm sensing that's a solid limitation ... and this is certainly an improvment. Thanks again for the assistance.

;
; Position Active Window using F9 as hotkey
;
HotKeySet("{F9}", "pressed")
Dim $i = 0, $PushTime = 1000
While 1
    Sleep(100)
WEnd
Func pressed()
    $i += 1
    Sleep($PushTime)
    Switch $i
        Case 1
$pos = WinGetPos("[Active]")  ;move active window up 100
WinMove("[Active]", "", $pos[0], $pos[1] - 100)
        Case 2
$pos = WinGetPos("[Active]")  ;mover active window down 100
WinMove("[Active]", "", $pos[0], $pos[1] + 100)
        Case 3
$pos = WinGetPos("[Active]")  ;maximize height of active window
WinMove("[Active]", "", $pos[0], $pos[1] , @DesktopWidth, @DesktopHeight+12)
        Case 4
            Exit (0)    ;exit upon 4 presses
    EndSwitch
    $i = 0
EndFunc   ;==>pressed
Link to comment
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
 Share

  • Recently Browsing   0 members

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