Sign in to follow this  
Followers 0
XiaolinDraconis

Controls not keeping previous settings

6 posts in this topic

Don't see why it won't keep the settings when Options() gets called, keeps reverting to unchecked radios and slider at 100 of 255. It should be reading the INI for those values each time it's called.

#NoTrayIcon
#include <Misc.au3>
#include <MsgBoxConstants.au3>
#include <TrayConstants.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <SliderConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Opt("TrayMenuMode", 3) ; The default tray menu items will not be shown and items are not checked when selected. These are options 1 and 2 for TrayMenuMode.
Opt("TrayOnEventMode", 1) ; Enable TrayOnEventMode.

HotKeySet("^{SPACE}", "TapTimer")

If FileExists(".\OTPT.ini") Then
    Sleep(1000)
Else
    IniWrite("OTPT.ini", "AOT", "True", "1" & @CRLF)
    IniWrite("OTPT.ini", "Transparency", "Value", "204" & @CRLF & @CRLF & "Max Transparency Value = 255")
EndIf

$Toggle = 0
$AOT = IniRead("OTPT.ini", "AOT", "True", "1")
$Transparency = IniRead("OTPT.ini", "Transparency", "Value", "204")


TrayMenu()

Func TrayMenu()
    TrayCreateItem("Settings")
    TrayItemSetOnEvent(-1, "Options")

    TrayCreateItem("About")
    TrayItemSetOnEvent(-1, "About")

    TrayCreateItem("") ; Create a separator line.

    TrayCreateItem("Exit")
    TrayItemSetOnEvent(-1, "ExitScript")

    TraySetOnEvent($TRAY_EVENT_PRIMARYDOUBLE, "Options") ; Display the About MsgBox when the tray icon is double clicked on with the primary mouse button.

    TraySetState($TRAY_ICONSTATE_SHOW) ; Show the tray menu.
EndFunc   ;==>TrayMenu

While 1
    Sleep(100) ; An idle loop.
WEnd

Func TapTimer()
    HotKeySet("^{SPACE}")
    $TapTime = 0
    While _IsPressed("20")
        Sleep(1000)
        $TapTime += 1
    WEnd
    If $TapTime < 3 Then
        OnTop()
        Sleep(500)
    Else
        Options()
        Sleep(500)
    EndIf
    HotKeySet("^{SPACE}", "TapTimer")
EndFunc   ;==>TapTimer

Func Options()

    $Form1 = GUICreate("Settings", 290, 142)
    $Radio1 = GUICtrlCreateRadio("", 119, 32, 17, 17)
    If $AOT = 1 Then
        GUICtrlSetData($Radio1, $GUI_CHECKED, $GUI_CHECKED)
    Else
        GUICtrlSetData($Radio1, $GUI_UNCHECKED, $GUI_UNCHECKED)
    EndIf
    $Radio2 = GUICtrlCreateRadio("", 168, 32, 17, 17)
    $Label1 = GUICtrlCreateLabel("ON", 96, 32, 20, 17)
    $Label2 = GUICtrlCreateLabel("OFF", 142, 30, 24, 17)
    $Slider = GUICtrlCreateSlider(13, 72, 255, 25)
    GUICtrlSetData(-1, $Transparency)
    GUICtrlSetLimit(-1, 255, 0)
    $Label3 = GUICtrlCreateLabel("-", 8, 72, 15, 17)
    $Label4 = GUICtrlCreateLabel("+", 269, 70, 10, 17)
    $Label5 = GUICtrlCreateLabel("Always On Top", 102, 3, 89, 17)
    GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
    $Label6 = GUICtrlCreateLabel("Transparency", 106, 56, 81, 17)
    GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
    $OK = GUICtrlCreateButton("OK", 128, 104, 33, 33)
    GUISetState(@SW_SHOW)
    WinSetOnTop("Settings", "", 1)

    While 1
        WinActivate("Settings")
        $nMsg = GUIGetMsg()
        Switch $nMsg
            Case $GUI_EVENT_CLOSE
                GUISetState(@SW_HIDE)
                ExitLoop
            Case $OK
                While GUICtrlRead($Radio1) = $GUI_UNCHECKED And GUICtrlRead($Radio2) = $GUI_UNCHECKED
                    Sleep(100)
                    ToolTip("Please Select ON/OFF State")
                    WinActivate("Settings")
                WEnd
                If GUICtrlGetState($Radio1) = $GUI_CHECKED Then
                    $AOT = 1
                    $Transparency = GUICtrlRead($Slider)
                Else
                    $AOT = 0
                    $Transparency = GUICtrlRead($Slider)
                EndIf
                IniWrite("OTPT.ini", "AOT", "True", $AOT)
                IniWrite("OTPT.ini", "Transparency", "Value", $Transparency)
                ToolTip("")
                GUISetState(@SW_HIDE)
                ExitLoop
        EndSwitch
    WEnd
