Jump to content
BBs19

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

Recommended Posts

This should be included into KODA and any other skin generator.
I personally would love to see this incorporated into KODA with the theme options. 

To be honest, I hate wasting time reinventing the wheel. I just want to get down to coding functions and leave the form building to KODA. 

 

 


Kind Regards
Skeletor

"I need coffee to turn me back to a human"

Microsoft Office Splash Screen | Basic Notepad Program (Beginner) | Transparent Splash Screen

Share this post


Link to post
Share on other sites

I prefer WPF myself. writing the forms in XAML and hooking your code to the events. like the vb6 days, and they have designers for them in Visual Studio. If you want real WPF, then you need to not use autoit


My resources are limited. You must ask the right questions

 

Share this post


Link to post
Share on other sites
On ‎28‎.‎01‎.‎2018 at 11:41 AM, BBs19 said:

Hi, you can use it however you like in your project..You also don't need to set any link in your program.

Thanks, I found out  MetroGUI UDF very useful. I always mention in the readme file, the authors of interesting code that I use in my programs.:)

Share this post


Link to post
Share on other sites

Hi , BBs19

i'm using Win10x64 and your Example file (Example.au3).

when i click Maximize button, then i click FullScreen Button ,  then click restore Button more time, why GUI not back to Maximize 

(Sorry my english  :sweating: )

Share this post


Link to post
Share on other sites
On 11/4/2017 at 11:51 AM, BBs19 said:

 

The HiWord in wParam is different when disabling and clicking, you are not checking that in your script.

Try this:

Func _WM_COMMAND($hWnd, $msg, $wParam, $lParam)
    If   BitShift($wParam, 16) = 0 And BitAND($wParam, 0xFFFF) = $sStopButton Then
        $stop = True
        _CheckStop()
    EndIf
    Return $GUI_RUNDEFMSG
EndFunc   ;==>_WM_COMMAND

 

Hi again, as i said that works fine... until in the function _CheckStop() i try to create a MetroMsgBox. The original checkStop()

 function looks like this:

Func _MyCheckStop()
    If $stop Then
        $answer = MsgBox($MB_YESNO, "A confirmation is required", "Are you sure you want to finish the process?")
        _GUIDisable($Form1, 0, 30)
        If $answer=$IDYES Then
             _iMExit()
             Exit
        Else
            $stop = False
        EndIf
    EndIf
EndFunc

 When i added the Metro MsgBox:

Func _MyCheckStop()
    If $stop Then
        $answer =  _Metro_MsgBox(4, "A confirmation is required", "Are you sure you want to finish the process?", 350, 11, $Form1)
        If $answer=$IDYES Then
             _iMExit()
             Exit
        Else
            $stop = False
        EndIf
    EndIf
EndFunc

This is how the msgBox looks when it appears:

Capture.PNG

 

I guess it's something i'm doing in the _WM_COMMAND but can not figure out what...

Share this post


Link to post
Share on other sites
On 4.2.2018 at 2:24 PM, 123disconnect said:

Hi , BBs19

i'm using Win10x64 and your Example file (Example.au3).

when i click Maximize button, then i click FullScreen Button ,  then click restore Button more time, why GUI not back to Maximize 

(Sorry my english  :sweating: )

I tested it multiple times, can't reproduce it. Maybe you can test the version i posted on the previous page.

 

2 hours ago, lillo78 said:

Hi again, as i said that works fine... until in the function _CheckStop() i try to create a MetroMsgBox. The original checkStop()

 function looks like this:

Func _MyCheckStop()
    If $stop Then
        $answer = MsgBox($MB_YESNO, "A confirmation is required", "Are you sure you want to finish the process?")
        _GUIDisable($Form1, 0, 30)
        If $answer=$IDYES Then
             _iMExit()
             Exit
        Else
            $stop = False
        EndIf
    EndIf
EndFunc

 When i added the Metro MsgBox:

Func _MyCheckStop()
    If $stop Then
        $answer =  _Metro_MsgBox(4, "A confirmation is required", "Are you sure you want to finish the process?", 350, 11, $Form1)
        If $answer=$IDYES Then
             _iMExit()
             Exit
        Else
            $stop = False
        EndIf
    EndIf
EndFunc

This is how the msgBox looks when it appears:

Capture.PNG

 

I guess it's something i'm doing in the _WM_COMMAND but can not figure out what...

