Jump to content
BBs19

MetroGUI UDF v5.1 - Windows 10 style buttons, toggles, radios, menu etc.

Recommended Posts

BBs19
On 21.2.2016 at 11:01 PM, legend said:

can you show an example of how to have multiple gui windows, so if you click a button,

it will create a new gui, and when you X it, then it removes the GUI again.

I tried that, but it will make the orginal gui stock, and not able to be moved

 

You can use this example. To call it, just use this:

_GUIDisable($Form1, 0, 30);For better visibility of the second GUI
_SecondGUI()
_GUIDisable($Form1)
Func _SecondGUI()
    $Form2 = _Metro_CreateGUI("Example 2", 500, 300, -1, -1, True, True)

    ;Set variables
    $GUI_HOVER_REG2 = $Form2[1]
    $GUI_CLOSE_BUTTON_GUI2 = $Form2[2]
    $Form2 = $Form2[0]
    GUISetState(@SW_SHOW)
    
    While 1
        _Metro_HoverCheck_Loop($GUI_HOVER_REG2, $Form2);Add hover check in loop
        $nMsg = GUIGetMsg()
        Switch $nMsg
            Case $GUI_EVENT_CLOSE, $GUI_CLOSE_BUTTON_GUI2
                _Metro_GUIDelete($GUI_HOVER_REG2, $Form2)
                _GUI_DragAndResizeUpdate($Form1);Update the first GUI to properly support drag/resize again. (Only needed if you created 2 guis with control buttons(close,minimize,maximize))
                Return 0
        EndSwitch
    WEnd
    
EndFunc   ;==>_SecondGUI

 

On 1.3.2016 at 3:33 PM, lampel said:

how can i add a text edit control (GUICtrlCreateEdit) ???

 

thanks lampel

There is no function for a metro style edit. But you can use "0" as ex-style parameter to make it look modern/flat:

$Edit1 = GUICtrlCreateEdit("", 15, 285, 430, 213, BitOR($ES_AUTOVSCROLL, $ES_READONLY, $WS_VSCROLL), 0)

 

On 8.3.2016 at 10:29 PM, legend said:

Is it really not possible to change the state of a radiobox, but only a toggle and a checkbox,

why would there even be a radiobox in the udf, if you can't check if it's selected or not 0_o

http://prntscr.com/ad909v

I never needed that before. As given in the example, I usually execute what has to be done after the user selects a radio :)

But I will update the UDF today and add that check function + example.

 

21 hours ago, nuhan said:

hi,

i want to use  MetroGUI UDF v3  in my script. I need help to create a message box using  _Metro_MsgBox. but in metro udf MsgBox  contains only one button i need two button in my message box. And also i have to run some code if user click on each button in msgbox. Please help me.

 

As written via PM, this can be done with a custom gui or by simply copying the default metro msgbox function and modifying it. If I find some time, i will try to update the message box function to support the default button types that the normal MsgBox of Autoit also supports. 

  • Like 1

Share this post


Link to post
Share on other sites
nuhan
2 minutes ago, BBs19 said:

 

You can use this example. To call it, just use this:

_GUIDisable($Form1, 0, 30);For better visibility of the second GUI
_SecondGUI()
_GUIDisable($Form1)
Func _SecondGUI()
    $Form2 = _Metro_CreateGUI("Example 2", 500, 300, -1, -1, True, True)

    ;Set variables
    $GUI_HOVER_REG2 = $Form2[1]
    $GUI_CLOSE_BUTTON_GUI2 = $Form2[2]
    $Form2 = $Form2[0]
    GUISetState(@SW_SHOW)
    
    While 1
        _Metro_HoverCheck_Loop($GUI_HOVER_REG2, $Form2);Add hover check in loop
        $nMsg = GUIGetMsg()
        Switch $nMsg
            Case $GUI_EVENT_CLOSE, $GUI_CLOSE_BUTTON_GUI2
                _Metro_GUIDelete($GUI_HOVER_REG2, $Form2)
                _GUI_DragAndResizeUpdate($Form1);Update the first GUI to properly support drag/resize again. (Only needed if you created 2 guis with control buttons(close,minimize,maximize))
                Return 0
        EndSwitch
    WEnd
    
EndFunc   ;==>_SecondGUI

 

There is no function for a metro style edit. But you can use "0" as ex-style parameter to make it look modern/flat:

$Edit1 = GUICtrlCreateEdit("", 15, 285, 430, 213, BitOR($ES_AUTOVSCROLL, $ES_READONLY, $WS_VSCROLL), 0)

 

I never needed that before. As given in the example, I usually execute what has to be done after the user selects a radio :)

