Jump to content

Recommended Posts

Posted

So I have a program I put together that uses the run from short cut function. Which when you specify run minimized from a short cut to the program, it runs minimized.. Sounds simple? however when you do this.. None of the child windows the program calls work? When ran normally via the shortcut, everything works well. Any idea why this may happen?

 

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=..\Icons\winsizer.ico
#AutoIt3Wrapper_Outfile=..\program\winsizer.exe
#AutoIt3Wrapper_UseUpx=y
#AutoIt3Wrapper_Res_Icon_Add=..\Icons\winsizer_off.ico
#AutoIt3Wrapper_Run_Tidy=y
#Tidy_Parameters=/tc 4 /reel
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

;╔══════════════════════════════════════════════════════════╗
;║  __      __.__         _________.__                      ║
;║ /  \    /  \__| ____  /   _____/|__|_______ ___________  ║
;║ \   \/\/   /  |/    \ \_____  \ |  \___   // __ \_  __ \ ║
;║  \        /|  |   |  \/        \|  |/    /\  ___/|  | \/ ║
;║   \__/\  / |__|___|  /_______  /|__/_____ \\___  >__|    ║
;║        \/          \/        \/          \/    \/        ║
;╟──────────────────────────────────────────────────────────╢
;║ Program by: Zone97                                       ║
;║ Written on: 12/28/2016                                   ║
;║ Function:   Capture and store desktop window size and    ║
;║             locations.                                   ║
;╚══════════════════════════════════════════════════════════╝

;╔══════════════════════════════════════════════════════════╗
;║ Includes                                                 ║
;╚══════════════════════════════════════════════════════════╝

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <TrayConstants.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>
#include <MsgBoxConstants.au3>
#include <GuiListView.au3>
#include <Misc.au3>

; - Custom UDFs
#include ".\Includes\ExtMsgBox.au3"
#include ".\Includes\HotKeyInput.au3"
#include ".\Includes\HotKey.au3"

;╔══════════════════════════════════════════════════════════╗
;║ GUI Options                                              ║
;╚══════════════════════════════════════════════════════════╝

Opt("TrayMenuMode", 3)

;╔══════════════════════════════════════════════════════════╗
;║ Variables                                                ║
;╚══════════════════════════════════════════════════════════╝

; - System Locals
Local $hDLL = DllOpen("user32.dll")
Local $AbtConfig[7] = [5, 0, 0xBBBBBB, 0x333333, 12, "Courier New", 500]

; - System Globals
Global $INIfile = "winsizer.ini"
Global $GUITitle = "WinSizer 2.1d"
Global $sState = @SW_SHOW
Global $sShortcut = _RunFromShortcut()

; - GUI_Main Globals
Global $Form1 = 9999, $List1, $List2, $Button1, $Button2, $Button3, $Button4, $TrayMenu, $TrayExit, $TrayActive, $TrayAbout, $TraySetKey
; - GUI_Settings Globals
Global $Form2 = 9999, $bLabel1, $bLabel2, $bLabel3, $bLabel4, $bLabel5, $bLabel6, $bGroup1, $bRadio1, $bRadio2, $bRadio3, $bRadio4, $bRadio5, $bRadio6, $bInput1, $bInput2, $bInput3, $bInput4, $bInput5, $bInput6, $bButton1, $bButton2, $bCheckbox1, $NewClass, $NewWin, $xPos, $xSize, $yPos, $ySize
; - GUI_SetHotKey Globals
Global $Form3 = 9999, $hkButton1, $hkButton2, $hkInput1, $hkLabel1
; - Other Globals
Global $iniTotal, $index, $sItem1, $sItem2, $sItems, $tClass, $tPos, $tSize, $tMode, $tAction, $hTimer, $IsDisabled

;╔══════════════════════════════════════════════════════════╗
;║ Pre-startup checks                                       ║
;╚══════════════════════════════════════════════════════════╝

If IsArray($sShortcut) Then
    If $sShortcut[6] = 3 Then $sState = @SW_SHOW
    If $sShortcut[6] = 7 Then $sState = @SW_HIDE
