this-is-me Posted September 29, 2005 Share Posted September 29, 2005 (edited) No offense to you quaizywabbit (I'm just asking a question), but if the function is not used more than once, does it make any difference whether or not it is a variable? Did you mention it because it makes readability better? EDIT: I have gone to this point, but then explorer crashes on my windows xp system. Did I do something stupid? $index = 0 $hndl = _FindTrayToolbarWindow() $lResult = DLLCall("user32.dll","int","SendMessage", "hwnd", $hndl, "int", $TB_GETBUTTONTEXT, "int", $index, "ptr", "") ;MsgBox(0,"",$lResult[0]) $bufferptr = DllStructCreate ("char[256]");" & $lResult[0] + 1 & " ;MsgBox(0,"",DllStructGetPtr($bufferptr)) $lResult = DLLCall("user32.dll","int","SendMessage", "hwnd", $hndl, "int", $TB_GETBUTTONTEXT, "int", $index, "ptr", DllStructGetPtr($bufferptr)) Edited September 29, 2005 by this-is-me Who else would I be? Link to comment Share on other sites More sharing options...
tuape Posted September 29, 2005 Author Share Posted September 29, 2005 No offense to you quaizywabbit (I'm just asking a question), but if the function is not used more than once, does it make any difference whether or not it is a variable? Did you mention it because it makes readability better?EDIT: I have gone to this point, but then explorer crashes on my windows xp system. Did I do something stupid?$index = 0 $hndl = _FindTrayToolbarWindow() $lResult = DLLCall("user32.dll","int","SendMessage", "hwnd", $hndl, "int", $TB_GETBUTTONTEXT, "int", $index, "ptr", "") ;MsgBox(0,"",$lResult[0]) $bufferptr = DllStructCreate ("char[256]");" & $lResult[0] + 1 & " ;MsgBox(0,"",DllStructGetPtr($bufferptr)) $lResult = DLLCall("user32.dll","int","SendMessage", "hwnd", $hndl, "int", $TB_GETBUTTONTEXT, "int", $index, "ptr", DllStructGetPtr($bufferptr)) I thik button ID should be the id on struct TB_BUTTON, 2. Unfortunately I'm away for a while, but if you can't get this working I could try it during the weekend. Link to comment Share on other sites More sharing options...
this-is-me Posted September 29, 2005 Share Posted September 29, 2005 Thanks, tuape. I will look into it. Who else would I be? Link to comment Share on other sites More sharing options...
random667 Posted October 4, 2005 Share Posted October 4, 2005 (edited) What am i missing? i got the latest beta, but when i run this script nothing happens. EDIT: Sorry i must be a little tarded today i figured it out. i really need to learn to read all through a script before i go and run it Edited October 4, 2005 by random667 It is really sad to see a family torn apart by something as simple as a pack of wolves. Link to comment Share on other sites More sharing options...
Buffo Posted October 5, 2005 Share Posted October 5, 2005 @Tuape: Good job! This UDF ist very useful to me. But one little thing is annoying me: I always use the option "MustDeclareVars". This doesn't work with your UDF. Can you improve this please. Thx a lot :-) Cu, Buffo Link to comment Share on other sites More sharing options...
tuape Posted October 5, 2005 Author Share Posted October 5, 2005 @Tuape: Good job! This UDF ist very useful to me.But one little thing is annoying me: I always use the option "MustDeclareVars". This doesn't work with your UDF. Can you improve this please.Thx a lot :-)Cu,Buffo @Buffo: Modified the first post. Hopefully I didn't break anything. @this-is-me: Did you get it working? Link to comment Share on other sites More sharing options...
this-is-me Posted October 5, 2005 Share Posted October 5, 2005 @tuape, no I did not. I continued to have issues related to my poor knowledge of API calls. If you have some time, would you mind adding a _SysTrayIconGetTooltip($iIndex=0) to your wonderful library? Who else would I be? Link to comment Share on other sites More sharing options...
somh Posted October 6, 2005 Share Posted October 6, 2005 (edited) I used beta version and got no error but nothing else happened either. Hide/Unhide/remove icon functions are not working in my system. I'm using Win2k Eng Pro Rollup 1. Edited October 6, 2005 by somh Link to comment Share on other sites More sharing options...
psychotik2k3 Posted November 7, 2005 Share Posted November 7, 2005 DUH i jsute donwload the latest (3.1.1.86) beta and try jsut to run your example of clicking on outlook icon but it doesn't work because it says that it doesn't know the hwnd function... SysTray_UDF.au3(73,35) : ERROR: HWnd(): undefined function. If $info[$i] = HWnd($var[$j][1]) what have i missed ??? because i want to right click on an application (netsetman int this case) to chose one of the menu indextesteu.au3 Link to comment Share on other sites More sharing options...
2000a Posted November 13, 2005 Share Posted November 13, 2005 psychotik2k3,I was getting the same error. I use the Scite editor. It was configured to use "/prod" and not "/beta". If you are using Scite, then either use the BETA Run/Compile menu or modify the command in the "au3.properties" of the scite folder.au3.properties:-----------------command.go.$(file.patterns.au3)="$(SciteDefaultHome)\CompileAU3\CompileAU3.exe" /run /beta /ErrorStdOut /in "$(FilePath)" /autoit3dir "$(autoit3dir)" /UserParams $(1) $(2) $(3) $(4)command.build.$(file.patterns.au3)="$(SciteDefaultHome)\CompileAU3\CompileAU3.exe" /beta /CompileDefaults /in "$(FilePath)" /autoit3dir "$(autoit3dir)"this is an excellent UDF!good luckDUH i jsute donwload the latest (3.1.1.86) beta and try jsut to run your example of clicking on outlook icon but it doesn't work because it says that it doesn't know the hwnd function...SysTray_UDF.au3(73,35) : ERROR: HWnd(): undefined function. If $info[$i] = HWnd($var[$j][1])what have i missed ??? because i want to right click on an application (netsetman int this case) to chose one of the menu index Link to comment Share on other sites More sharing options...
Angel Posted November 30, 2005 Share Posted November 30, 2005 I hope this gets added to the list of default AutoIt3 UDF libraries! Angel Link to comment Share on other sites More sharing options...
The_Mega_ZZTer Posted December 4, 2005 Share Posted December 4, 2005 (edited) Heh... I was making a script to read my upload/download speeds from µTorrent. What I'm corrently doing is iterating through the listview of torrents and reading the speeds of each one and summing them. But the window doesn't update these numbers unless the window is actually VISIBLE and RESTORED, making it quite annoying. Worse yet, I can't restore it via script, the tray icon needs to be clicked, otherwise the window won't update. Anyways... it would be alot simpler to use a tray tooltip reading function, since µTorrent puts the overall speeds right there. I'm looking forward to a version of this UDF that'll support that! Const $TBBUTTON = "int;int;byte;byte;byte;ptr;ptr" Const $TB_GETBUTTON = 1047 Const $TB_GETBUTTONTEXT = 1069 Opt("WinSearchChildren", 1) Opt("WinTitleMatchMode", 3) $hwnd = WinGetHandle("Notification Area") $info = DllStructCreate($TBBUTTON) $success = 1 $i = 0 While $success <> 0 $ret = DllCall("user32.dll","int","SendMessageA", "hwnd", $hwnd, "int", $TB_GETBUTTON, "int", $i, "ptr", DllStructGetPtr($info)) If @error <> 0 Then MsgBox(0, "", "Error") Exit EndIf $success = $ret[0] If $success <> 0 Then $idcommand = DllStructGetData($info, 2) $ret = DllCall("user32.dll","int","SendMessageA", "hwnd", $hwnd, "int", $TB_GETBUTTONTEXT, "int", $idcommand, "str", "") MsgBox(0, "", $ret[4]) $i = $i + 1 EndIf WEnd DllStructDelete($info) I just wrote this code snippit, which is supposed to iterate through all the systray buttons and MsgBox their tooltips. But, it crashes explorer on the first DllCall. Not sure why. BTW, I'm not even sure if this, if it worked, would return the text neeced. A TB_GETTOOLTIPS might be needed, with a TIM_GETTEXT directed at the tooltip control after that. Edited December 4, 2005 by The_Mega_ZZTer Link to comment Share on other sites More sharing options...
VeeDub Posted December 9, 2005 Share Posted December 9, 2005 Hi, I'm trying this out on W2K. Running beta 3.1.1.93. When I include the UDF I get the following error message: (59): Array variable subscript badly formatted.: Local $info[$max] Local $info[^ ERROR I have #include <SysTray_UDF.au3> in my script and am using Alt-F5 to run. Am I doing something wrong? Thanks VW Link to comment Share on other sites More sharing options...
BigDod Posted January 4, 2006 Share Posted January 4, 2006 Hi, I am trying to use your Systray_UDF and get the following error D:\AutoIT\SysTray_UDF.au3 (414) : ==> Unknown function name.: DllStructDelete($TBBUTTON) ^ ERROR Any idea why ? Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
GaryFrost Posted January 4, 2006 Share Posted January 4, 2006 Hi,I am trying to use your Systray_UDF and get the following errorD:\AutoIT\SysTray_UDF.au3 (414) : ==> Unknown function name.: DllStructDelete($TBBUTTON) ^ ERRORAny idea why ? The UDF needs to be updated, DllStructDelete no longer exists in the beta. SciTE for AutoItDirections for Submitting Standard UDFs  Don't argue with an idiot; people watching may not be able to tell the difference.  Link to comment Share on other sites More sharing options...
BigDod Posted January 4, 2006 Share Posted January 4, 2006 The UDF needs to be updated, DllStructDelete no longer exists in the beta.Looks like I am stuffed unless Tuape decides to update it as I do not have that sort of skills.Thanks for the answer. Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
GaryFrost Posted January 4, 2006 Share Posted January 4, 2006 (edited) Looks like I am stuffed unless Tuape decides to update it as I do not have that sort of skills.Thanks for the answer. This should fix it for you. Edited September 19, 2006 by gafrost SciTE for AutoItDirections for Submitting Standard UDFs  Don't argue with an idiot; people watching may not be able to tell the difference.  Link to comment Share on other sites More sharing options...
BigDod Posted January 4, 2006 Share Posted January 4, 2006 This should fix it for you.Thanks, It worked a treat.You are a star. Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
masvil Posted January 13, 2006 Share Posted January 13, 2006 (edited) This should fix it for you.Does it still work with last beta (v3.1.1.101)? Edited January 13, 2006 by masvil Link to comment Share on other sites More sharing options...
VeeDub Posted January 29, 2006 Share Posted January 29, 2006 G'day, Is anyone using this UDF successfully with Win2K? The UDF works for me in XP, but in W2K, although it runs the results are not correct. For instance one of the example scripts is supposed to list the processes that "own" icons on the systray. ; Get window titles of all windows that have icon on systray $iTitles = _SysTrayIconTitles() ; Get process names of all processes that have icon on systray $iProcesses = _SysTrayIconProcesses() For $i=0 to Ubound($iTitles)-1 ; write the info to consolewindow ConsoleWrite(@CR & "#" &$i & "Title: " & $iTitles[$i] & ", process: " & $iProcesses[$i]) Next When I run this code on W2K, this is the result that I get: "C:\Data\SysTray.au3" /autoit3dir "C:\Program Files\AutoIt3\beta" /UserParams >Running AU3Check C:\Program Files\AutoIt3\SciTE\Defs\Unstable\Au3Check\au3check.dat >AU3Check Ended. No Error(s). >Running: (3.1.1.104):C:\Program Files\AutoIt3\beta\autoit3.exe "C:\Data\SysTray.au3" #0Title: , process: SciTe.exe #1Title: , process: SciTe.exe #2Title: , process: SciTe.exe #3Title: , process: SciTe.exe #4Title: , process: SciTe.exe #5Title: , process: SciTe.exe >AutoIT3.exe ended. >Exit code: 0 Time: 4.456 This is not correct, the number of processes is about right, but none of them belong to the editor. Also, a general question on using the beta. At the moment to get the include to work I am having to specify the full path to the UDF in the beta\include directory. There must be a default path somewhere for includes, can someone tell me where this is. Thanks, VW 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