tobi2006 Posted December 14, 2009 Posted December 14, 2009 Hello AutoIt users, I need a function that retrieves the style from gui control. For gui there is a function (GUIGetStyle) But there's not something like: GUICtrlGetStyle Is there a function like that or did anyone a function like that...? Yours, Tobi
Moderators Melba23 Posted December 14, 2009 Moderators Posted December 14, 2009 tobi2006,Here you go: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ButtonConstants.au3> #include <StaticConstants.au3> $hGUI = GUICreate("Test", 500, 500) $hButton = GUICtrlCreateButton("Test", 10, 10, 80, 30, $BS_MULTILINE, $WS_EX_CLIENTEDGE) $hButton_Handle = GUICtrlGetHandle($hButton) $hLabel = GUICtrlCreateLabel("", 10, 150, 500, 300, $SS_CENTER) GUISetState() $oStyle = DllCall("user32.dll", "long", "GetWindowLong", "hwnd", $hButton_Handle, "int", -16) ; get existing Style $oExStyle = DllCall("user32.dll", "long", "GetWindowLong", "hwnd", $hButton_Handle, "int", -20) ; get existing ExStyle GUICtrlSetData($hLabel, "Style should read 0x2000: " & @TAB & @TAB & "0x" & Hex($oStyle[0], 4) & @CRLF & _ "ExStyle should read 0x00000200: " & @TAB & "0x" & Hex($oExStyle[0], 8)) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEndDo not forget to use the handle and not the ControlID of the control. M23 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
funkey Posted December 14, 2009 Posted December 14, 2009 You can also use the WinApi-UDF $oStyle = _WinAPI_GetWindowLong($hButton_Handle, $GWL_STYLE) $oExStyle = _WinAPI_GetWindowLong($hButton_Handle, $GWL_EXSTYLE) That's the same. Programming today is a race between software engineers striving tobuild bigger and better idiot-proof programs, and the Universetrying to produce bigger and better idiots.So far, the Universe is winning.
spudw2k Posted December 14, 2009 Posted December 14, 2009 You can also use the WinApi-UDF $oStyle = _WinAPI_GetWindowLong($hButton_Handle, $GWL_STYLE) $oExStyle = _WinAPI_GetWindowLong($hButton_Handle, $GWL_EXSTYLE) That's the same. That's along the lines I was thinking too, but I didn't get a chance to check if it supported ctrls. Good to know it does. Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX Builder Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retrieve SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF
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