EndIf

If _Singleton($GUITitle, 1) = 0 Then ; -- Check that it only is ran once!
    WinActivate($GUITitle)
    Exit
EndIf

TraySetToolTip($GUITitle)

;╔══════════════════════════════════════════════════════════╗
;║ Hot keys                                                 ║
;╚══════════════════════════════════════════════════════════╝

Global $hotkey = IniRead($INIfile, "Hotkeys", "Key1", "1626")
_HotKey_Assign($hotkey, '_QuickAdd', $HK_FLAG_DEFAULT)

;╔══════════════════════════════════════════════════════════╗
;║ Start of main loop                                       ║
;╚══════════════════════════════════════════════════════════╝

GUI_Main()
_Refresh()

While 1
    $nMsg = GUIGetMsg(1)
    Switch $nMsg[1]
        Case $Form1 ; - GUI_Main()
            Switch $nMsg[0]
                Case $GUI_EVENT_CLOSE
                    _ExtMsgBoxSet($AbtConfig[0], $AbtConfig[1], $AbtConfig[2], $AbtConfig[3], $AbtConfig[4], $AbtConfig[5], $AbtConfig[6])
                    $Confirm = _ExtMsgBox(@ScriptFullPath, 4, "Confirm Close", "Are you sure you want to EXIT?", 0)
                    _ExtMsgBoxSet(Default)
                    If $Confirm = 1 Then Exit
                Case $GUI_EVENT_MINIMIZE
                    WinSetState($Form1, "", @SW_HIDE)
                Case $Button1 ; Add New Button
                    $sItem1 = GUICtrlRead(GUICtrlRead($List1))
                    If $sItem1 <> "" Then
                        $sItem1 = StringTrimRight($sItem1, 1) ; Will remove the pipe "|" from the end of the string
                        $sItems = StringSplit($sItem1, "|")
                        $NewWin = $sItems[1]
                        $NewClass = _WinGetClass($NewWin)
                        $NewPos = WinGetPos($NewWin)
                        $xSize = $NewPos[2]
                        $ySize = $NewPos[3]
                        $xPos = $NewPos[0]
                        $yPos = $NewPos[1]
                        GUI_Settings()
                    EndIf
                Case $Button2
                    _Refresh()
                Case $Button3 ; Edit Button
                    $sItem1 = GUICtrlRead(GUICtrlRead($List2))
                    If $sItem1 <> "" Then
                        $index = _GUICtrlListView_GetSelectedIndices($List2) + 1
                        $sItem1 = StringTrimRight($sItem1, 1) ; Will remove the pipe "|" from the end of the string
                        $sItems = StringSplit($sItem1, "|")
                        $NewWin = $sItems[1]
                        $NewClass = $sItems[2]
                        $NewSize = StringSplit($tSize[$index], "x")
                        $NewPos = StringSplit($tPos[$index], "x")
                        $xSize = $NewSize[1]
                        $ySize = $NewSize[2]
                        $xPos = $NewPos[1]
                        $yPos = $NewPos[2]
                        GUI_Settings()
                    EndIf
                Case $Button4 ; Delete Button
                    $sItem2 = GUICtrlRead(GUICtrlRead($List2))
                    $index = _GUICtrlListView_GetSelectedIndices($List2) + 1
                    $sItem2 = StringTrimRight($sItem2, 1) ; Will remove the pipe "|" from the end of the string
                    _DelWindow()
            EndSwitch
        Case $Form2 ; - GUI_Settings()
            Switch $nMsg[0]
                Case $bButton1
                    _AddEditWindow()
                    GUIDelete($Form2)
                Case $bButton2
                    GUIDelete($Form2)
            EndSwitch
        Case $Form3
            Switch $nMsg[0]
                Case $hkButton1
                    _HotKey_Release()
                    $hotkey = _GUICtrlHKI_GetHotKey($hkInput1)
                    IniWrite($INIfile, "Hotkeys", "Key1", $hotkey)
                    _HotKey_Assign($hotkey, '_QuickAdd', $HK_FLAG_DEFAULT)
                    _GUICtrlHKI_Release()
                    GUIDelete($Form3)
                Case $hkButton2
                    GUIDelete($Form3)
            EndSwitch
    EndSwitch
    Switch TrayGetMsg()
        Case $TrayMenu
            WinSetState($Form1, "", @SW_SHOWNORMAL)
            _Refresh()
        Case $TrayExit
            Exit
        Case $TrayActive
            If BitAND(TrayItemGetState($TrayActive), $TRAY_CHECKED) = $TRAY_CHECKED Then
                TrayItemSetState($TrayActive, $TRAY_UNCHECKED)
                TraySetIcon(@ScriptFullPath, 200)
            Else
                TrayItemSetState($TrayActive, $TRAY_CHECKED)
                TraySetIcon(@ScriptFullPath, 201)
            EndIf
        Case $TrayAbout
            _About()
        Case $TraySetKey
            GUI_SetHotKey()
    EndSwitch
    ; - Set a timer to only check for active window every 2 seconds
    If Not WinExists($GUITitle & " Settings") Then
        Local $fDiff = TimerDiff($hTimer)
        $fDiff = Round($fDiff, 0)
        If $fDiff > 1000 Then
            Local $hTimer = TimerInit()
            _FindWindows()
        EndIf
    Else
        If WinExists($NewWin) Then
            If Not BitAND(GUICtrlRead($bCheckbox1), $GUI_CHECKED) = $GUI_CHECKED Then
                $tmpPos = WinGetPos($NewWin)
                GUICtrlSetData($bInput3, $tmpPos[2])
                GUICtrlSetData($bInput4, $tmpPos[3])
                GUICtrlSetData($bInput5, $tmpPos[0])
                GUICtrlSetData($bInput6, $tmpPos[1])
            EndIf
        EndIf
    EndIf
    _ErrorTraps() ; - Check for window to be active.