EndFunc   ;==>Options

Func About()
    MsgBox($MB_OK, "About", "OnTopPeekThrough" & @CRLF & @CRLF & _
            "Press CTRL+SPACE to toggle" & @CRLF & _
            "Or hold 3 seconds for Options" & @CRLF & @CRLF & _
            "By: XiaolinDraconis")
EndFunc   ;==>About

Func OnTop()
    If $Toggle = 0 Then
        $Toggle = 1
        Set()
    Else
        $Toggle = 0
        Unset()
    EndIf
EndFunc   ;==>OnTop

Func Set()
    $WinTitle = WinGetTitle("[active]")
    WinSetOnTop($WinTitle, "", 1)
    WinSetTrans($WinTitle, "", $Transparency)
EndFunc   ;==>Set

Func Unset()
    $WinTitle = WinGetTitle("[active]")
    WinSetOnTop($WinTitle, "", 0)
    WinSetTrans($WinTitle, "", 255)
EndFunc   ;==>Unset

Func ExitScript()
    Exit
EndFunc   ;==>ExitScript

Share this post


Link to post
Share on other sites



Managed to fix the slider. Now working on radio buttons.

Share this post


Link to post
Share on other sites

apparently i didnt entirely fix it.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

apparently i didnt entirely fix it.

Try: 

If $AOT = 1 Then
        GUICtrlSetState($Radio1, $GUI_CHECKED)
    Else
        GUICtrlSetState($Radio1, $GUI_UNCHECKED)
    EndIf

Edit: A more elegant way to handle having a Tray menu and a GUI would be to have a single While loop where you listen for messages from Tray and from the GUI and handle it that way:

P.S. I fixed the issues you were having with the ini not updating and also added a label to the Transparency slider to show the selected number.

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <SliderConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>

Opt("TrayMenuMode", 3)
HotKeySet("^{SPACE}", "TapTimer")

Global $inifile = @ScriptDir & "\OTPT.ini", $transparency = 204, $AOT = 1, $Toggle = 0

If FileExists($inifile) Then
    $AOT = IniRead($inifile, "AOT", "True", "1")
    $transparency = IniRead($inifile, "Transparency", "Value", "204")
Else
    IniWrite($inifile, "AOT", "True", $AOT & @CRLF)
    IniWrite($inifile, "Transparency", "Value", $transparency & @CRLF & @CRLF & "Max Transparency Value = 255")
EndIf

#Region ### START $optionsGUI ###
$optionsGUI = GUICreate("Options", 365, 200, @DesktopWidth/2 - 365/2, @DesktopHeight/2 - 200/2)
$RadioON = GUICtrlCreateRadio("ON", 128, 40, 49, 17)
If $AOT = 1 Then GUICtrlSetState(-1, $GUI_CHECKED)
$RadioOFF = GUICtrlCreateRadio("OFF", 184, 40, 49, 17)
If $AOT = 0 Then GUICtrlSetState(-1, $GUI_CHECKED)
GUICtrlCreateLabel("Always on top:", 116, 8, 120, 24)
GUICtrlSetFont(-1, 12, 800, 0)
GUICtrlCreateLabel("Transparency:", 96, 74, 117, 24)
GUICtrlSetFont(-1, 12, 800, 0)
$tlabel = GUICtrlCreateLabel($transparency, 216, 74, 117, 24)
GUICtrlSetFont(-1, 12, 800, 0)
$tSlider = GUICtrlCreateSlider(24, 112, 318, 45)
GUICtrlSetLimit(-1, 255, 0)
GUICtrlSetData(-1, $transparency)
$optionsBtn_okay = GUICtrlCreateButton("OK", 136, 160, 75, 25)
#EndRegion ### END $optionsGUI ###