But I will update the UDF today and add that check function + example.

 

As written via PM, this can be done with a custom gui or by simply copying the default metro msgbox function and modifying it. If I find some time, i will try to update the message box function to support the default button types that the normal MsgBox of Autoit also supports. 

Great job, thank you!

Share this post


Link to post
Share on other sites
BBs19

Updated UDF to v3.5

  • Updated Metro Msgbox function to support different button combinations like the default MsgBox function in Autoit.(See Help file for the button combination flags)
  • Added function "_Metro_RadioIsChecked" due to request.
  • Changed default font to Arial because "Calibri Light" is not installed on all Windows 7 computers.
  • Updated example.
  • Like 2

Share this post


Link to post
Share on other sites
nuhan
On 5/6/2014 at 3:06 AM, BBs19 said:

Features:

  • Create modern looking borderless and resizable GUIs with control buttons (Close,Maximize/Restore,Minimize)
  • Many color schemes/themes included. See MetroThemes.au3 for more details.
  • 2 type of Windows 8/10 style buttons.
  • Metro style checkboxes, radios, toggles and progressbar.
  • All buttons, checkboxes etc. have hover effects!
  • Windows 10 style modern MsgBox.


Example(Image): 

1.png.26f122bd1cde2d6226fd0b0e22072181.p

Hover effect of the control buttons:

2.png.77d74cdc1b71db39a3050459e908cca9.p

Windows 10-Style MsgBox:

3.png.c97a5309bcec9e06fbce528a98dbb926.p

 

Example:

#NoTrayIcon
#include "MetroGUI_UDF.au3"


;=======================================================================Creating the GUI===============================================================================
;Set Theme
_SetTheme("DarkTeal") ;See MetroThemes.au3 for selectable themes or to add more

;Create resizable Metro GUI
$Form1 = _Metro_CreateGUI("Example", 500, 300, -1, -1, True, True); Returns an array, see below how to use it:

;Set a variable name for the Hover-Reg Array that contains all the needed data for the hover effects. You will be needing this for almost every action. Name it wisely.
$GUI_HOVER_REG = $Form1[1]

;Set variables for the handles of the GUI-Control buttons (Close/Maximize/Restore/Minimize)
$GUI_CLOSE_BUTTON = $Form1[2]
$GUI_MAXIMIZE_BUTTON = $Form1[3]
$GUI_RESTORE_BUTTON = $Form1[4]
$GUI_MINIMIZE_BUTTON = $Form1[5]

;Set GUI/Form handle from the _Metro_CreateGUI return array.
$Form1 = $Form1[0]
;======================================================================================================================================================================

;Create Metro Buttons
$Button1 = _Metro_CreateButton($GUI_HOVER_REG, "Button Style 1", 105, 250, 130, 40)
$Button2 = _Metro_CreateButtonEx($GUI_HOVER_REG, "Button Style 2", 255, 250, 130, 40)

;Create Checkbox
$Checkbox1 = _Metro_CreateCheckbox($GUI_HOVER_REG, "Checkbox 1", 30, 70, 125, 30)
_Metro_CheckboxCheck($GUI_HOVER_REG, $Checkbox1)

;Create 2 Radios that are assigned to Radio Group 1
$Radio1 = _Metro_CreateRadio($GUI_HOVER_REG, 1, "Radio 1", 180, 70, 100, 26)
$Radio2 = _Metro_CreateRadio($GUI_HOVER_REG, 1, "Radio 2", 180, 110, 100, 26)
_Metro_RadioCheck($GUI_HOVER_REG, 1, $Radio1)

;Create Toggle
$Toggle1 = _Metro_CreateToggle($GUI_HOVER_REG, "Toggle 1", 320, 70, 130, 22)

;Create Progressbar
$Progress1 = _Metro_CreateProgress(100, 180, 300, 26)

;Set resizing options for the controls
GUICtrlSetResizing($Button1, 768 + 8)
GUICtrlSetResizing($Button2, 768 + 8)
GUICtrlSetResizing($Checkbox1, 768 + 2 + 32)
GUICtrlSetResizing($Radio1, 768 + 2 + 32)
GUICtrlSetResizing($Radio2, 768 + 2 + 32)
GUICtrlSetResizing($Toggle1, 768 + 2 + 32)
GUICtrlSetResizing($Progress1[0], 768 + 2 + 32)


GUISetState(@SW_SHOW)


