Barboss Posted June 30, 2010 Share Posted June 30, 2010 Hello friends. I'm not a programmer. Help me to solve a similar problem. I need without the click, but with the help of hot keys to open programs, which are in the system tray. Thanks in advance. Link to comment Share on other sites More sharing options...
picea892 Posted June 30, 2010 Share Posted June 30, 2010 Wrong forum HotKeySet("q","runit") func runit WinActivate("[CLASS:Notepad]", "") EndFunc Link to comment Share on other sites More sharing options...
Barboss Posted June 30, 2010 Author Share Posted June 30, 2010 Wrong forum HotKeySet("q","runit") func runit WinActivate("[CLASS:Notepad]", "") EndFunc Thank you. As I said, I'm not a programmer. Could you explain me how to use it? How to make a script and how to program a specific hot key combination, which would correspond the program name in the system tray? Link to comment Share on other sites More sharing options...
wraithdu Posted June 30, 2010 Share Posted June 30, 2010 Go away. This isn't rent-a-coder. Link to comment Share on other sites More sharing options...
E1M1 Posted July 1, 2010 Share Posted July 1, 2010 Use run or shellexecute. Autoit help is written so that even I could understand it (which means it's well written and it's dumb friendly ). if you bother to read you can do what you want. edited Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 1, 2010 Moderators Share Posted July 1, 2010 Barboss,Here is something I produced quickly to get you started. It produces an array holding the traytip text of the icons, the required HotKey letter and the selected modifiers:expandcollapse popup#include <GUIConstantsEx.au3> #Include <GuiToolBar.au3> #include <EditConstants.au3> #include <Array.au3> ; Get list of icon text Global $aToolTip = Get_Systray_IconText() $iSize = UBound($aToolTip) ; Declare array to hold control IDs Global $aInputs[$iSize][4] ; Create GUI $hGUI = GUICreate("Tray Icon Hotkeys", 300, 60 + (20 * $iSize)) ; Place Ctrl Alt Shft labels GUICtrlCreateLabel("C", 12, 0, 15, 15) GUICtrlCreateLabel("A", 27, 0, 15, 15) GUICtrlCreateLabel("S", 42, 0, 15, 15) ; Create user input area For $i = 0 To $iSize - 1 $aInputs[$i][0] = GUICtrlCreateCheckbox("", 10, 13 + (20 * $i), 15, 15) $aInputs[$i][1] = GUICtrlCreateCheckbox("", 25, 13 + (20 * $i), 15, 15) $aInputs[$i][2] = GUICtrlCreateCheckbox("", 40, 13 + (20 * $i), 15, 15) $aInputs[$i][3] = GUICtrlCreateInput("", 60, 10 + (20 * $i), 20, 20, $ES_UPPERCASE) GUICtrlSetLimit(-1, 1) GUICtrlCreateLabel($aToolTip[$i][0], 100, 13 + (20 * $i), 200, 15) Next $hButton = GUICtrlCreateButton("Set", 110, 20 + (20 * $i), 80, 30) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $hButton Set_HotKeys() EndSwitch ; Force hotkeys to be letters only (optional) For $i = 0 To $iSize - 1 If StringRegExp(GUICtrlRead($aInputs[$i][3]), "[[:alpha:]]") <> 1 Then GUICtrlSetData($aInputs[$i][3], "") Next WEnd Exit Func Set_HotKeys() ; Loop through the inputs and put the modifiers and hotkeys in the array For $i = 0 To $iSize - 1 If GUICtrlRead($aInputs[$i][0]) = 1 Then $aToolTip[$i][1] = 1 If GUICtrlRead($aInputs[$i][1]) = 1 Then $aToolTip[$i][2] = 1 If GUICtrlRead($aInputs[$i][2]) = 1 Then $aToolTip[$i][3] = 1 $aToolTip[$i][4] = StringLower(GUICtrlRead($aInputs[$i][3])) Next ; here is the array with the icon text, chosen hotkey letter and modifier key selection _ArrayDisplay($aToolTip) EndFunc Func Get_Systray_IconText() $hSystray_Handle = Get_SysTray_Handle() $iSystray_ButCount = Get_Systray_Icon_Count($hSystray_Handle) Local $aArray[$iSystray_ButCount][5] ; Get text from tooltips For $iSystray_ButtonNumber = 0 To $iSystray_ButCount - 1 Local $sText = _GUICtrlToolbar_GetButtonText($hSystray_Handle, $iSystray_ButtonNumber) $sText = StringReplace($sText, @CRLF, " - ") $aArray[$iSystray_ButtonNumber][0] = $sText Next Return($aArray) EndFunc Func Get_SysTray_Handle() ; Find systray handle Local $hSystray_Handle = ControlGetHandle('[Class:Shell_TrayWnd]', '', '[Class:ToolbarWindow32;Instance:1]') If @error Then MsgBox(16, "Error", "System tray not found") Exit EndIf Return $hSystray_Handle EndFunc Func Get_Systray_Icon_Count($hSystray_Handle) ; 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 Return $iSystray_ButCount EndFuncOver to you to code the next bit - actually creating the HotKeys and getting them to click the correct icon. You know where we are if you have problems. 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 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