$options = TrayCreateItem("Settings")
$about = TrayCreateItem("About")
TrayCreateItem("") ; Create a separator line.
$exit = TrayCreateItem("Exit")

While 1

    Local $tMsg = TrayGetMsg()
    Switch $tMsg
        Case $options
            GUISetState(@SW_SHOW, $optionsGUI)
        Case $about
            MsgBox(0, "About", "OnTopPeekThrough" & @CRLF & @CRLF & _
                    "Press CTRL+SPACE to toggle" & @CRLF & _
                    "Or hold 3 seconds for Options" & @CRLF &  @CRLF & _
                    "By: XiaolinDraconis")
        Case $exit
            Exit
    EndSwitch

    Local $gMsg = GUIGetMsg()
    Switch $gMsg
        Case $optionsBtn_okay
            If GUICtrlRead($RadioON) = $GUI_CHECKED Then
                IniWrite($inifile, "AOT", "True", 1)
            ElseIf GUICtrlRead($RadioOFF) = $GUI_CHECKED Then
                IniWrite($inifile, "AOT", "True", 0)
            EndIf
            IniWrite($inifile, "Transparency", "Value", GUICtrlRead($tlabel))
            GUISetState(@SW_HIDE, $optionsGUI)
        Case $tSlider
            $val = GUICtrlRead($tSlider)
            GUICtrlSetData($tlabel, $val)
        Case $GUI_EVENT_CLOSE
            GUISetState(@SW_HIDE, $optionsGUI)
    EndSwitch

WEnd

Func TapTimer()
    HotKeySet("^{SPACE}")
    $TapTime = 0
    While _IsPressed("20")
        Sleep(1000)
        $TapTime += 1
    WEnd
    If $TapTime < 3 Then
        OnTop()
    Else
        GUISetState(@SW_SHOW, $optionsGUI)
    EndIf
    HotKeySet("^{SPACE}", "TapTimer")
EndFunc   ;==>TapTimer

Func OnTop()
    If $Toggle = 0 Then
        $Toggle = 1
        Set()
    Else
        $Toggle = 0
        Unset()
    EndIf
EndFunc   ;==>OnTop

Func Set()
    $WinTitle = WinGetTitle("[active]")
    WinSetOnTop($WinTitle, "", 1)
    WinSetTrans($WinTitle, "", $Transparency)
EndFunc   ;==>Set

Func Unset()
    $WinTitle = WinGetTitle("[active]")
    WinSetOnTop($WinTitle, "", 0)
    WinSetTrans($WinTitle, "", 255)
EndFunc   ;==>Unset

I'll be honest I am not 100% sure with HotKeys and the way you have gone about handling the way the Hot Keys work to set window transparency etc, but it seems to work, albeit somewhat choppy.

Edited by mpower

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Try: 

If $AOT = 1 Then
        GUICtrlSetState($Radio1, $GUI_CHECKED)
    Else
        GUICtrlSetState($Radio1, $GUI_UNCHECKED)
    EndIf

Edit: A more elegant way to handle having a Tray menu and a GUI would be to have a single While loop where you listen for messages from Tray and from the GUI and handle it that way:

P.S. I fixed the issues you were having with the ini not updating and also added a label to the Transparency slider to show the selected number.

I'll be honest I am not 100% sure with HotKeys and the way you have gone about handling the way the Hot Keys work to set window transparency etc, but it seems to work, albeit somewhat choppy.

 

Very nice, thank you. I know the Hotkey thing is sloppy, but I didn't see another way to go about having the delay for opening the options. Think I'll turn that into a double tap instead of holding it. 

The double tap method I'm gonna use is still choppy, but also I need to work out some more issues. It doesn't seem to be saving the transparency setting properly, also it is applying the transparency setting to the Settings GUI. Pretty sure some of that if not all is coming from the way I setup the Hotkey.