While 1
    _Metro_HoverCheck_Loop($GUI_HOVER_REG, $Form1);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_HOVER_REG, $Form1)
            Exit
        Case $GUI_MAXIMIZE_BUTTON
            GUISetState(@SW_MAXIMIZE)
        Case $GUI_RESTORE_BUTTON
            GUISetState(@SW_RESTORE)
        Case $GUI_MINIMIZE_BUTTON
            GUISetState(@SW_MINIMIZE)
            ;===================================================================================================
            
        Case $Button2
            _GUIDisable($Form1, 0, 30);For better visibility of the MsgBox on top of the first GUI.
            _Metro_MsgBox(0, "Metro MsgBox Example", "Button 2 clicked.", 400, 12, $Form1)
            _GUIDisable($Form1)
            
        Case $Button1
            _GUIDisable($Form1, 0, 30)
            _Metro_MsgBox(0, "Metro MsgBox Example", "Press ok to set progressbar.", 350, 13, $Form1)
            _GUIDisable($Form1)
            For $i = 0 To 85 Step +2
                Sleep(1)
                _Metro_SetProgress($Progress1, $i)
            Next
            _GUIDisable($Form1, 0, 30)
            Local $Select_YesNo = _Metro_MsgBox(4, "Metro MsgBox Example", "Select yes to create a second GUI.", 350, 13, $Form1)
            If $Select_YesNo = "Yes" Then _SecondGUI()
            _GUIDisable($Form1)
            
        Case $Toggle1
            If _Metro_ToggleIsChecked($GUI_HOVER_REG, $Toggle1) Then
                _Metro_ToggleUnCheck($GUI_HOVER_REG, $Toggle1)
                ConsoleWrite("Toggle unchecked!" & @CRLF)
            Else
                _Metro_ToggleCheck($GUI_HOVER_REG, $Toggle1)
                ConsoleWrite("Toggle checked!" & @CRLF)
            EndIf
            
        Case $Checkbox1
            If _Metro_CheckboxIsChecked($GUI_HOVER_REG, $Checkbox1) Then
                _Metro_CheckboxUnCheck($GUI_HOVER_REG, $Checkbox1)
                ConsoleWrite("Checkbox unchecked!" & @CRLF)
            Else
                _Metro_CheckboxCheck($GUI_HOVER_REG, $Checkbox1)
                ConsoleWrite("Checkbox checked!" & @CRLF)
            EndIf
            
        Case $Radio1
            _Metro_RadioCheck($GUI_HOVER_REG, 1, $Radio1)
            ConsoleWrite("Radio 1 selected!" & @CRLF)
            
        Case $Radio2
            _Metro_RadioCheck($GUI_HOVER_REG, 1, $Radio2)
            ConsoleWrite("Radio 2 selected = " & _Metro_RadioIsChecked($GUI_HOVER_REG, 1, $Radio2) & @CRLF)
    EndSwitch
WEnd



Func _SecondGUI()
    $Form2 = _Metro_CreateGUI("Example 2", 800, 600, -1, -1, True, True)

    ;Set variables for a second gui
    $GUI_HOVER_REG2 = $Form2[1]
    $GUI_CLOSE_BUTTON_GUI2 = $Form2[2]
    $Form2 = $Form2[0]
    GUISetState(@SW_SHOW)
    
    While 1
        _Metro_HoverCheck_Loop($GUI_HOVER_REG2, $Form2);Add hover check in loop
        $nMsg = GUIGetMsg()
        Switch $nMsg
            Case $GUI_EVENT_CLOSE, $GUI_CLOSE_BUTTON_GUI2
                _Metro_GUIDelete($GUI_HOVER_REG2, $Form2);Delete GUI/release resources
                _GUI_DragAndResizeUpdate($Form1);Update the first GUI to properly support drag/resize again. (Only needed if you created 2 guis with control buttons(close,minimize,maximize))
                Return 0
        EndSwitch
    WEnd
    
EndFunc   ;==>_SecondGUI

 

Credits: UEZ, for the function to create buttons with text using GDIPlus.

Changelog v3.5:

  • Updated Metro Msgbox function to support different button combinations like the default MsgBox function in Autoit.(See Help file for the button combination flags)
  • Added function "_Metro_RadioIsChecked" due to request.
  • Changed default font to Arial because "Calibri Light" is not installed on all Windows 7 computers.
  • Updated example.

 

Download UDF:

 

MetroGUI UDF v3.5.zip

hi  , when i try to use _Metro_MsgBox   error message shows - "warning: $MSGBOX_HOVER_REG: possibly used before declaration." where is the problem? Thanks in advance for your help.

Share this post


Link to post
Share on other sites
LFCavalcanti

Well, same problem as above...

I check the syntax, fine... compile fine... when I run the binary compiled, returns an error of a variable used before declaration on line 11674. I already checked most includes the UDF uses, none of the files return syntax problems. It's like a dead end... sadly.