WEnd

;╔══════════════════════════════════════════════════════════╗
;║ GUI Functions                                            ║
;╚══════════════════════════════════════════════════════════╝

Func GUI_Main()
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate($GUITitle, 520, 390, -1, -1)
    $List1 = GUICtrlCreateListView("Title|Class", 10, 20, 500, 110, $LVS_SORTASCENDING + $LVS_SINGLESEL)
    $List2 = GUICtrlCreateListView("Title|Class|Mode|Action", 10, 215, 500, 110, $LVS_SINGLESEL)
    $Group1 = GUICtrlCreateGroup("Currently open windows", 5, 5, 510, 180)
    $Group2 = GUICtrlCreateGroup("Windows to be monitored", 5, 200, 510, 180)
    $Button1 = GUICtrlCreateButton("Select", 187, 145, 75, 25)
    GUICtrlSetTip(-1, "CTRL-ALT-Z")
    $Button2 = GUICtrlCreateButton("Refresh", 269, 145, 75, 25)
    $Button3 = GUICtrlCreateButton("Edit", 187, 338, 75, 25)
    $Button4 = GUICtrlCreateButton("Delete", 269, 338, 75, 25)
    ; - Form options
    GUISetBkColor(0xC0C0C0, $Form1)
    GUICtrlSendMsg($List1, $LVM_SETCOLUMNWIDTH, 0, 320)
    GUICtrlSendMsg($List1, $LVM_SETCOLUMNWIDTH, 1, 159)
    GUICtrlSendMsg($List2, $LVM_SETCOLUMNWIDTH, 0, 233)
    GUICtrlSendMsg($List2, $LVM_SETCOLUMNWIDTH, 1, 150)
    GUICtrlSendMsg($List2, $LVM_SETCOLUMNWIDTH, 2, 45)
    GUICtrlSendMsg($List2, $LVM_SETCOLUMNWIDTH, 3, 50)
    ; - Tray menu items
    $TrayActive = TrayCreateItem("Disabled")
    TrayCreateItem("")
    $TrayMenu = TrayCreateItem("Open")
    $TrayAbout = TrayCreateItem("About")
    $TraySetKey = TrayCreateItem("HotKey")
    TrayCreateItem("")
    $TrayExit = TrayCreateItem("Exit")
    GUISetState($sState)
    TrayItemSetState($TrayMenu, $TRAY_DEFAULT)
    #EndRegion ### END Koda GUI section ###
