Jump to content

war59312

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by war59312

  1. Not working on Windows 10 x64 it seems. Googling a bit.. Says replace "Instance:1" with "instance:2", but then I get "No items found in system tray" error.
  2. Hey, Well, after a bit of learning curve here Is what I am currently using to fit my need of automating my Windows start-up routine. #Include <GuiToolBar.au3> AutoItSetOption("TrayIconHide", 1) Global $sToolTipTitle = "WinVNC" ; <<<<<<<<<<<<<<<< Enter some tooltip text for the icon you want here Global $iSystray_ButtonNumber = Get_Systray_Index($sToolTipTitle) Global $isWinvncRunning = "" ; Global $isHamachiRunning = "" ; If $iSystray_ButtonNumber = 0 Then $isWinvncRunning = "False" ;MsgBox(16, "Error", "winvnc is not running") $sToolTipTitle = "Hamachi" ; $iSystray_ButtonNumber = Get_Systray_Index($sToolTipTitle) If $iSystray_ButtonNumber = 0 Then $isHamachiRunning = "False" ;MsgBox(16, "Error", "Hamachi is not running") Else $isHamachiRunning = "True" ;MsgBox(16, "Error", "Hamachi is running") EndIf Else $isWinvncRunning = "True" ;MsgBox(16, "Error", "winvnc is running") $sToolTipTitle = "Hamachi" ; $iSystray_ButtonNumber = Get_Systray_Index($sToolTipTitle) If $iSystray_ButtonNumber = 0 Then $isHamachiRunning = "False" ;MsgBox(16, "Error", "Hamachi is not running") Else $isHamachiRunning = "True" ;MsgBox(16, "Error", "Hamachi is running") EndIf EndIf Select Case $isHamachiRunning = "True" And $isWinvncRunning = "True" ;MsgBox(0, "", "Both Are True") RunWait('C:\Windows\System32\HIDE.EXE /w c:\windows\syswow64\cmd.exe /c c:\windows\sysnative\cmd.exe /c start /b /w /D"C:\StartAndEnd\scripts" ProcessExplorerTrueTrue.ahk', "", @SW_HIDE) Case $isHamachiRunning = "False" And $isWinvncRunning = "False" ;MsgBox(0, "", "Both Are False") RunWait('C:\Windows\System32\HIDE.EXE /w c:\windows\syswow64\cmd.exe /c c:\windows\sysnative\cmd.exe /c start /b /w /D"C:\StartAndEnd\scripts" ProcessExplorerFalseFalse.ahk', "", @SW_HIDE) Case $isHamachiRunning = "True" And $isWinvncRunning = "False" ;MsgBox(0, "", "Hamachi is Is True And WinVNC Is False") RunWait('C:\Windows\System32\HIDE.EXE /w c:\windows\syswow64\cmd.exe /c c:\windows\sysnative\cmd.exe /c start /b /w /D"C:\StartAndEnd\scripts" ProcessExplorerTrueFalse.ahk', "", @SW_HIDE) Case $isHamachiRunning = "False" And $isWinvncRunning = "True" ;MsgBox(0, "", "Hamachi Is False And WinVNC Is True") RunWait('C:\Windows\System32\HIDE.EXE /w c:\windows\syswow64\cmd.exe /c c:\windows\sysnative\cmd.exe /c start /b /w /D"C:\StartAndEnd\scripts" ProcessExplorerFalseTrue.ahk', "", @SW_HIDE) Case Else MsgBox(0, "", "Bug") EndSelect Exit ;............ Func Get_Systray_Index($sToolTipTitle) ; 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 ; 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) > 0 Then ExitLoop Next If $iSystray_ButtonNumber = $iSystray_ButCount Then Return 0 ; Not found Else Return $iSystray_ButtonNumber ; Found EndIf EndFuncSo pretty simple really. It is checking to see if two products are running, Hamachi and WinVNC. Then running the correct AutoHotkey script to do a few things to Process Explorer when I boot up my computer. I'm also making use of Easy Macro Recorder @ http://www.flashplayerpro.com/MacroRecorder/ to do a few things. So using AutoIt, AutoHotkey, and Easy Macro Recorder. I'm sure AutoIt can probably do everything I need but don't know how, yet. I left a lot of extra stuff in there for my debugging needs. I'm just glad Windows finally (with Win7) remembers placement of system tray icons. Thanks for all the help. Will
  3. Whooooo! You the man, thanks a lot. I though I had tried that, guess not. Will post full script when I am done.. Thanks again..
  4. Hey, Indeed it does. Now to only figure out how to run: When the icon is found. I tried: But get a script error. Thanks again, Will
  5. Hi, I'd like to do something similar. I need to known if Ultra VNC's icon is in fact in the system tray. I know the process (WinVNC.exe) is already running so that lets me know if I need to even check. But how to check if the icon is there or not? The issue is that it runs itself twice: So a way to detect if both are running would work too? At the moment I only know how to check if WinVNC.exe is running. Which of course it already is before it loads the icon. Thanks, Will
×
×
  • Create New...