Windows 10 Pro 64 Bits here, latest version of SciTE and compiling x86 of course.

UPDATE 1:
I used Exe2Aut to decompile my script and check said line:
 

_gdiplus_fontdispose($hfont)

Still, there's no variable being used without declaration...

UPDATE 2:

Seems the progress bar functions in this UDF are not compatible with updates made in the GDIPlus, like these functions in the MetroGUI UDF:

Local $ProgressBGPen = _GDIPlus_PenCreate($Progress[5], 2)

In the GDIPlus the function doesn't receive parameters as called:
 

Func _GDIPlus_PenCreate($iARGB = 0xFF000000, $nWidth = 1, $iUnit = 2)
    Local $aResult = DllCall($__g_hGDIPDll, "int", "GdipCreatePen1", "dword", $iARGB, "float", $nWidth, "int", $iUnit, "handle*", 0)
    If @error Then Return SetError(@error, @extended, 0)
    If $aResult[0] Then Return SetError(10, $aResult[0], 0)

    Return $aResult[4]
EndFunc

The strange part, is the example script runs just fine... I'll attach my test script if anyone is kind to point out where's my stupid error.

UPDATE 3:

Well, it worked after I removed the GUI creation from inside a function, why? I really don't know... now I can't make the label show up.

UPDATE 4:

It worked okay now. Declare the variable that will handle the MetroGUI object at the start of the script with a 0 if you want different functions to handle it.

I left all the updates if someone needs the "thought process" to solve the problem.

Edited by LFCavalcanti
Update

--

"There is a way out of every box, a solution to every puzzle; it's just a matter of finding it." - Picard, Jean-Luc

Share this post


Link to post
Share on other sites
BBs19

UDF V4 will be coming in the next 2 weeks :)

New features(finished already):

  • Usage of the UDF got much easier,  using/declaring a variable for GUI_HOVER_REG is no longer required and therefore it is not needed for all actions anymore.
  • Full support for high dpi screens / automated scaling of the gui and all metro controls for a sharp looking GUI with 4k screens
  • 2 new modern checkbox types
  • 2 new modern toggles
  • Control buttons with inactivity colors (to indicate that the window is inactive)
  • Hover effects now also work when the gui is inactive but visible.
  • Many bug fixes.

And some other things I planned like a Windows 10 style menu but didn't find time yet and also don't know if I can implement them.

 

Preview

 

Edited by BBs19

Share this post


Link to post
Share on other sites
LFCavalcanti

Hi!

I've used your UDF on a project I'm developing...

I made some changes for two things:

  1.  Create a GUI that can me moved but not resized.
  2.  Option to create only the Minimize and Close buttons and another with all Control Buttons(as default in the UDF).

* The updated source file is attached bellow.

 

 _Metro_CreateGUI

I've changed the parameters, removing the "$AllowResize" , adding "$TypeOption" and "$ControlButtons".

See the comments:

Spoiler

; #FUNCTION# ====================================================================================================================
; Name ..........: _Metro_CreateGUI
; Description ...: Creates a borderless Metro-Style GUI
; Syntax ........: _Metro_CreateGUI($Title, $Width, $Height[, $Left = -1[, $Top = -1[, $TypeOption = 0[,
;                  $ControlButtons = True[, $ParentGUI = ""]]]]])
; Parameters ....: $Title               - Title of the window.
;                  $Width               - Width
;                  $Height              - Height
;                  $Left                - [optional] Left position. Default is -1.
;                  $Top                 - [optional] Top position. Default is -1.
;
;                  $TypeOption        - [optional] Borderless window that allows drag, resize and also keeps the AeroSnap functions working. Default is 0.
;                                                    0 - Popup style, no resize, move or maximize
;                                                    1 - Move but no resize or maximize, but with AeroSnap
;                                                    2 - All features with AeroSnap
;                   [NOTE]: Can only be called for one GUI. If you create a second GUI with this option, you have to call _GUI_DragAndResizeUpdate($GUI) for your previous GUI after closing the second one.
;
;                  $ControlButtons      - [optional] Adds Close,Maximize/Restore and Minimize buttons to the GUI. Default is 0.
;                                                     0 - No Control Buttons
;                                                     1 - Minimize and Close Buttons
;                                                     2 - All control Buttons
;                    [NOTE]: Remember to only implement the apropriate array references for the Hover Loop and actions.
;
;                  $ParentGUI           - [optional] Parent GUI/Window, This makes sure, there are not multiple windows of your program in the taskbar.
; Return values .: Array[6]
;                   [0] = Handle to the created GUI.
;                   [1] = Array for GUI_HOVER_REG. This is very important. Without this you won't be having working hover effects. Name the variable wisely. For example $GUI_HOVER_REG.
;                   [2] = Handle for the $GUI_CLOSE_BUTTON (Only if created with $ControlButtons = True)
;                   [3] = Handle for the $GUI_MAXIMIZE_BUTTON (Only if created with $ControlButtons = True)
;                   [4] = Handle for the $GUI_RESTORE_BUTTON (Only if created with $ControlButtons = True)
;                   [5] = Handle for the $GUI_MINIMIZE_BUTTON (Only if created with $ControlButtons = True)
; Example .......: $Form1 = _Metro_CreateGUI("Example", 500, 300, -1, -1, True, True)
; ===============================================================================================================================