I am having the same problem right now :D I am using WM_NOTIFY but with the same result. It seems like spawning a GUI from registered messages causes a bug.

I remember having the same problem with my TV-Show-Manager when I was working on it but it somehow worked suddenly, I don't know what the problem was. I will let you know when I figure it out.

Share this post


Link to post
Share on other sites
1 hour ago, BBs19 said:

I am having the same problem right now :D I am using WM_NOTIFY but with the same result. It seems like spawning a GUI from registered messages causes a bug.

I remember having the same problem with my TV-Show-Manager when I was working on it but it somehow worked suddenly, I don't know what the problem was. I will let you know when I figure it out.

Nope, can't figure it out. The problem exsists without MetroGUI. Same problem when using _ArrayDisplay. Script just hangs up when you start GUIs from WM_Notify.

I remember giving up with TV-Show-Manager when I had this problem and it worked all by it self :D

I will need check out a few scripts of mine where it worked, maybe I am missing something. 

Example script to demonstrate the problem:

#include <GUIConstantsEx.au3>
#include <GUIListView.au3>
#include <WindowsConstants.au3>
#include <Array.au3>


$MainGUI = GUICreate("Alert", 940, 306, -1, -1, $WS_POPUP, -1)
GUICtrlCreateLabel("Alert", 400, 8, 99, 27)


$ListView1 = GUICtrlCreateListView("a|n|n|n|x", 2, 48, 936, 217)
GUICtrlCreateListViewItem("1|2|3|4|5", $ListView1)


GUISetState(@SW_SHOW, $MainGUI)

GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd


Func _RightClick($TicketID)
    Local $ButtonsArray[2] = ["btn1", "btn2"]
    _ArrayDisplay($ButtonsArray)
EndFunc   ;==>_RightClick

Func WM_NOTIFY($hwnd, $iMsg, $iwParam, $lParam)
    #forceref $hwnd, $iMsg, $iwParam
    Local $tNMHDR = DllStructCreate($tagNMLISTVIEW, $lParam)
    Local $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
    Local $iCode = DllStructGetData($tNMHDR, "Code")

    Switch $hWndFrom
        Case GUICtrlGetHandle($ListView1)
            Switch $iCode
                Case $NM_RCLICK
                    _RightClick(0)
            EndSwitch
    EndSwitch

    Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_NOTIFY

 

Share this post


Link to post
Share on other sites
20 hours ago, lillo78 said:

Hi again, as i said that works fine... until in the function _CheckStop() i try to create a MetroMsgBox. The original checkStop()

 function looks like this:

Func _MyCheckStop()
    If $stop Then
        $answer = MsgBox($MB_YESNO, "A confirmation is required", "Are you sure you want to finish the process?")
        _GUIDisable($Form1, 0, 30)
        If $answer=$IDYES Then
             _iMExit()
             Exit
        Else
            $stop = False
        EndIf
    EndIf
EndFunc

 When i added the Metro MsgBox:

Func _MyCheckStop()
    If $stop Then
        $answer =  _Metro_MsgBox(4, "A confirmation is required", "Are you sure you want to finish the process?", 350, 11, $Form1)
        If $answer=$IDYES Then
             _iMExit()
             Exit
        Else
            $stop = False
        EndIf
    EndIf
EndFunc

This is how the msgBox looks when it appears:

Capture.PNG

 

I guess it's something i'm doing in the _WM_COMMAND but can not figure out what...

Finally figured it out. I found two workarounds. First one is to use GUIRegisterMsg like it is suggested in the help file, which would be to prevent using any script pausing commands and return instantly in your WM_COMMAND/WM_NOTIFY. What you would do is basically set a variable to true and return and then check in your main loop if the variable is true and execute the desired function.

I find this solution not good tho for my case with a right-click menu, as checking in main while loop can cause some delay if you are already doing other stuff in it and also because you need to add a sleep in the while loop. 

So how to fix it to work like onevent mode? Register WM_NCACTIVATE or WM_NCPAINT message and it suddenly works for what fkn reason ever :mellow: 

 

GUIRegisterMsg($WM_NCACTIVATE, "_Workaround")

Func _Workaround($hwnd, $iMsg, $iwParam, $lParam)
    return $GUI_RUNDEFMSG
EndFunc

 

Share this post


Link to post
Share on other sites
On 2/14/2018 at 8:47 AM, BBs19 said:

Finally figured it out. I found two workarounds. First one is to use GUIRegisterMsg like it is suggested in the help file, which would be to prevent using any script pausing commands and return instantly in your WM_COMMAND/WM_NOTIFY. What you would do is basically set a variable to true and return and then check in your main loop if the variable is true and execute the desired function.

I find this solution not good tho for my case with a right-click menu, as checking in main while loop can cause some delay if you are already doing other stuff in it and also because you need to add a sleep in the while loop. 

So how to fix it to work like onevent mode? Register WM_NCACTIVATE or WM_NCPAINT message and it suddenly works for what fkn reason ever :mellow: 

 

GUIRegisterMsg($WM_NCACTIVATE, "_Workaround")

Func _Workaround($hwnd, $iMsg, $iwParam, $lParam)
    return $GUI_RUNDEFMSG
EndFunc

 

Coll, thank you so much. I'll try it out and let you know... 

Thanks!

Share this post


Link to post
Share on other sites
On ‎3‎/‎1‎/‎2018 at 7:02 AM, TheDeath said:

Nice Think BBs19!

 

Are you plan to integrating tab?

Long time lurker, first time poster just to answer this...because I had the same need earlier this week.

I mod'd the latest Metro UDF to include the tab code posted earlier in the thread.... It's dirty because I'm not as swift as some of the other folks here, but it works marginally well and themes correctly. I haven't torture tested it but I'll attach a moded Metro example UDF, it doesn't work so hot with the "Themes Demo", maybe someone else can sort that out.

I did have to include the old "GUICtrlOnHover.au3" to make the mash-up work, someone else can probably do better. It's attached below, feel free to use but BBs19 will probably spit on my butchery :)

 

MetroGUI_UDF_Tab.au3

GUICtrlOnHover.au3

Example.au3

Edited by Pheerless

Share this post


Link to post
Share on other sites

i tried to use tab, replace MetroGUI_UDF.au3 by MetroGUI_UDF_tab.au3 in exemple.au3 to use tab function, and obtain error :

"F:\Ancien_pc\script autoit\MetroGui\Tab\MetroGUI-UDF\MetroGUI_UDF_tab.au3" (3750) : ==> Variable must be of type "Object".:
If $Obj.ctrl == $Ctrl Then Return $____aTabBtnList[$Index]
If $Obj^ ERROR

autoit 3.3.14.3

Did i made mistake?

Modified 2018/03/09

This error disappear after installation of version 3.3.14.4.

Thanks for your works ;-)

 

 

Edited by kaz

Share this post


Link to post
Share on other sites
On 06/03/2018 at 9:42 PM, kaz said:

i tried to use tab, replace MetroGUI_UDF.au3 by MetroGUI_UDF_tab.au3 in exemple.au3 to use tab function, and obtain error :

"F:\Ancien_pc\script autoit\MetroGui\Tab\MetroGUI-UDF\MetroGUI_UDF_tab.au3" (3750) : ==> Variable must be of type "Object".:
If $Obj.ctrl == $Ctrl Then Return $____aTabBtnList[$Index]
If $Obj^ ERROR

autoit 3.3.14.3

Did i made mistake?

Modified 2018/03/09

This error disappear after installation of version 3.3.14.4.

Thanks for your works ;-)

 

 

just copy folder MetroUDF-5.1 into auto-it install path "\include" folder

test example.au3 next

Edited by Reekod

Share this post


Link to post
Share on other sites

Hi there 

really nice work, why don't you share the 5.2 version used in your TV shows APPS ? 

the _List_CreateGUI is a pure and wonderfull advance for Auto-it scripting

regards


 