EndFunc   ;==>GUI_Main

Func GUI_Settings()
    #Region ### START Koda GUI section ### Form=
    $Form2 = GUICreate($GUITitle & " Settings", 437, 185, -1, -1, $WS_EX_TOOLWINDOW)
    $bLabel1 = GUICtrlCreateLabel("Window title:", 8, 10, 65, 17)
    $bLabel2 = GUICtrlCreateLabel("Class name:", 8, 40, 61, 17)
    $bLabel3 = GUICtrlCreateLabel("Size:", 278, 82, 27, 17)
    $bLabel4 = GUICtrlCreateLabel("Position:", 278, 106, 44, 17)
    $bLabel5 = GUICtrlCreateLabel("X", 371, 84, 9, 17)
    $bLabel6 = GUICtrlCreateLabel("X", 371, 107, 9, 17)
    $bGroup1 = GUICtrlCreateGroup("Search Options", 8, 68, 107, 81)
    $bGroup2 = GUICtrlCreateGroup("Action Options", 124, 68, 107, 81)
    GUIStartGroup()
    $bRadio1 = GUICtrlCreateRadio("Title Only", 20, 86, 73, 17)
    $bRadio2 = GUICtrlCreateRadio("Class Only", 20, 101, 77, 17)
    $bRadio3 = GUICtrlCreateRadio("Both", 20, 116, 69, 17)
    GUIStartGroup()
    $bRadio4 = GUICtrlCreateRadio("Move", 136, 86, 73, 17)
    $bRadio5 = GUICtrlCreateRadio("Resize", 136, 101, 77, 17)
    $bRadio6 = GUICtrlCreateRadio("Both", 136, 116, 69, 17)
    $bInput1 = GUICtrlCreateInput($NewWin, 82, 8, 341, 21)
    $bInput2 = GUICtrlCreateInput($NewClass, 82, 38, 341, 21)
    $bInput3 = GUICtrlCreateInput($xSize, 326, 80, 40, 21)
    $bInput4 = GUICtrlCreateInput($ySize, 382, 80, 40, 21)
    $bInput5 = GUICtrlCreateInput($xPos, 326, 102, 40, 21)
    $bInput6 = GUICtrlCreateInput($yPos, 382, 102, 40, 21)
    $bButton1 = GUICtrlCreateButton("Save", 266, 126, 75, 25)
    $bButton2 = GUICtrlCreateButton("Cancel", 349, 126, 75, 25)
    $bCheckbox1 = GUICtrlCreateCheckbox("Pause Auto Update", 294, 62, 117, 17)
    ; - Form options
    GUISetBkColor(0xC0C0C0, $Form2)
    ; - Set form defaults
    GUICtrlSetState($bRadio3, $GUI_CHECKED)
    GUICtrlSetState($bRadio6, $GUI_CHECKED)
    ; - Check for defaults
    If $index <> "" Then
        If $tMode[$index] = "Both" Then
            GUICtrlSetState($bRadio3, $GUI_CHECKED)
        ElseIf $tMode[$index] = "Title" Then
            GUICtrlSetState($bRadio1, $GUI_CHECKED)
        ElseIf $tMode[$index] = "Class" Then
            GUICtrlSetState($bRadio2, $GUI_CHECKED)
        EndIf
        If $tAction[$index] = "Both" Then
            GUICtrlSetState($bRadio6, $GUI_CHECKED)
        ElseIf $tAction[$index] = "Move" Then
            GUICtrlSetState($bRadio4, $GUI_CHECKED)
        ElseIf $tAction[$index] = "Resize" Then
            GUICtrlSetState($bRadio5, $GUI_CHECKED)
        EndIf
    EndIf
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###
EndFunc   ;==>GUI_Settings