I've marked the code I've changed with the Regions:
## UPDATED RESIZE ##
## UPDATED CONTROL BUTTONS CALL ##

_Metro_CreateControlButtons

Also, for simple shortage of time, I change the function "_Metro_CreateControlButtons", now there's two functions, one called "_Metro_CreateControlButtonsAll", that creates all Control Buttons and another called "_Metro_CreateControlButtonsCloseMini" that creates only the Minimize and Close buttons.

I kept the same array references across all functions, so the same array position for the minimize button is used even if the maximize is not present.

MetroGUI_UDF.au3


--

"There is a way out of every box, a solution to every puzzle; it's just a matter of finding it." - Picard, Jean-Luc

Share this post


Link to post
Share on other sites
BBs19
On 4.5.2016 at 10:31 PM, LFCavalcanti said:

Hi!

I've used your UDF on a project I'm developing...

I made some changes for two things:

  1.  Create a GUI that can me moved but not resized.
  2.  Option to create only the Minimize and Close buttons and another with all Control Buttons(as default in the UDF).

* The updated source file is attached bellow.

 

 _Metro_CreateGUI

I've changed the parameters, removing the "$AllowResize" , adding "$TypeOption" and "$ControlButtons".

See the comments:

  Reveal hidden contents

; #FUNCTION# ====================================================================================================================
; Name ..........: _Metro_CreateGUI
; Description ...: Creates a borderless Metro-Style GUI
; Syntax ........: _Metro_CreateGUI($Title, $Width, $Height[, $Left = -1[, $Top = -1[, $TypeOption = 0[,
;                  $ControlButtons = True[, $ParentGUI = ""]]]]])
; Parameters ....: $Title               - Title of the window.
;                  $Width               - Width
;                  $Height              - Height
;                  $Left                - [optional] Left position. Default is -1.
;                  $Top                 - [optional] Top position. Default is -1.
;
;                  $TypeOption        - [optional] Borderless window that allows drag, resize and also keeps the AeroSnap functions working. Default is 0.
;                                                    0 - Popup style, no resize, move or maximize
;                                                    1 - Move but no resize or maximize, but with AeroSnap
;                                                    2 - All features with AeroSnap
;                   [NOTE]: Can only be called for one GUI. If you create a second GUI with this option, you have to call _GUI_DragAndResizeUpdate($GUI) for your previous GUI after closing the second one.
;
;                  $ControlButtons      - [optional] Adds Close,Maximize/Restore and Minimize buttons to the GUI. Default is 0.
;                                                     0 - No Control Buttons
;                                                     1 - Minimize and Close Buttons
;                                                     2 - All control Buttons
;                    [NOTE]: Remember to only implement the apropriate array references for the Hover Loop and actions.
;
;                  $ParentGUI           - [optional] Parent GUI/Window, This makes sure, there are not multiple windows of your program in the taskbar.
; Return values .: Array[6]
;                   [0] = Handle to the created GUI.
;                   [1] = Array for GUI_HOVER_REG. This is very important. Without this you won't be having working hover effects. Name the variable wisely. For example $GUI_HOVER_REG.
;                   [2] = Handle for the $GUI_CLOSE_BUTTON (Only if created with $ControlButtons = True)
;                   [3] = Handle for the $GUI_MAXIMIZE_BUTTON (Only if created with $ControlButtons = True)
;                   [4] = Handle for the $GUI_RESTORE_BUTTON (Only if created with $ControlButtons = True)
;                   [5] = Handle for the $GUI_MINIMIZE_BUTTON (Only if created with $ControlButtons = True)
; Example .......: $Form1 = _Metro_CreateGUI("Example", 500, 300, -1, -1, True, True)
; ===============================================================================================================================

I've marked the code I've changed with the Regions:
## UPDATED RESIZE ##
## UPDATED CONTROL BUTTONS CALL ##

_Metro_CreateControlButtons