Edited by Reekod

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

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By WilliamasKumeliukas
      Hi,
      I started this project alone in May 2020 as project in my spare time at work, I'm working for a IT compagny that's started opening their services to residential customers few months ago and now my position in the company kinda drifted in the doom and gloom world of repetitive tasks like: Reinstallation of Windows 10.
      The procedure is very repetitive and I started feeling like being a robot which is the main reason I started this project.
       
      ==============================FAQ==================================
      1. Q: Do you want this project to be accomplished with the usage of AutoIT ONLY or 3rd party tools / Scripts (BAT / CMD / VBS) ? A: No, if I cannot find a way using AutoIT to accomplish a task I will move to my Plan B which consist of automating an 3rd party tool to accomplish the affected task until a solution is found. 2. Q: What do I get from helping/collaborating in this project? A: I will personally take the responsability to mention you in the credits of this project. 3. Q: If I have more questions, can I ask? A: Certainly! feel free to ask any questions related to this project! 4. Q: What is the main goal of this project? A: Automating Windows 10 configuration without user interaction needed (as much as possible) ______________________________________________________________________________________________________________________________
      Current progression of the project (more might be added in future)
      « Blue = Info || Yellow = Unfinished/Untested || Purple = Could be better || Green = Done ||Red = Not Yet Started »
      *** Very early Stage ***
      Connect Network Attached Storage(NAS) (Tested & Working - AutoIT only)
      Install Adobe Reader DC, 7zip, Google Chrome (Tested & Working - using 3rd party tool)
      Change OEM Information (Tested & Working - contains both AutoIT version and CMD script)
      Disable ScreenSaver (Require testing AutoIT only)
      Change Computer Name (Require testing AutoIT only) 
      Change Default Browser (Work - using 3rd party tool)
      Change .pdf / .pdfxml from Edge to Adobe Reader DC (AutoIT only)
      Change Edge to Google Chrome as Default Browser (Tested & Working - using 3rd party tool)
      Windows Updates (Currently working on it - AutoIT only)
      Install Office 
      Activate Office (Tested on 2010 & Working - CMD Script)
      Pin to taskbar Excel, Outlook, Word, Chrome (Tested & Working - using 3rd party tool)
      GUI currently featuring the following options 
      - TreeView to check case of desired tasks
      -  Redirect ConsoleWrite with timestamp messages in richedit (errors shown in red text)
                 *** To Do ***
       - Read informations needed for tasks like: OEM, ComputerName, NAS user/password etc... from a file
       - ListView for Windows Updates
       - Probably more
       
      ***  If this project interest you, Reply here This will greatly help me to see if you'd like this project to become real  ***
      ______________________________________________________________________________________________________________________________
      2020.09.21 Update: Since this topic reached over 200+ views without a single interest shown by community, pm me and i'll share with you W10 Configurator script  
       
      Best Regards,
      ~WilliamasKumeliukas
    • By Danyfirex
      Hello!!!  
      In the past I had problems adding an application as a default for an extension in Windows 10. (It was easy in windows 7 using Registry) But since Windows 8 It requires to do some steps more. I wrote a tool (in other programming language) months ago for handling it. But now I just want to share an AutoIt version.
       
      Check on GitHub.
       
       
      Saludos
    • By Jgladden
      Dan - thanks for all that you do - this stuff is great. 
      Hoping you can assist with an issue we are having now that we have moved to Windows 10/Server 2016. The Chrome interactions were working flawlessly until moving over. Now my code fails when attempting to create the session. As you can see, our Chrome install is not in a standard location but I have validated the path to the binary. I have attached some detail below including system info, console output and the chrome log detail. I have tried several recommendations that have seen in various forums but none have made a difference
      Any assistance you can give would be greatly appreciated. 
      Thanks in advance, 
      chrome_Details.txt
    • By poddex
      Hello everyone.
      I always try to work with old Windows 10 versions as much as possible because I know mane compatibility issues with Windows 10 upgrading. 
      But I couldn't do anything else (I got drivers problem), and nothing couldn't help me besides upgrading, so I upgraded from 1807 to 1903.
      And...get another problem 😃
      I use AutoitX library in external project like this.
      ObjectAutoIt=New COMObject("AutoItX3.Control");
      ObjectAutoIt.AutoItSetOption("WinTextMatchMode",2);
              While ObjectAutoit.WinExists("",WindowHeader) Cycle 
                  ObjectAutoIt.WinClose("",WindowHeader);
              EndCycle;
      After upgrade I get that this line code 
      While ObjectAutoit.WinExists("",WindowHeader)
      become extremely low - ~ 20 seconds even if 10 windows open. But before upgrade it takes 0.5 s for a max.
      And every time that this code line passes through  - it takes ~20s, (20.115, for example), not less, not more. Something pauses it to work.
      How can I diagnose, what is that?
      I tried reinstall whole AutoIt, but no results.
      Thanks to all.
    • By Jahar
      Hi All,
      Please help me on how to fetch date/time of last windows 10 system restore point using autoit? Basically its about querying the last restore point.
×
×
  • Create New...