Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #NoTrayIcon
- #include <MsgBoxConstants.au3>
- #include <TrayConstants.au3> ; Required for the $TRAY_CHECKED and $TRAY_ICONSTATE_SHOW constants.
- Opt("TrayMenuMode", 3) ; The default tray menu items will not be shown and items are not checked when selected. These are options 1 and 2 for TrayMenuMode.
- Example()
- Func Example()
- $RegKey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft Antimalware\Real-Time Protection"
- Local $idEnable = TrayCreateItem("Enable Real Time Protection")
- Local $idDisable = TrayCreateItem("Disable Real Time Protection")
- TrayCreateItem("") ; Create a separator line.
- Local $idAbout = TrayCreateItem("About")
- TrayCreateItem("") ; Create a separator line.
- Local $idExit = TrayCreateItem("Exit")
- TraySetState($TRAY_ICONSTATE_SHOW) ; Show the tray menu.
- While 1
- Switch TrayGetMsg()
- Case $idEnable
- RegWrite($RegKey, "DisableRealtimeMonitoring", "REG_DWORD", 0)
- Case $idDisable
- RegWrite($RegKey, "DisableRealtimeMonitoring", "REG_DWORD", 1)
- Case $idAbout ; Display a message box about the AutoIt version and installation path of the AutoIt executable.
- MsgBox($MB_SYSTEMMODAL, "", "MAMRTPS" & @CRLF & @CRLF & _
- "Version: 1.0" & @CRLF & _
- "Install Path: " & StringLeft(@AutoItExe, StringInStr(@AutoItExe, "\", 0, -1) - 1)) ; Find the folder of a full path.
- Case $idExit ; Exit the loop.
- ExitLoop
- EndSwitch
- WEnd
- EndFunc ;==>Example
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement