Jump to content

Tray Mesage Registering Problem


Recommended Posts

Hi there

I have this problem:

;TraySetOnEvent($TRAY_EVENT_SECONDARYDOWN, "_populate")
While 1
    $aHwnd=_populate()
    For $i = 0 to UBound($aHwnd)-1
        If TrayGetMsg()=$aHwnd[$i][0] And $aHwnd[$i][0]<>"" Then 
            MsgBox(0,"",$aHwnd[$i][0])
            MsgBox(0,"",$aHwnd[$i][1])
            ShellExecute($aHwnd[$i][1]&"\")
        EndIf
    Next
    _destroy($aHwnd)
WEnd
Func _populate()
    $aDirs=IniReadSection(@TempDir&"\QD_settings.ini", "dirs")
    Dim $aHwnd[$aDirs[0][0]+1][2]
    For $i = 1 to $aDirs[0][0]
        $hTray=TrayCreateItem($aDirs[$i][1])
        $aHwnd[$i-1][0]=$hTray
        $aHwnd[$i-1][1]=$aDirs[$i][1]
    Next
    Return $aHwnd
EndFunc
Func _destroy($aHwnd)
    For $i=0 to UBound($aHwnd)-1
        TrayItemDelete($aHwnd[$i][0])
    Next
EndFunc

this is because the ini can change at any moment and it has to automatically refresh

this is terribly slow and even more inaccurate

on 5 clicks' average it only takes 3 out of five :)

how can I solve the problem

(just to explain the code though it's rather simple... it gets some values from an INI and puts them in the tray menu)

Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

Link to comment
Share on other sites

Hi there

I have this problem:

;TraySetOnEvent($TRAY_EVENT_SECONDARYDOWN, "_populate")
While 1
    $aHwnd=_populate()
    For $i = 0 to UBound($aHwnd)-1
        If TrayGetMsg()=$aHwnd[$i][0] And $aHwnd[$i][0]<>"" Then 
            MsgBox(0,"",$aHwnd[$i][0])
            MsgBox(0,"",$aHwnd[$i][1])
            ShellExecute($aHwnd[$i][1]&"\")
        EndIf
    Next
    _destroy($aHwnd)
WEnd
Func _populate()
    $aDirs=IniReadSection(@TempDir&"\QD_settings.ini", "dirs")
    Dim $aHwnd[$aDirs[0][0]+1][2]
    For $i = 1 to $aDirs[0][0]
        $hTray=TrayCreateItem($aDirs[$i][1])
        $aHwnd[$i-1][0]=$hTray
        $aHwnd[$i-1][1]=$aDirs[$i][1]
    Next
    Return $aHwnd
EndFunc
Func _destroy($aHwnd)
    For $i=0 to UBound($aHwnd)-1
        TrayItemDelete($aHwnd[$i][0])
    Next
EndFuncoÝ÷ ÚØb²+yÆ®±ëaz)âq©Ü©ày«Z)¨éíjwb¶¬¶®¶¶'«yúÞ²aȬµêë¹r²Z0jw^½é梷¢§º¶­zùrXÍýj÷«j¢¶åÊÖ¤zÍèºÚ~+Þjr,¢[Þ¶©®åzhî²Ûh{ej)íç(uëa¢è!Ýý²¶­êìjez+`zÛ,¢g¯j[±úè©È4§v­²Ø^)íëkk)ïêº^N¼­+ºÚ"µÍÚ[HB  ÌÍØRÛWÜÜ[]J
BIÌÍÓÙÈH^QÙ]ÙÊ
BÜ ÌÍÚHHÈPÝ[
    ÌÍØRÛ
KLBY    ÌÍÓÙÏIÌÍØRÛÉÌÍÚWVÌH[  ÌÍØRÛÉÌÍÚWVÌIÉÝÉ][ÝÉ][ÝÈ[ÙÐÞ
    ][ÝÉ][ÝË    ÌÍØRÛÉÌÍÚWVÌJBÙÐÞ
    ][ÝÉ][ÝË    ÌÍØRÛÉÌÍÚWVÌWJBÚ[^XÝ]J   ÌÍØRÛÉÌÍÚWVÌWI[É][ÝÉÌLÉ][ÝÊB[Y^ÙÝÞJ  ÌÍØRÛ
BÑ[
Link to comment
Share on other sites

thanks for your help :)

it's much quicker now :party:

Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...