Func GUI_SetHotKey()
    #Region ### START Koda GUI section ### Form=
    $Form3 = GUICreate($GUITitle & " Hotkey", 255, 125, -1, -1, $WS_EX_TOOLWINDOW)
    $hkButton1 = GUICtrlCreateButton("Update", 86, 64, 75, 25)
    $hkButton2 = GUICtrlCreateButton("Cancel", 167, 64, 75, 25)
    $hkLabel1 = GUICtrlCreateLabel("Enter Hotkey (Click input box first.)", 8, 12, 200, 17, 0)
    $hkInput1 = _GUICtrlHKI_Create($hotkey, 6, 36, 237, 21)
    ; - Form options
    GUISetBkColor(0xC0C0C0, $Form3)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###
EndFunc   ;==>GUI_SetHotKey

;╔══════════════════════════════════════════════════════════╗
;║ App Functions                                            ║
;╚══════════════════════════════════════════════════════════╝

Func _ActiveWinList()
    $aList = WinList()
    For $i = 1 To $aList[0][0]
        If $aList[$i][0] <> "" And $aList[$i][0] <> $GUITitle And BitAND(WinGetState($aList[$i][1]), 2) And Not BitAND(WinGetState($aList[$i][1]), 16) Then ; - Not blank title, Self, hidden, or minimized!
            $winClass = _WinGetClass($aList[$i][0])
            GUICtrlCreateListViewItem($aList[$i][0] & "|" & $winClass, $List1)
        EndIf
    Next
EndFunc   ;==>_ActiveWinList

Func _AddEditWindow()
    Global $titles = IniReadSection($INIfile, "Titles")
    If $index = "" Then
        $RandNo = Random(100000, 999999, 1)
    Else
        $RandNo = $titles[$index][0]
    EndIf
    $NewWin = GUICtrlRead($bInput1)
    $NewClass = GUICtrlRead($bInput2)
    $NewSizeX = GUICtrlRead($bInput3)
    $NewSizeY = GUICtrlRead($bInput4)
    $NewPosX = GUICtrlRead($bInput5)
    $NewPosY = GUICtrlRead($bInput6)
    For $y = 1 To $iniTotal
        If $titles[$y][1] = $NewWin Then
            $RandNo = $titles[$y][0]
        EndIf
    Next
    If BitAND(GUICtrlRead($bRadio1), $GUI_CHECKED) = $GUI_CHECKED Then $Mode = "Title"
    If BitAND(GUICtrlRead($bRadio2), $GUI_CHECKED) = $GUI_CHECKED Then $Mode = "Class"
    If BitAND(GUICtrlRead($bRadio3), $GUI_CHECKED) = $GUI_CHECKED Then $Mode = "Both"
    If BitAND(GUICtrlRead($bRadio4), $GUI_CHECKED) = $GUI_CHECKED Then $Action = "Move"
    If BitAND(GUICtrlRead($bRadio5), $GUI_CHECKED) = $GUI_CHECKED Then $Action = "Resize"
    If BitAND(GUICtrlRead($bRadio6), $GUI_CHECKED) = $GUI_CHECKED Then $Action = "Both"
    IniWrite($INIfile, "Titles", $RandNo, $NewWin)
    IniWrite($INIfile, $RandNo, "Mode", $Mode)
    IniWrite($INIfile, $RandNo, "Action", $Action)
    IniWrite($INIfile, $RandNo, "Class", $NewClass)
    IniWrite($INIfile, $RandNo, "Size", $NewSizeX & "x" & $NewSizeY)
    IniWrite($INIfile, $RandNo, "Position", $NewPosX & "x" & $NewPosY)
    _Refresh()
EndFunc   ;==>_AddEditWindow

Func _DelWindow()
    If $sItem2 <> "" Then
        Global $titles = IniReadSection($INIfile, "Titles")
        IniDelete($INIfile, "Titles", $titles[$index][0])
        IniDelete($INIfile, $titles[$index][0])
        $iniTotal = $iniTotal - 1
        _Refresh()
    EndIf
EndFunc   ;==>_DelWindow

