GodForsakenSoul Posted January 24, 2010 Share Posted January 24, 2010 I'm working on a bunch of projects simultaniously now. 1) What i want is to detect a certain tray icon that doesn't always show "on top". What i mean is that you have to click the little arrow slightly left to the language square. I use winXP, so i don't know about the existence of said arrow in other windows's, but i doubt i'll change my os soon. After a few minutes of prodding the help file, i found the "Tray managment" folder. HOWEVER! It seems that i always need to create said trays first. Is there a way to get the name (handle?) of an already existing tray? If there is, try to explain it please? At the moment i'm trying to capture what seems to be "Local area connection 2". At least that's what it says when i move the mouse over it and the tooltip thingy pops up. 2) This one is more about the Registry then autoit, but still. In my earlier posts, someone suggested i should poke the registry to do my bidding. I want to run MY OWN program before explorer.exe and have IT run explorer.exe on demand. Now, while i CAN do it, i'm deathly afraid of screwing up. The reasons are many. Last time i poked the registry following a someone's instruction, i lost a machine. It died to the point of no return. The technichian guy couldn't find the problem. So yeah... From the little i understand about registry, to make the program work, i need to shove the thing into a windows folder, the one with explorer.exe in it. point is... i dun wanna! can i give it a full path instead of file name? (ie: D:\Autoit work\myprog\myprog.exe <-that's... literally the path! i'm not very creative with my names.) these two seem to be all of my problems for the next 4-6 hours. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 24, 2010 Moderators Share Posted January 24, 2010 GodForsakenSoul, I can help with the first part. This is how to operate a systray icon. All you need is the content of the tooltip to identify it. 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...
GodForsakenSoul Posted January 24, 2010 Author Share Posted January 24, 2010 Crud! i should have been more specific. I would prefer to not use UDFs. As in, the stock ones that come with autoit. Also, i just need to see if it exists. Link to comment Share on other sites More sharing options...
GodForsakenSoul Posted January 24, 2010 Author Share Posted January 24, 2010 Crud! i should have been more specific. I would prefer to not use UDFs. As in, the stock ones that come with autoit. Also, i just need to see if it exists, not click it. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 24, 2010 Moderators Share Posted January 24, 2010 (edited) GodForsakenSoul, I would prefer to not use UDFs. As in, the stock ones that come with autoitThen all you have to do is go through the GUIToolBar, WinAPI and SendMessage UDFs (and that is just on a quick look!) and convert all the commands needed from them back into basic DLLCall lines - something which I am certainly not prepared to do for you. If you do decide to go with the UDFs, then this code returns True/False when asked if a tray icon containing a given text exists: expandcollapse popup#Include <GuiToolBar.au3> Global $sTrayIconText = "" ; <<<<<<<<<<<<<<<< Enter some tooltip text for the icon you want here $iTrayIconExists = _TrayIconExists($sTrayIconText) MsgBox(0, "TrayIcon", "TrayIconExists: " & $iTrayIconExists) Exit ;............ Func _TrayIconExists($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 = _SendMessage($hSysTray_Handle, $TB_BUTTONCOUNT) 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 False ; Not found Else Return True ; Found EndIf EndFunc Your script - your choice. M23 Edit: Wrong UDF quoted. Edited January 24, 2010 by Melba23 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...
GodForsakenSoul Posted January 24, 2010 Author Share Posted January 24, 2010 wait... ... I AM A BLIND FOOL!!! $iTrayIconExists = _TrayIconExists($sTrayIconText) Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 24, 2010 Moderators Share Posted January 24, 2010 GodForsakenSoul,_TrayIconExists is a function I created, not a built-in command . To use it you will need to include the following standard include files:#include "GUIToolBar.au3"#include "ToolbarConstants.au3"#include "StructureConstants.au3"#include "FileConstants.au3"#include "MemoryConstants.au3"#include "ProcessConstants.au3"#include "Memory.au3"#include "WinAPI.au3"#include "WinAPIError.au3"#include "SendMessage.au3"#include "UDFGlobalID.au3"#include "Security.au3"which is a long way fromI would prefer to not use UDFs. As in, the stock ones that come with autoitBut as I said:Your script - your choice 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