Hawkysoft Posted August 7, 2013 Share Posted August 7, 2013 Hey all, I'm pretty new to AutoIt, I came from autohotkey and decided to try this and see what's better... Now I've run into an issue while creating a gui with flatten buttons, googled it and found out the solution is DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($button1), "wstr", 0, "wstr", 0) But since I've like 15buttons and more coming is there a way to loop this, so I don't have to add multiple useless lines over and over? I've tried it with an array like this Local $ButtonList[15] = ["$Button1", "$Button2", "$Button3", "$Button4", "$Button5", "$Button6", "$Button7", "$Button8", "$Button9", "$Button10", "$Button11", "$Button12", "$Button13", "$Button14", "$Button15"] But whenever I tried to call one of the buttons it wouldn't call the actual button itself... I'm sure I'm doing something wrong however I don't know what... Is there anyone willing to help me out a little bit on this? Link to comment Share on other sites More sharing options...
Moderators Solution Melba23 Posted August 7, 2013 Moderators Solution Share Posted August 7, 2013 Hawkysoft,Welcome to the AutoIt forum. You can remove the theme from the entire GUI like this:#include <GUIConstantsEx.au3> #include <Constants.au3> Global $aButton[4] DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0) $hGUI = GUICreate("Test", 500, 500) For $i = 0 To 3 $aButton[$i] = GUICtrlCreateButton(" Button " & $i, 10, 10 + (50 * $i), 80, 30) Next GUISetState() While 1 $iMsg = GUIGetMsg() Switch $iMsg Case $GUI_EVENT_CLOSE Exit Case $aButton[0] To $aButton[3] MsgBox($MB_SYSTEMMODAL, "Pressed", "Button " & $iMsg - $aButton[0]) EndSwitch WEndOr you can remove the theme from each button as you create it like this:#include <GUIConstantsEx.au3> #include <Constants.au3> Global $aButton[4] $hGUI = GUICreate("Test", 500, 500) For $i = 0 To 3 $aButton[$i] = GUICtrlCreateButton(" Button " & $i, 10, 10 + (50 * $i), 80, 30) DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($aButton[$i]), "wstr", 0, "wstr", 0) Next GUISetState() While 1 $iMsg = GUIGetMsg() Switch $iMsg Case $GUI_EVENT_CLOSE Exit Case $aButton[0] To $aButton[3] MsgBox($MB_SYSTEMMODAL, "Pressed", "Button " & $iMsg - $aButton[0]) EndSwitch WEndYou choose. M23 mesale0077 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Hawkysoft Posted August 7, 2013 Author Share Posted August 7, 2013 Thank you so much! was looking already for a irc channel or something to get help with the basic stuff, although all the channels are dead really appreciate your time and effort! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 8, 2013 Moderators Share Posted August 8, 2013 Hawkysoft,Glad I could help. to get help with the basic stuffThe Help file should always be your first port of call - but do not hesitate to post even simple questions, we do not bite. Although do not be too surprised if you are redirected straight back to the Help file, but with a specific reference to a function that you missed when looking for yourself. And the forum search facility (at top-right) is not the best you have ever seen, but does throw up some good leads if you use it correctly. M23 Wombat 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now