Func _WinGetClass($Form1)
    If IsHWnd($Form1) = 0 And WinExists($Form1) Then $Form1 = WinGetHandle($Form1)
    Local $aGCNDLL = DllCall('User32.dll', 'int', 'GetClassName', 'hwnd', $Form1, 'str', '', 'int', 4095)
    If @error = 0 Then Return $aGCNDLL[2]
    Return SetError(1, 0, '')
EndFunc   ;==>_WinGetClass

Func _INItoArray()
    Global $titles = IniReadSection($INIfile, "Titles")
    If Not @error Then
        $iniTotal = $titles[0][0]
        Global $tMode[$iniTotal + 1], $tAction[$iniTotal + 1], $tClass[$iniTotal + 1], $tSize[$iniTotal + 1], $tPos[$iniTotal + 1]
        For $x = 1 To $iniTotal
            $tMode[$x] = IniRead($INIfile, $titles[$x][0], "Mode", "")
            $tAction[$x] = IniRead($INIfile, $titles[$x][0], "Action", "")
            $tClass[$x] = IniRead($INIfile, $titles[$x][0], "Class", "")
            $tSize[$x] = IniRead($INIfile, $titles[$x][0], "Size", "")
            $tPos[$x] = IniRead($INIfile, $titles[$x][0], "Position", "")
            GUICtrlCreateListViewItem($titles[$x][1] & "|" & $tClass[$x] & "|" & $tMode[$x] & "|" & $tAction[$x], $List2)
        Next
    EndIf
EndFunc   ;==>_INItoArray

Func _Refresh()
    _GUICtrlListView_DeleteAllItems($List1)
    _GUICtrlListView_DeleteAllItems($List2)
    _INItoArray()
    _ActiveWinList()
    $index = ""
EndFunc   ;==>_Refresh

Func _FindWindows()
    If Not BitAND(TrayItemGetState($TrayActive), $TRAY_CHECKED) = $TRAY_CHECKED Then
        If $iniTotal > 0 Then
            For $y = 1 To $iniTotal
                If WinExists($titles[$y][1]) Then
                    Local $tmpPos = WinGetPos($titles[$y][1])
                    $wSize = StringSplit($tSize[$y], "x")
                    $wPos = StringSplit($tPos[$y], "x")
                    If $tMode[$y] = "Both" And $tAction[$y] = "Both" Then
                        WinMove("[TITLE:" & $titles[$y][1] & "; CLASS:" & $tClass[$y] & "]", "", $wPos[1], $wPos[2], $wSize[1], $wSize[2])
                    ElseIf $tMode[$y] = "Both" And $tAction[$y] = "Move" Then
                        WinMove("[TITLE:" & $titles[$y][1] & "; CLASS:" & $tClass[$y] & "]", "", $wPos[1], $wPos[2])
                    ElseIf $tMode[$y] = "Both" And $tAction[$y] = "Resize" Then
                        WinMove("[TITLE:" & $titles[$y][1] & "; CLASS:" & $tClass[$y] & "]", "", $tmpPos[0], $tmpPos[1], $wSize[1], $wSize[2])
                    ElseIf $tMode[$y] = "Title" And $tAction[$y] = "Both" Then
                        WinMove("[TITLE:" & $titles[$y][1] & "]", "", $wPos[1], $wPos[2], $wSize[1], $wSize[2])
                    ElseIf $tMode[$y] = "Title" And $tAction[$y] = "Move" Then
                        WinMove("[TITLE:" & $titles[$y][1] & "]", "", $wPos[1], $wPos[2])
                    ElseIf $tMode[$y] = "Title" And $tAction[$y] = "Resize" Then
                        WinMove("[TITLE:" & $titles[$y][1] & "]", "", $tmpPos[0], $tmpPos[1], $wSize[1], $wSize[2])
                    ElseIf $tMode[$y] = "Class" And $tAction[$y] = "Both" Then
                        WinMove("[CLASS:" & $tClass[$y] & "]", "", $wPos[1], $wPos[2], $wSize[1], $wSize[2])
                    ElseIf $tMode[$y] = "Class" And $tAction[$y] = "Move" Then
                        WinMove("[CLASS:" & $tClass[$y] & "]", "", $wPos[1], $wPos[2])
                    ElseIf $tMode[$y] = "Class" And $tAction[$y] = "Resize" Then
                        WinMove("[CLASS:" & $tClass[$y] & "]", "", $tmpPos[0], $tmpPos[1], $wSize[1], $wSize[2])
                    EndIf
                EndIf
            Next
        EndIf
    EndIf