Also, for simple shortage of time, I change the function "_Metro_CreateControlButtons", now there's two functions, one called "_Metro_CreateControlButtonsAll", that creates all Control Buttons and another called "_Metro_CreateControlButtonsCloseMini" that creates only the Minimize and Close buttons.

I kept the same array references across all functions, so the same array position for the minimize button is used even if the maximize is not present.

MetroGUI_UDF.au3

Hi, I have added an option to create the control buttons within an extra function in the upcoming UDF v4. It will automatically hide the control buttons that are not selected. You will be able to select even one button only. I will upload the new UDF after I have updated the comments in the UDF etc. I also need to check for bugs and fix them, some are really time consuming as they require lots of workarounds. I will need 2-3 days, i don't have much time at the moment.

 

Share this post


Link to post
Share on other sites
LFCavalcanti
On 13/05/2016 at 7:26 PM, BBs19 said:

Hi, I have added an option to create the control buttons within an extra function in the upcoming UDF v4. It will automatically hide the control buttons that are not selected. You will be able to select even one button only. I will upload the new UDF after I have updated the comments in the UDF etc. I also need to check for bugs and fix them, some are really time consuming as they require lots of workarounds. I will need 2-3 days, i don't have much time at the moment.

 

Great!

I did these modifications to suit my needs and shared them, maybe someone wants to use as I did, maybe not.

Time is a limited resource... haha

I'm using the UDF in this: https://github.com/LFCavalcanti/intermix

  • Like 1

--

"There is a way out of every box, a solution to every puzzle; it's just a matter of finding it." - Picard, Jean-Luc

Share this post


Link to post
Share on other sites
BBs19

Changelog v4:

Note: There are many changes in this version and it will not work with the syntax used in the old v3.5 UDF.

New features:

  • Full High-DPI support for 4k screens. - Automated scaling of the gui and all buttons, checkboxes etc. created with the metro UDF style. (See example and comments on how to use)
  • Using the UDF is now easier than ever, many things have been simplified! It is also no longer required to use a HOVER_REG variable when creating buttons etc.
  • 2 new modern checkbox styles
  • 2 new modern toggle styles
  • Fullscreen GUI toggle button like in Windows 10 apps
  • Easy to use menu that slides in from left (like menus in Android and Windows 10 calculator app)
  • Added button enable/disable functions to give a button a grayed out look when it is disabled.
  • Control buttons now indicate that the window is inactive by their color

Improved:

  • Creating control buttons is now seperated from the main gui create function, this allows selecting which control buttons to create and which to hide completley.
  • Hovering over control buttons while window is inactive now also works
  • Many other small changes that I don't remember anymore :D 
  • Many bug fixes.

 

Download: 

 

Edited by BBs19
  • Like 1

Share this post


Link to post
Share on other sites
legend

It's a great new update :)

 

What would be really cool would be a gui editor, like a koda metro edition :D

Share this post


Link to post
Share on other sites
BBs19
6 hours ago, legend said:

It's a great new update :)

 

What would be really cool would be a gui editor, like a koda metro edition :D

I might try to create a very very simple one in future, but nothing like Koda. I think that would be too time consuming now :D

You can also just use KODA to create your GUI with the correct size etc. and afterwards replace the default Autoit functions with my UDF. Functions for creating buttons etc. are now mostly the same as the default Autoit functions, if not easier in some cases :) It is mostly find&replace.

Edit: Updated the function overview section in the UDF file to show all user functions ordered in categories for easy usage. I previously forgot to add the new functions to that list. You can just redownload from the same page.

Edited by BBs19

Share this post


Link to post
Share on other sites
KarlosTHG

