This topic is now closed to further replies.
As said in the title, I'm searching a way to disable all tabstops in a GUI. My GUI includes 15 buttons and 3 edit controls.
- is there a way to disable all tabstops at a time
- is there a way to list all controls of a GUI and then disable tabstops one by one
- or should I use the following line after each button creation:
_WinAPI_SetWindowLong(GUICtrlGetHandle(-1), $GWL_STYLE, BitAND(_WinAPI_GetWindowLong(GUICtrlGetHandle(-1), $GWL_STYLE), BitNOT($WS_TABSTOP))) Thanks in advance for your valuable help!
Edit: or maybe disable TAB key? I don't remember how to do!
Because of me wondering if I could access the key/value pair arrays with the numbers as indexes, I have found out that the zeroth element for some reason doesn't return anything.
Here's the example:
local $r $r["test1"]="hello" $r["test2"]="how are you" msgbox(64, $r, $r) ; prints the ["test2"] but not ["test1"]. Is this even supposed to be a thing?
BTW, I haven't seen Autoit get updated since 2015; is it abandened or something?
Any help/clarification appreciated.
I'm trying to automate the process of configuring the three McAfee settings seen in the image I've attached (Host IPS, Network IPS and Firewall). Clicking one of them toggles the setting and closes the menu. I want them all OFF. This script will be used on different computers so the settings might be have different initial setups.
This is my first time using AutoIt and I have very limited coding experience--mostly MATLAB. Please excuse any lack of knowledge or terminology.
So far my code is able to
1. Find the visible McAfee icon in the system tray.
2. Click the icon.
3. Send "Q" to open up the Quick Settings menu.
4. Toggle settings blindly using keystrokes.
The problem I'm having is I don't know how to "read" the status of the setting before toggling it. This means I might be switching it from Off to On by mistake,
when I should really just leave it alone.
I'm wondering a couple of things.
1. Is there an easy way to "read" the status of the setting? This would solve the problem. Part of the challenge with this overall assignment is that there doesn't
seem to be any sort of "control" built into these menus. In other words, the only thing that changes in Au3Info when you hover over different options is the
coordinates of the mouse--there aren't any unique control IDs or texts to my knowledge that differentiate between different settings or menus. I don't know how to search for text in a menu and get an index or anything like that. I've attached my code at the bottom and commented-out two ideas I had for reading the status and acting accordingly after "Send (Q)". Neither of which were fruitful.
2. Is there an alternative to the overall method I've chosen that is simpler and more robust? It seems like there must be an alternative path to these settings besides the system tray, but I don't know of any such paths. The final script is going to be used on a number of computers which may have the McAfee icon either hidden or visible in the system tray, but currently my script only works if it is visible. I haven't figured out how to access hidden icons with mouse clicks yet.
I should also mention that most of my code for step 1 (find the McAfee icon) comes from something I found online. I've stared at it for a while, and I think I know how it works, but I wouldn't have known those GUI commands existed and wouldn't have been able to write that bit of code on my own. I don't want you to overestimate my understanding of AutoIt. Sorry for the long post, just wanted to provide all the relevant info.
Any advice you can offer would be greatly appreciated! Thanks in advance.
#cs AutoIt McAfee disable #ce #Include <GuiToolBar.au3> #Include <GUIConstants.au3> Local $Array For $Element In $Array Global $hSysTray_Handle, $iSystray_ButtonNumber Global $sToolTipTitle = "McAfee status: OK" ; <<<<<<<<<<<<<<<< Enter some tooltip text for the icon you want here $iSystray_ButtonNumber = Get_Systray_Index($sToolTipTitle) If $iSystray_ButtonNumber = 0 Then MsgBox(16, "Error", "Icon not found in system tray") Exit Else Sleep(500) _GUICtrlToolbar_ClickButton($hSysTray_Handle, $iSystray_ButtonNumber, "right") EndIf Send( "Q" ) ;$DropDownHandle = Controlgethandle( "", "Host IPS - on", "") ;$text = ControlGetText( "", "Host IPS - on", "") ;If "Host IPS - on" = 1 Then ; Send( $Element ) ;EndIf Next Exit ;........ Func Get_Systray_Index($sToolTipTitle) ; Find systray handle $hSysTray_Handle = ControlGetHandle('[Class:Shell_TrayWnd]', '', '[Class:ToolbarWindow32;Instance:1]') If @error Then MsgBox(16, "Error", "System tray not found") Exit EndIf ; Get systray item count Local $iSystray_ButCount = _GUICtrlToolbar_ButtonCount($hSysTray_Handle) If $iSystray_ButCount = 0 Then MsgBox(16, "Error", "No items found in system tray") Exit EndIf ; Look for wanted tooltip For $iSystray_ButtonNumber = 0 To $iSystray_ButCount - 1 If StringInStr(_GUICtrlToolbar_GetButtonText($hSysTray_Handle, $iSystray_ButtonNumber), $sToolTipTitle) = 1 Then ExitLoop Next If $iSystray_ButtonNumber = $iSystray_ButCount Then Return 0 ; Not found Else Return $iSystray_ButtonNumber ; Found EndIf EndFunc
I remember a script where i had seen an user inverse state of a button ( $GUI_ENABLE (64) / $GUI_DISABLE (128) ) in one line only
I remember it use Bit operation but i cannot reproduce it, can someone help ?
In fact if the button is enable i want to disable it and if he is disable , want to enable it, something like that :
GuiCtrlSetState ( $button , BitOr ( GuiCtrlGetSate ( $button ) ) ; i know this is NOT working, for explanation only
Hi, i'm not a very educated guy when it comes to dll calls..
can someone help me do this:
DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", false) for only one control?