EndFunc   ;==>_FindWindows

Func _RunFromShortcut() ;~ ;johnmcloud - 2014
    Local $tSI = DllStructCreate($tagSTARTUPINFO)
    DllCall('kernel32.dll', 'none', 'GetStartupInfoW', 'struct*', $tSI)
    If @error Then Return SetError(@error, @extended, 0)
    Local $vFlag = DllStructGetData($tSI, 'Flags')
    If BitAND($vFlag, 0x800) Then
        Local $sTitle = DllStructCreate('wchar ShortcutPath[261]', DllStructGetData($tSI, 'Title'))
        Local $sShortcutPath = DllStructGetData($sTitle, 'ShortcutPath')
        If $sShortcutPath Then
            Return FileGetShortcut($sShortcutPath)
        Else
            Return SetError(1, 0, 0)
        EndIf
    Else
        Return SetError(2, 0, 0)
    EndIf
EndFunc   ;==>_RunFromShortcut

Func _QuickAdd()
    $NewWin = WinGetTitle("[ACTIVE]")
    $NewClass = _WinGetClass($NewWin)
    $NewPos = WinGetPos($NewWin)
    $xSize = $NewPos[2]
    $ySize = $NewPos[3]
    $xPos = $NewPos[0]
    $yPos = $NewPos[1]
    If $NewWin <> $GUITitle Then
        GUI_Settings()
    EndIf
EndFunc   ;==>_QuickAdd

Func _ErrorTraps()
    If Not $IsDisabled = True And (WinExists($GUITitle & " Settings") Or WinExists($GUITitle & " Hotkey")) Then
        TraySetClick(0)
        GUICtrlSetState($Button1, $GUI_DISABLE)
        _HotKey_Disable()
        $IsDisabled = True
    EndIf
    If $IsDisabled And Not (WinExists($GUITitle & " Settings") Or WinExists($GUITitle & " Hotkey")) Then
        TraySetClick(9)
        GUICtrlSetState($Button1, $GUI_ENABLE)
        _HotKey_Enable()
        $IsDisabled = Not $IsDisabled
    EndIf
EndFunc   ;==>_ErrorTraps

Func _About()
    _ExtMsgBoxSet($AbtConfig[0], $AbtConfig[1], $AbtConfig[2], $AbtConfig[3], $AbtConfig[4], $AbtConfig[5], $AbtConfig[6])
    _ExtMsgBox(@ScriptFullPath, "Close", $GUITitle & " About", $GUITitle & @CRLF & "" & @CRLF & "Written By.................: ZoNE97" & @CRLF & "HotKey UDF By..............: Yashied" & @CRLF & "ExtMsgBox UDF By...........: Melba23" & @CRLF & "RunFromShortcut Function By: JohnMCloud", 0)
    _ExtMsgBoxSet(Default)
EndFunc   ;==>_About

 

 

Spoiler

WinSizer 2.1 (01/04/2017) - Download - [ Windows Layout Manager ]
Folder+Program (12/23/2016) - Download - [ USB Shortcut Creator ]

 

Posted

Ok, so i have found out WHY it doesn't work, but id like to make it work as intended. Seems as if the GUI starts hidden, that's when the child windows AKA the settings, stop showing. I fixed it by showing the GUI for a flash, then it minimizes. This makes it work, but id like it to never show, not even a flash when started minimized to tray.. Is this a possibility?

 

Spoiler

WinSizer 2.1 (01/04/2017) - Download - [ Windows Layout Manager ]
Folder+Program (12/23/2016) - Download - [ USB Shortcut Creator ]

 

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...