@BBs19 this is awesome!! but in the quick review that I made I found a bug, the steps to get it are:

  1. Open the example script
  2. Click the button style 1
  3. Yes to create the second GUI
  4. Minimize the second GUI
  5. It becomes a white bar in the bottom corner without any button (I have only test it on one computer (Win7 x64, last Autoit stable version)
  6. If I press Windows+DownArrow both GUIs minimize but after restore them now the GUI 1 have the original Windows Title Bar

Other than that I love the new features.

Thanks! 

Share this post


Link to post
Share on other sites
BBs19
22 hours ago, KarlosTHG said:

@BBs19 this is awesome!! but in the quick review that I made I found a bug, the steps to get it are:

  1. Open the example script
  2. Click the button style 1
  3. Yes to create the second GUI
  4. Minimize the second GUI
  5. It becomes a white bar in the bottom corner without any button (I have only test it on one computer (Win7 x64, last Autoit stable version)
  6. If I press Windows+DownArrow both GUIs minimize but after restore them now the GUI 1 have the original Windows Title Bar

Other than that I love the new features.

Thanks! 

Hi, thanks for the report. 

My fault, creating a second GUI with control buttons and with a parent of course doesn't make sense. By setting a parent, the second gui is prevented from appearing in the taskbar as an extra window, so if you minimize it, it will appear as a small window with minimize, maximize and close buttons in Windows, but drawing of these default buttons is prevented and therefore only a white field appears.

In summary, if you have 2 GUIs with control buttons like minimize and maximize, then no parent window should be set for the second gui so it can appear in the taskbar as a second window.

 

;Local $Form2 = _Metro_CreateGUI("Example 2", 800, 600, -1, -1, True,$Form1);OLD
Local $Form2 = _Metro_CreateGUI("Example 2", 800, 600, -1, -1, True);Fixed

I found other bugs while testing on Windows 7 with 2 monitors today at work.

  • Fullscreen toggle sends the GUI only to the first monitor and not the monitor that the window is on at the moment. -> Fixed now
  • Fullscreen toggle will cause the screen to not refresh properly on Windows 7. -> Fixed now
  • Windows 7 basic theme is not compabile with the GUI, the upper corners are rounded which makes the GUI look strange. -> Workaround implemented
  • Windows 7 basic and classic theme will cause the first GUIs non-client arena(close,minimize,maximize..) to redraw again when the second gui is minimized. -> Workaround implemented
  • The upper 2 lines of the fullscreen toggle (restore) button don't look straight on all dpi sizes. - I seriously hate GDI Plus and math, i suck at both :D will check this tomorrow.
  • Starting the script from within Scite Portable version will cause hover to not work anymore. - Not sure if this is a real bug or if I can fix it without removing the newly added feature "Hovering over control buttons while window is inactive now also works".

I will update the UDF later tomorrow after properly testing at work on a Windows 7 machine.

Edited by BBs19

Share this post


Link to post
Share on other sites
BBs19

Version 4.0.1 - Changelog:

Fixed bugs:

  • Fullscreen toggle sends the GUI only to the first monitor and not the monitor that the window is on at the moment.
  • Fullscreen toggle will cause the screen to not refresh properly on Windows 7. 
  • Windows 7 basic theme makes the GUI look strange with rounded corners on top.
  • Windows 7 basic and classic theme will cause the first GUIs non-client arena(controlbar) to show up when a second GUI is minimized.
  • Fullscreen toggle buttons arrow lines are not straight when using different DPI settings.
  • Starting the script from within Scite Portable version will cause hover to not work anymore.

 

Download:

 

 

Let me know if you find any other bugs :) 

  • Like 2

Share this post


Link to post
Share on other sites
UEZ

Very good progress on this project! :thumbsup:

 

 

  • Like 1

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites
pat4005

Oh, my! That is anxiously amazing! Just indeed what i've looked for (and tried to create something similar) so long. THANK YOU.

Share this post


Link to post
Share on other sites
Mannyfresh15

I'm using this UDF now and I think it's great. However, I would like to know if there is a way to set a timeout for the msgbox and also if there is a way to enable the toggle once a function is called or launched. Does anybody know???

 

Edited by Mannyfresh15

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

  • Similar Content

    • antonioj84
      By antonioj84
      Hi all to the forum guru and expert I am trying to  automate this. in the registry  I have the network profile name network 2 and network   I want to  change their  CATEGORY  to Private .  Can someone lead me in the right direction.
      Private is 1 and Public is 0
      #RequireAdmin Global $sHKLMRoot = @OSArch = "x64" ? "HKLM64" : "HKLM" RegWrite($sHKLMRoot &"\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\NewNetworks" ,'/v NetworkList /t REG_MULTI_SZ /d 00000000 /f') see  attached picture below
      Much appreaciate
       

    • PhoenixPRO
      By PhoenixPRO
      When I try to automate this install program I can not get any of the buttons to click with the "ControlClick" function or any mouse movement to move the mouse to the and click it.  My OS is Windows 10 64Bit.  I have tried both 32bit and 64bit installs of Autoit V3 to no avail.
      I could not even get the run command to start the program until I used the variation of the command below in the script.
      With the script below the install program starts but will not click the "Next" button no matter what I do.
      Any help will be greatly appreciated.
      Thanks in advance.
       
      #include <MsgBoxConstants.au3>
      Opt("MouseCoordMode", 0) ;1=absolute, 0=relative to active window, 2=client
      Local $Success
      Run(@ComSpec & " /c " & 'C:\PhoenixPro_Install\RDXUtil\RDX_Tools_setup.exe', "C:\PhoenixPro_Install\RDXUtil", @SW_HIDE )

      WinWait("RDX Tools 1.62 - InstallShield Wizard", "Welcome to the InstallShield Wizard for RDX Tools 1.62")
      WinActivate("RDX Tools 1.62 - InstallShield Wizard", "Welcome to the InstallShield Wizard for RDX Tools 1.62")
      ControlClick ("RDX Tools 1.62 - InstallShield Wizard", "Welcome to the InstallShield Wizard for RDX Tools 1.62", 1639, "left", 1) ;Next Button
    • TheWizEd
      By TheWizEd
      How do I work with 2D arrays.  I've tried this but get errors.
      Local $aTest[4][4] = [[1,2,3,4],[5,6,7,8],[9,10,11,12],[13,14,15,16]]
      ;$aTest[0][] = [10,11,12]  ; Error at []
      Local $sTest = ""
      For $i = 0 To UBound($aTest)-1
        Local $aExtract = _ArrayExtract($aTest,$i,$i)
        $sTest = $sTest & MyTest($aExtract)
      Next
      Func MyTest($aTemp)
        _ArrayDisplay($aTemp)
        ; Error at    v $aTemp
        Return String($aTemp[0]) & " - " & String($aTemp[1]) & " - " & String($aTemp[2]) & @CRLF
      EndFunc
       
       
    • AndyK70
      By AndyK70
      I'm trying to fill a ListView with all normal viewable windows to act with them.
      First I tried with WinList:
      Local $aWinList = WinList("[REGEXPTITLE:(?i)(.+)]") Local $aTmp, $iID ;~ _ArrayDisplay($aWinList) For $i = $aWinList[0][0] To 1 Step -1 ; going backwards not disturbing the index while cycling through and deleting some If StringStripWS( $aWinList[$i][0], 3) == "" Or _ Not BitAND(WinGetState($aWinList[$i][1]), $WIN_STATE_VISIBLE) Or _ BitAND(WinGetState($aWinList[$i][1]), $WIN_STATE_MINIMIZED ) Then _ArrayDelete($aWinList, $i) Else ; Window has a Title and is "visible" $aTmp = WinGetPos($aWinList[$i][1]) If $aTmp[0] < -1000 Or $aTmp[1] < -1000 Then ; Window is minimized or tray icon _ArrayDelete($aWinList, $i) EndIf EndIf Next $aWinList[0][0] = UBound($aWinList)-1 ; getting actual # of windows ; Each row is now [ID]=> [Title], [hWnd] But it keeps getting Windows which are definitely not there at least not visible:

      Those windows "Rechner", "Einstellungen", "Netflix", "Microsoft Store", ... are not there!?! 
      It should list only the first three windows, which are real.
      I even tried it with _WinAPI_ UDF:
      $hWnd = _WinAPI_GetForegroundWindow() ; Add items _GUICtrlListView_BeginUpdate($idListview) If $hWnd <> 0 Then $iI = 0 Do If _WinAPI_IsWindow($hWnd) And _WinAPI_IsWindowVisible Then _GUICtrlListView_AddItem($idListview, WinGetTitle($hWnd)) _GUICtrlListView_AddSubItem($idListview, $iI, $hWnd, 1) $iI += 1 $hWnd = _WinAPI_GetWindow($hWnd, $GW_HWNDNEXT) EndIf Until $hWnd = 0 EndIf But it is the same...
       
      How can i distinguish those invisible windows from normal ones?
      PS: I'm using Windows 10, maybe it is important to know?
    • davidacrozier
      By davidacrozier
      Hello all ~
      I am running an autoit script on Windows 10 inside VMware Workstation 12 Pro version 12.5.2.  Technically I am remoting into ESXi which has a Domain Controller (DC), WebServer, FilServer, Windows 10, etc.  Using the GUI (i.e. running explorer.exe) I am able to open several different folders successfully.  The desktop, documents, USB external all open without issue.  The network share opening gives me issues.  Whenever I attempt to open \\filserver\users\user\sharedfolder I get the documents folder instead.  I understand that the documents folder is the default for explorer.  I have also attempted to use the letter drive mapped to the network share (Z:) and receive the same result.  When I run this script on Windows 10 alone without  the VM or the ESXi I am able to open the network share without problems.  I have tried to use the net use command to designate a letter M: to the network share folder prior to running the script.  This did not work for me.  
      One additional avenue I think might work is to use the systreeview321 and _GUICtrlTreeView_FindItem to step through the tree looking for the network share.  Once found,  double click on it and see if that opens the shared network folder.  I can click inside the VM with my mouse on the network share and it opens just fine.  Not sure if running up against GUI issues, or permission issues, or what?
      Thanks in advance,
      Davida Crozier
      TestNetworkShare.au3
      This script is a subset of a much larger program, but it illustrates what I am dealing with.

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.