I'll work it out, then post what I did when I'm done.

Edited by XiaolinDraconis

Share this post


Link to post
Share on other sites

Ok so the transparency issue was due to a mix up in the variables, and the hotkey method I chose was with If Then statements and that just didn't work well so I went with a Switch Case.

And TADA! Thanks again, oh and if you notice the hotkey has a variable now, that's for future adjustments, going to make it so the key can be changed.

Near Perfection

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <SliderConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>

Opt("TrayMenuMode", 3)

Global $inifile = @ScriptDir & "\OTPT.ini", $val = IniRead($inifile,"Transparency","Value","204"), $transparency = 204, $AOT = 1, $Toggle = 0, $TapCount = 0, $Hotkey = "^{SPACE}"

HotKeySet($Hotkey, "TapTimer")

If FileExists($inifile) Then
    $AOT = IniRead($inifile, "AOT", "True", "1")
    $transparency = IniRead($inifile, "Transparency", "Value", "204")
Else
    IniWrite($inifile, "AOT", "True", $AOT & @CRLF)
    IniWrite($inifile, "Transparency", "Value", $transparency & @CRLF & @CRLF & "Max Transparency Value = 255")
EndIf

$optionsGUI = GUICreate("Options", 365, 200, @DesktopWidth / 2 - 365 / 2, @DesktopHeight / 2 - 200 / 2)
$RadioON = GUICtrlCreateRadio("ON", 128, 40, 49, 17)
If $AOT = 1 Then GUICtrlSetState(-1, $GUI_CHECKED)
$RadioOFF = GUICtrlCreateRadio("OFF", 184, 40, 49, 17)
If $AOT = 0 Then GUICtrlSetState(-1, $GUI_CHECKED)
GUICtrlCreateLabel("Always on top:", 116, 8, 120, 24)
GUICtrlSetFont(-1, 12, 800, 0)
GUICtrlCreateLabel("Transparency:", 96, 74, 117, 24)
GUICtrlSetFont(-1, 12, 800, 0)
$tlabel = GUICtrlCreateLabel($transparency, 216, 74, 117, 24)
GUICtrlSetFont(-1, 12, 800, 0)
$tSlider = GUICtrlCreateSlider(24, 112, 318, 45)
GUICtrlSetLimit(-1, 255, 0)
GUICtrlSetData(-1, $transparency)
$optionsBtn_okay = GUICtrlCreateButton("OK", 136, 160, 75, 25)

$options = TrayCreateItem("Settings")
$about = TrayCreateItem("About")
TrayCreateItem("") ; Create a separator line.
$exit = TrayCreateItem("Exit")

While 1
    Local $tMsg = TrayGetMsg()
    Switch $tMsg
        Case $options
            GUISetState(@SW_SHOW, $optionsGUI)
        Case $about
            MsgBox(0, "About", "OnTopPeekThrough" & @CRLF & @CRLF & _
                    "Press" & $Hotkey & "to toggle" & @CRLF & _
                    "Or double tap for Options" & @CRLF & @CRLF & _
                    "By: AutoIt V3")
        Case $exit
            Exit
    EndSwitch

    Local $gMsg = GUIGetMsg()
    Switch $gMsg
        Case $optionsBtn_okay
            If GUICtrlRead($RadioON) = $GUI_CHECKED Then
                IniWrite($inifile, "AOT", "True", 1)
            ElseIf GUICtrlRead($RadioOFF) = $GUI_CHECKED Then
                IniWrite($inifile, "AOT", "True", 0)
            EndIf
            IniWrite($inifile, "Transparency", "Value", GUICtrlRead($tlabel))
            GUISetState(@SW_HIDE, $optionsGUI)
        Case $tSlider
            $val = GUICtrlRead($tSlider)
            GUICtrlSetData($tlabel, $val)
            WinSetTrans($optionsGUI,"",$val)
            Sleep(666)
            WinSetTrans($optionsGUI,"",255)
        Case $GUI_EVENT_CLOSE
            GUISetState(@SW_HIDE, $optionsGUI)
    EndSwitch
WEnd

