Move and Resize GUI Based on Input Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Bross9132
Posts: 14
Joined: 08 Feb 2018, 09:46

Move and Resize GUI Based on Input

24 Mar 2018, 14:36

I am trying to move the GUI to a different monitor based on the monitor number that was typed in the edit box (Right now I am just working with Monitor 2). Here is the Code:

Code: Select all

SysGet, Mon2, Monitor, 2

file := "Nebula.mp4"
Gui, 1:New, +HWNDHwnd
DllCall("User32.dll\SetParent", "Ptr", Hwnd, "Ptr", WorkerW, "Ptr")
Gui, +toolwindow -Caption
Gui, Add, ActiveX, x0 y0 w1920 h1080 vWMP, WMPLayer.OCX
WMP.Url := file
WMP.uiMode := "none" ;no WMP controls
WMP.stretchToFit := 1 ;video is streched to the given activex range
WMP.enableContextMenu := 0 ;no reaction to right click in the video field
WMP.Settings.AutoStart := True
WMP.Settings.setMode("loop", true)
Gui +LastFound
WinSet, TransColor, 000000
WinSet, TransColor, F0F0F0
Gui, 1:Show,,GuiVid

Gui, 2:New
Gui, +AlwaysOnTop
Gui +LastFound
Gui, Add, Text,, Select your monitor (Only works on 3 as of right now):
Gui, Add, Edit, Number Limit2
Gui, Add, UpDown, vMonNum Range1-99, 2
Gui, Add, Button, Default gOk, Ok
Gui, Show
return

Ok:
Gui, Submit
If %MonNum% = 2
WinMove, GuiVid,, %Mon2%
return
wolf_II
Posts: 2688
Joined: 08 Feb 2015, 20:55

Re: Move and Resize GUI Based on Input  Topic is solved

24 Mar 2018, 16:36

Try this:

Code: Select all

Ok:
    Gui, Submit
    If (MonNum = 2)
        WinMove, GuiVid,, %Mon2Left%, %Mon2Top%
return
I hope that helps.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 348 guests