Jump to content

Search the Community

Showing results for tags 'state'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 5 results

  1. I want to show or hide a edit control depending if a radio button is checked or not.The following Autoit code appears semantically ok but not working.Can anyone please help? thanks olmar While 1 $nMsg = GUIGetMsg() $isradioChk=GUICtrlRead($radio_AbsP);checked=1,not checked=4 Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $isradioChk If $isradioChk<==1 Then GUICtrlSetState($edit_AbsP,$GUI_SHOW) GUICtrlSetState($edit_RelP,$GUI_HIDE) Else GUICtrlSetState($edit_AbsP,$GUI_HIDE) GUICtrlSetState($edit_RelP,$GUI_SHOW) EndIf Case $usrPrefs EndSwitch WEnd
  2. Hi everyone, I'm trying to display a button once a checkbox is clicked in my main GUI and to hide said button when the said checkbox is unticked: #include <ButtonConstants.au3> #Include <Constants.au3> #include <Date.au3> #include <File.au3> #Include <FontConstants.au3> #include <GUIConstantsEx.au3> #include <GuiEdit.au3> #include <Misc.au3> #include <WindowsConstants.au3> #include <StringConstants.au3> Opt("GUIOnEventMode", 1) f_MainGui() While 1 Sleep (10) Wend Func f_MainGui() Global $g_MainGUI = GUICreate ("SEE Delete Temp Files", 400, 450) GUISetFont (8.5, 700, 0) GUISetBkColor ($Color_White) $g_Label1 = GUICtrlCreateLabel ("Select action(s):", 150, 96, 360, 17) $g_Label2 = GUICtrlCreateLabel ("Web Browsers:", 13, 125, 360, 17) Global $g_ChkBox1 = GUICtrlCreateCheckbox ("I.Explorer [ Cookies / Temp Internet Files / Tracking Data]", 16, 152, 360, 17) Global $g_ChkBox2 = GUICtrlCreateCheckbox ("Chrome", 16, 176, 120, 17) Global $g_ChkBox3 = GUICtrlCreateCheckbox ("Firefox", 16, 200, 120, 17) $g_Label3 = GUICtrlCreateLabel ("Windows Explorer:", 13, 231, 360, 17) Global $g_ChkBox4 = GUICtrlCreateCheckbox ("C:\Temp", 16, 255, 120, 17) Global $g_ChkBox5 = GUICtrlCreateCheckbox ("C:\Windows\Temp", 16, 279, 130, 17) Global $g_ChkBox6 = GUICtrlCreateCheckbox ("C:\Users\XXXXXX\Recent", 16, 303, 200, 17) Global $g_ChkBox7 = GUICtrlCreateCheckbox ("C:\Users\XXXXXX\Local Settings\Temp", 16, 327, 250, 17) Global $g_SelWB = GUICtrlCreateButton ("Select All Web Browsers", 16,360,150,25) GUICtrlSetOnEvent (-1, "f_SelectAllWB") Global $g_SelWinExpl = GUICtrlCreateButton (" Windows Explorer Only", 16,390,150,25) GUICtrlSetOnEvent (-1, "f_WinExplOnly") Global $g_SelAll = GUICtrlCreateButton ("All", 16, 420, 70, 25) GUICtrlSetOnEvent (-1, "f_SelAll") Global $g_SelAll = GUICtrlCreateButton ("None", 95, 420, 70, 25) GUICtrlSetOnEvent (-1, "f_SelNone") Global $g_SubmitAndClean = GUICtrlCreateButton ("Clean Temp Files", 264, 360, 120, 85) GUICtrlSetState ($g_SubmitAndClean, $GUI_HIDE) GUICtrlSetOnEvent (-1, "f_SumitAndClean") GUISetOnEvent ($GUI_EVENT_CLOSE, "_exit") GUISetState() EndFunc I tried everything ==> "Do...Until", "While...Wend", hotkeys etc... and the best I can have a a button that can't stop flicking. I work exclusively with Events and for sure, when going trough the non event method, Switch...Case...EndSwitch, it's working... I'm sure that this may be a beginner question but I think my mind stopped working after an all day coding on different projects Thanks in advance
  3. Like stated above, I have never really attempted to create tray icon menus simply due to the fact I find them annoying (if I want to minimize a program, I will click "minimize", but if I want to close it, I don't want it to minimize to task bar and require me to close it there), but thought I should try incorporating them into latest script to at least say that I can use them. However, I am running into a couple of snags/facts I would like to verify. 1) Since tray icons come with their own "GetMsg" function, I just want to verify that, while the continual paging of the tray menu item would still occur within some kind of loop, can the tray menu item events be declared outside and separate from the GUI events? eg. While 1 $tmsg = TrayGetMsg () $nMsg = GUIGetMsg(1) Switch $tmsg Case $TrayMenu Case $settings1 If TrayItemGetState ( $settings1 ) = 65 Then IniWrite ( $path & "\infostore.ini", "Tray Settings", "No Notifications", "$TRAY_CHECKED" ) ElseIf TrayItemGetState ( $settings1 ) = 68 Then IniWrite ( $path & "\infostore.ini", "Tray Settings", "No Notifications", "$TRAY_UNCHECKED" ) Else EndIf Case $settings2 If TrayItemGetState ( $settings2 ) = 65 Then IniWrite ( $path & "\infostore.ini", "Tray Settings", "On top", "$TRAY_CHECKED" ) GUISetStyle ( BitOR($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_SIZEBOX, $WS_THICKFRAME, $WS_TABSTOP), $WS_EX_TOPMOST, $Form1_1 ) GUISetStyle ( BitOR($GUI_SS_DEFAULT_GUI, $DS_SETFOREGROUND), $WS_EX_TOPMOST, $Form2 ) GUISetStyle ( -1, $WS_EX_TOPMOST, $Form3 ) GUISetStyle ( BitOR($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_SIZEBOX, $WS_THICKFRAME, $WS_TABSTOP), BitOR($WS_EX_OVERLAPPEDWINDOW, $WS_EX_WINDOWEDGE, $WS_EX_TOPMOST), $Form3_1 ) GUISetStyle ( -1, $WS_EX_TOPMOST, $Form4 ) GUISetStyle ( -1, $WS_EX_TOPMOST, $Form5 ) ElseIf TrayItemGetState ( $settings2 ) = 68 Then IniWrite ( $path & "\infostore.ini", "Tray Settings", "On top", "$TRAY_UNCHECKED" ) GUISetStyle ( BitOR($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_SIZEBOX, $WS_THICKFRAME, $WS_TABSTOP), 0, $Form1_1 ) GUISetStyle ( $GUI_SS_DEFAULT_GUI, 0, $Form2 ) GUISetStyle ( $GUI_SS_DEFAULT_GUI, 0, $Form3 ) GUISetStyle ( BitOR($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_SIZEBOX, $WS_THICKFRAME, $WS_TABSTOP), BitOR($WS_EX_OVERLAPPEDWINDOW, $WS_EX_WINDOWEDGE), $Form3_1 ) GUISetStyle ( $GUI_SS_DEFAULT_GUI, 0, $Form4 ) GUISetStyle ( $GUI_SS_DEFAULT_GUI, 0, $Form5 ) Else EndIf EndSwitch Switch $nMsg[1] Case $Form1_1 Switch $nMsg[0] Case $GUI_EVENT_CLOSE ;ProcessClose ( "pastebutt.exe" ) ;ProcessClose ( "PasteButtonhk.exe" ) Exit EndSwitch EndSwitch Wend My second question also involves the above code, but specifically the "Ini" functions which attempt to read a "tray" state flag from an Ini file. The following is code located at very beginning of script: Const $path = @AppDataDir & "\filler" Opt ( "TrayMenuMode", 1 ) OnAutoItExitRegister ( "refresh" ) $nonote = False $TrayMenu = TrayCreateMenu ( "Settings" ) $settings1 = TrayCreateItem ( "Turn off notifications", $TrayMenu ) TrayItemSetState ( -1, IniRead ( $path & "\infostore.ini", "Tray Settings", "No Notifications", "$TRAY_UNCHECKED" ) ) $settings2 = TrayCreateItem ( "Keep Window on top", $TrayMenu ) TrayItemSetState ( -1, IniRead ( $path & "\infostore.ini", "Tray Settings", "On top", "$TRAY_UNCHECKED" ) ) So the idea is that whenever the user "checks" one of the tray icon menu options, its current "state" will be input into the "ini" file, so that the state of the particular tray menu item will be in the same state as the user left it when the script is launched next. However, this is not occurring: the ini file contains the "state" flag like it should, but the tray menu item remains unchecked at startup. Furthermore, the checking or unchecking of "setting1" is not being recognized, as the windows' extended styles do not obtain the "Topmost" flag like they should had it worked. I get the feeling I'm not getting the "states" of the tray menu items correct. Any advice?
  4. I was helping another user the other day And decided To make a UDF so here it is. Let me know what ya think. #include-once #include <GuiListView.au3> Global Const $SW_HIDENA = 2, $SW_HIDENOACTIVE = 2 ; Examples are below. ; #FUNCTION# ==================================================================================================================== ; Name ..........: _ToggleSystemTrayState ; Description ...: Hide/Show System Tray Icons by Name or Set the State for all Icons ; Syntax ........: _ToggleSystemTrayState([$vTrayItems = ""[, $iStartSearchIndex = 0[, $iSystemTrayState = 0[, $iDebug = 0]]]]) ; Parameters ....: $vTrayItems - [optional] A variant value. Default is "". ; $iStartSearchIndex - [optional] An integer value. Default is 0. Set this to -1 to search from end to start. ; $iSystemTrayState - [optional] An integer value. Default is 0. ; $iDebug - [optional] An integer value. Default is 0. Set this to either @SW_SHOW or 1 to see dialogs and debug information. ; Return values .: None ; Author ........: Decipher ; Modified ......: ; Remarks .......: Tested only on XP ; ; $iSystemTrayState can be one of the following: ; @SW_SHOW == ALWAYS_SHOW == 5 ; @SW_HIDE == ALWAYS_HIDE == 0 ; $SW_HIDENA == HIDE WHEN INACTIVE == 2 ; ; $vTrayItems can be a string for a specific icon or an array for multiple icons ; There is no error checking implemented but feel free to change it to your needs. ; ; Related .......: ; Link ..........: ; Example .......: Yes, The examples need to be uncommented to run. Remove the ( ;- ) prefix on the example to be ran. ; =============================================================================================================================== ;;;; Set all icons to hide when inactive. ;;;; ;- _ToggleSystemTrayState($SW_HIDENA) ; Example #1 ;;;; Hide all system tray icons. ;;;; ;- _ToggleSystemTrayState(@SW_HIDE) ; Example #2 ;;;; Show two specific icons. ;;;; ;- Local $aIcons[2] = ["Local Area Connection", "Volume"] ; Example #3 ;- _ToggleSystemTrayState($aIcons, 0, @SW_SHOW) ;;;; Hide a specific icon. ;;;; ;- _ToggleSystemTrayState("Volume", 0, @SW_HIDE) ; Example #4 ;;;; Show all system tray icons. ;;;; ;- _ToggleSystemTrayState(@SW_SHOW) ; Example #5 ;;;; Hide all system tray icons but show the dialogs aka debug mode and log the names of the icons hidden. ;;;; ;- _ToggleSystemTrayState("", 0, @SW_HIDE, 1) ; Example #6 Func _ToggleSystemTrayState($vTrayItems = "", $iStartSearchIndex = 0, $iSystemTrayState = 0, $iDebug = 0) If IsInt($vTrayItems) Then $iSystemTrayState = $vTrayItems $vTrayItems = "" EndIf Local Const $sOPTIONS_DIALOG_PROCESS = "rundll32.exe shell32.dll, Options_RunDLL 1" Local Const $sTASKBAR_PROPERTIES_TITLE = "[TITLE:Taskbar and Start Menu Properties; CLASS:#32770; INSTANCE:1]" Local Const $sCUSTOMIZE_BUTTON = "[ClassnameNN:Button10]", $sSENDKEYS = "!c" Local Const $sTASKBAR_CUSTOMIZE_TITLE = "[TITLE:Customize Notifications; CLASS:#32770; INSTANCE:1]" Local Const $sTRAYICONS_LISTVIEW = "[CLASS:SysListView32; INSTANCE:1]" Local Const $sLISTVIEW_COMBOX_CONTROL = "[CLASS:ComboBox; INSTANCE:1]" Local Const $sTASKBAR_CHILD_OK_BUTTON = "[CLASS:Button; INSTANCE:2]" Local Const $iRUNDLL32 = Run($sOPTIONS_DIALOG_PROCESS) WinWait($sTASKBAR_PROPERTIES_TITLE, "", 2000) Local Const $hTASKBAR_DIALOG = WinGetHandle($sTASKBAR_PROPERTIES_TITLE) WinSetState($hTASKBAR_DIALOG, "", $iDebug) ControlSend($hTASKBAR_DIALOG, "", ControlGetHandle($hTASKBAR_DIALOG, "", $sCUSTOMIZE_BUTTON), $sSENDKEYS) WinWait($sTASKBAR_CUSTOMIZE_TITLE, "", 2000) $hTASKBAR_CHILD_DIALOG = WinGetHandle($sTASKBAR_CUSTOMIZE_TITLE) WinSetState($hTASKBAR_CHILD_DIALOG, "", $iDebug) Local Const $hDIALOG_LISTVIEW = ControlGetHandle($hTASKBAR_CHILD_DIALOG, "", $sTRAYICONS_LISTVIEW) Local $iListViewItem = 0, $hComboBox_Instance = 0, $aTrayIcon[1], $iTrayIcon, $iSkipTask = False, $sTrayItemText If IsArray($vTrayItems) Or $vTrayItems <> "" Then If Not IsArray($vTrayItems) Then $aTrayIcon[0] = $vTrayItems Else $aTrayIcon = $vTrayItems EndIf For $i = 0 To UBound($aTrayIcon, 1) - 1 Step 1 $iTrayIcon = _GUICtrlListView_FindInText($hDIALOG_LISTVIEW, $aTrayIcon[$i], $iStartSearchIndex) If $iDebug Then ConsoleWrite("Tray Icon: " & @TAB & _GUICtrlListView_GetItemText($hDIALOG_LISTVIEW, $iTrayIcon) & @CRLF) EndIf _GUICtrlListView_SetItemFocused($hDIALOG_LISTVIEW, $iTrayIcon) $hComboBox_Instance = ControlGetHandle($hTASKBAR_CHILD_DIALOG, "", $sLISTVIEW_COMBOX_CONTROL) ControlSend($hTASKBAR_CHILD_DIALOG, "", $hDIALOG_LISTVIEW, "{SPACE}") For $iLoopIndex = 1 To 3 Step 1 ControlSend($hTASKBAR_CHILD_DIALOG, "", $hComboBox_Instance, "{DOWN}") Next If $iSystemTrayState <> 5 Then ControlSend($hTASKBAR_CHILD_DIALOG, "", $hComboBox_Instance, "{UP}") If $iSystemTrayState = 2 Then ControlSend($hTASKBAR_CHILD_DIALOG, "", $hComboBox_Instance, "{UP}") EndIf EndIf Next $iSkipTask = True EndIf While WinExists($hTASKBAR_CHILD_DIALOG) If $iSkipTask Then ExitLoop EndIf If $iListViewItem >= _GUICtrlListView_GetItemCount($hDIALOG_LISTVIEW) + 1 Then ExitLoop EndIf $iListViewItem += 1 ControlFocus($hTASKBAR_CHILD_DIALOG, "", $hDIALOG_LISTVIEW) If $iDebug Then $sTrayItemText = _GUICtrlListView_GetItemText($hDIALOG_LISTVIEW, $iListViewItem) If $sTrayItemText <> "" Then ConsoleWrite("Tray Icon: " & @TAB & $sTrayItemText & @CRLF) EndIf EndIf $hComboBox_Instance = ControlGetHandle($hTASKBAR_CHILD_DIALOG, "", $sLISTVIEW_COMBOX_CONTROL) For $i = 1 To 3 Step 1 ControlSend($hTASKBAR_CHILD_DIALOG, "", $hComboBox_Instance, "{DOWN}") Next If $iSystemTrayState <> 5 Then ControlSend($hTASKBAR_CHILD_DIALOG, "", $hComboBox_Instance, "{UP}") If $iSystemTrayState = 2 Then ControlSend($hTASKBAR_CHILD_DIALOG, "", $hComboBox_Instance, "{UP}") EndIf EndIf ControlSend($hTASKBAR_CHILD_DIALOG, "", $hDIALOG_LISTVIEW, "{DOWN}") WEnd ControlSend($hTASKBAR_CHILD_DIALOG, "", $sTASKBAR_CHILD_OK_BUTTON, "{ENTER}") WinClose($hTASKBAR_DIALOG) If ProcessExists($iRUNDLL32) Then ProcessClose($iRUNDLL32) EndIf EndFunc ;==>_ToggleSystemTrayState
  5. Hey, I am just wondering about how I would check whether the current GUI is maximized or restored? Right now, I am using GUI Events to change a variable, I am wondering whether there is a more efficient way? Thanks.
×
×
  • Create New...