Func TapTimer()
    $TapCount += 1
    Sleep(500)
    Switch $TapCount
    Case 2
        GUISetState(@SW_SHOW, $optionsGUI)
        WinSetOnTop($optionsGUI, "", 1)
        WinSetTrans($optionsGUI, "", 255)
        $TapCount = 0
    Case 1
        OnTop()
        $TapCount = 0
    Case Else
        GUISetState(@SW_SHOW, $optionsGUI)
        WinSetOnTop($optionsGUI, "", 1)
        WinSetTrans($optionsGUI, "", 255)
        $TapCount = 0
    EndSwitch
EndFunc   ;==>TapTimer

Func OnTop()
    If $Toggle = 0 Then
        $Toggle = 1
        Set()
    Else
        $Toggle = 0
        Unset()
    EndIf
EndFunc   ;==>OnTop

Func Set()
    $WinTitle = WinGetTitle("[active]")
    WinSetOnTop($WinTitle, "", 1)
    WinSetTrans($WinTitle, "", $val)
EndFunc   ;==>Set

Func Unset()
    $WinTitle = WinGetTitle("[active]")
    WinSetOnTop($WinTitle, "", 0)
    WinSetTrans($WinTitle, "", 255)
EndFunc   ;==>Unset

Share this post


Link to post
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
Sign in to follow this  
Followers 0

  • Similar Content

    • mpower
      By mpower
      Hi guys,
      So I am facing an issue with my Listview control flickering like crazy when using the Modern GUI UDF.
      I understand that the reson is because Listviews do not play nice with the $WS_EX_COMPOSITED extended style which is necessary to prevent the rest of the GUI components flickering on resizing.
      I am looking for suggestions on how I can overcome the flickering issue without having to remove the Listview header (as I need the header to allow column resizing and sorting).
      The reproducer is here and the lightly modified Modern GUI UDF is attached as a zip (I added $WS_CLIPCHILDREN and $WS_EX_COMPOSITED to the _Metro_CreateGUI() function in order to stop flickering of other controls like buttons/labels/toggles etc).
      ;!Highly recommended for improved overall performance and responsiveness of the GUI effects etc.! (after compiling): #AutoIt3Wrapper_Run_Au3Stripper=y #Au3Stripper_Parameters=/so /rm /pe ;Required if you want High DPI scaling enabled. (Also requries _Metro_EnableHighDPIScaling()) #AutoIt3Wrapper_Res_HiDpi=y #include-once #NoTrayIcon #include "MetroGUI-UDF\MetroGUI_UDF.au3" #include <GuiListView.au3> $gui = _Metro_CreateGUI("example", 800, 600, -1, -1, True) ;Add/create control buttons to the GUI $Control_Buttons = _Metro_AddControlButtons(True, True, True, True, False) ;CloseBtn = True, MaximizeBtn = True, MinimizeBtn = True, FullscreenBtn = True, MenuBtn = True ;Set variables for the handles of the GUI-Control buttons. (Above function always returns an array this size and in this order, no matter which buttons are selected. $GUI_CLOSE_BUTTON = $Control_Buttons[0] $GUI_MAXIMIZE_BUTTON = $Control_Buttons[1] $GUI_RESTORE_BUTTON = $Control_Buttons[2] $GUI_MINIMIZE_BUTTON = $Control_Buttons[3] $GUI_FULLSCREEN_BUTTON = $Control_Buttons[4] $GUI_FSRestore_BUTTON = $Control_Buttons[5] ;====================================================================================================================================================================== $Button1 = _Metro_CreateButtonEx("Add new item(s)", 20, 20, 130, 50) $Button2 = _Metro_CreateButtonEx("Edit item(s)", 170, 20, 130, 50) $ListView2 = GUICtrlCreateListView("", 0, 86, 800, 400, BitOR($LVS_REPORT, $LVS_SHOWSELALWAYS), $WS_EX_CLIENTEDGE) _GUICtrlListView_SetExtendedListViewStyle($ListView2, BitOR($LVS_EX_DOUBLEBUFFER, $LVS_EX_GRIDLINES, $LVS_EX_SUBITEMIMAGES, $LVS_EX_FLATSB)) For $i = 0 to 8 _GUICtrlListView_AddColumn($ListView2, "col " &$i) Next _GUICtrlListView_SetBkColor($ListView2, 0xF3F3F3) _GUICtrlListView_SetTextBkColor($ListView2, 0xF3F3F3) ;Set resizing options for the controls so they don't change in size or position. This can be customized to match your gui perfectly for resizing. See AutoIt Help file. GUICtrlSetResizing($Button1, 768 + 2 + 32) GUICtrlSetResizing($Button2, 768 + 2 + 32) GUICtrlSetResizing($ListView2, 102) GUISetState(@SW_SHOW) While 1 _Metro_HoverCheck_Loop($gui) ;This hover check has to be added to the main While loop, otherwise the hover effects won't work. $nMsg = GUIGetMsg() Switch $nMsg ;=========================================Control-Buttons=========================================== Case $GUI_EVENT_CLOSE, $GUI_CLOSE_BUTTON _Metro_GUIDelete($gui) ;Delete GUI/release resources, make sure you use this when working with multiple GUIs! Exit Case $GUI_MAXIMIZE_BUTTON GUISetState(@SW_MAXIMIZE) Case $GUI_RESTORE_BUTTON GUISetState(@SW_RESTORE) Case $GUI_MINIMIZE_BUTTON GUISetState(@SW_MINIMIZE) Case $GUI_FULLSCREEN_BUTTON, $GUI_FSRestore_BUTTON _Metro_FullscreenToggle($gui, $Control_Buttons) EndSwitch WEnd Any suggestions would be greately appreciated.
      Cheers!
      MetroGUI-UDF.zip
    • rootx
      By rootx
      someone made a modern Gui like windows 10 style. thx
    • FrancescoDiMuro
      By FrancescoDiMuro
      Good morning community!
      I was working on a script which read the content of a .ini file to retrieve the file that has to open, and, based on the value of a second key stored in the .ini file, set the window on top, minimized or maximized...
      I did something like this, but seems to not work properly...
      Could anyone please tell me what I'm doing wrong?
      Thank you  
       
      #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Outfile_x64=prova.exe #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <MsgBoxConstants.au3> #include <AutoItConstants.au3> ;#include <WinAPIEx.au3> #include <Array.au3> Local $sFileConfigurazione = @ScriptDir & "\configurazione_exe.ini" If(FileExists($sFileConfigurazione)) Then Local $aSezioneIni = IniReadSection($sFileConfigurazione, "CONFIGURAZIONE_EXE") If @error Then MsgBox($MB_ICONERROR, "Errore!", "Errore durante l'apertura del file: " & @CRLF & $sFileConfigurazione & @CRLF & "Errore: " & @error) Else ; Lancio dell'applicativo indicato nel file di configurazione Local $iPID = ShellExecute($aSezioneIni[1][1]) Local $hWnd If($iPID <> 0) Then Local $aWinList = WinList() For $i = 1 To $aWinList[0][0] If(WinGetProcess($aWinList[$i][1] = $iPID)) Then $hWnd = $aWinList[$i][1] EndIf Next Switch($aSezioneIni[2][1]) Case $aSezioneIni[2][1] = "MIN" ToolTip("MIN", 0, 0) WinSetState($hWnd, WinGetTitle($hWnd), @SW_MINIMIZE) Case $aSezioneIni[2][1] = "MAX" ToolTip("MAX", 0, 0) WinSetState($hWnd, WinGetTitle($hWnd), @SW_MAXIMIZE) Case $aSezioneIni[2][1] = "TOP" ToolTip("TOP", 0, 0) WinSetOnTop($hWnd, WinGetTitle($hWnd), $WINDOWS_ONTOP) EndSwitch EndIf EndIf EndIf And the .ini file is like this:
       
      [CONFIGURAZIONE_EXE] PercorsoExe=Here goes the path and the .exe to execute ModalitaAperturaExe=Here goes one of the value below /* TOP Shows the windows on top */ /* MIN Shows the window minimized */ /* MAX Shows the window maximized */  
    • antonioj84
      By antonioj84
      #include <GUIConstantsEx.au3> #include "GUIExtender.au3" $hGUI = GUICreate("Move Example", 250, 230) GUICtrlCreateGroup(" Choose Orientation ", 10, 10, 230, 80) $cRadio_Horz = GUICtrlCreateRadio(" Horizontal ", 20, 30, 100, 20) GUICtrlSetState(-1, $GUI_CHECKED) $cRadio_Vert = GUICtrlCreateRadio(" Vertical ", 20, 60, 100, 20) GUICtrlCreateGroup(" Choose Move Style ", 10, 100, 230, 110) $cRadio_0 = GUICtrlCreateRadio(" Fix Left ", 20, 120, 100, 20) $cRadio_1 = GUICtrlCreateRadio(" Fix Centre ", 20, 150, 100, 20) $cRadio_2 = GUICtrlCreateRadio(" Fix Right ", 20, 180, 100, 20) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $cRadio_Horz GUICtrlSetData($cRadio_0, " Fix Left ") GUICtrlSetState($cRadio_0, $GUI_UNCHECKED) GUICtrlSetState($cRadio_1, $GUI_UNCHECKED) GUICtrlSetData($cRadio_2, " Fix Right ") GUICtrlSetState($cRadio_2, $GUI_UNCHECKED) Case $cRadio_Vert GUICtrlSetData($cRadio_0, " Fix Top ") GUICtrlSetState($cRadio_0, $GUI_UNCHECKED) GUICtrlSetState($cRadio_1, $GUI_UNCHECKED) GUICtrlSetData($cRadio_2, " Fix Bottom ") GUICtrlSetState($cRadio_2, $GUI_UNCHECKED) Case $cRadio_0 _Create_GUI(0) Case $cRadio_1 _Create_GUI(1) Case $cRadio_2 _Create_GUI(2) EndSwitch WEnd Func _Create_GUI($iMove) Local $sTitle Switch $iMove Case 0 If GUICtrlRead($cRadio_Horz) = 1 Then $sTitle = "Fixed Left" Else $sTitle = "Fixed Top" EndIf Case 1 $sTitle = "Fixed Centre" Case 2 If GUICtrlRead($cRadio_Horz) = 1 Then $sTitle = "Fixed Right" Else $sTitle = "Fixed Bottom" EndIf EndSwitch GUISetState(@SW_HIDE, $hGUI) $hGUI_Ex = GUICreate($sTitle, 500, 500) If GUICtrlRead($cRadio_Horz) = 1 Then _GUIExtender_Init($hGUI_Ex, 1, $iMove) _GUIExtender_Section_Create($hGUI_Ex, 0, 250) _GUIExtender_Section_Activate($hGUI_Ex, 2, "", "", 220, 10, 20, 20) _GUIExtender_Section_Create($hGUI_Ex, 250, 250) GUICtrlCreateLabel("", 250, 0, 250, 500) GUICtrlSetBkColor(-1, 0xFFCCCC) _GUIExtender_Section_Create($hGUI_Ex, -99) Else _GUIExtender_Init($hGUI_Ex, 0, $iMove) _GUIExtender_Section_Create($hGUI_Ex, 250, 0) _GUIExtender_Section_Activate($hGUI_Ex, 2, "", "", 470, 220, 20, 20) _GUIExtender_Section_Create($hGUI_Ex, 250, 250) GUICtrlCreateLabel("", 0, 250, 500, 250) GUICtrlSetBkColor(-1, 0xFFCCCC) _GUIExtender_Section_Create($hGUI_Ex, -99) EndIf _GUIExtender_Section_Action($hGUI_Ex, 2, False) GUISetState() While 1 $aMsg = GUIGetMsg(1) Switch $aMsg[0] Case $GUI_EVENT_CLOSE GUISetState(@SW_SHOW, $hGUI) GUIDelete($hGUI_Ex) _GUIExtender_Clear($hGUI_Ex) ExitLoop EndSwitch _GUIExtender_EventMonitor($aMsg[1], $aMsg[0]) ; Check for click on Action control WEnd EndFunc I am trying to implement 2 side window toggle hide and show with 2 different menu.  can someone give me some direction  thanks