Jump to content

probl with limit of contextmenus


Laetterman
 Share

Recommended Posts

The following script relates a ContextMenu to every child window, but from the 17th window on, the connected function doesn't start.

In http://www.autoitscript.com/forum/index.ph...c=24902&hl= it is said, that the reason is a limit of autoit. Do you have ideas for a workaround of this limit?

many thanx in advance,

Robert

#include <GUIConstants.au3>
#include <Array.au3>
HotKeySet("{ESC}", "Terminate")
DIM $i, $sub [80][99], $sub_context[80][99]

AutoItSetOption ( "TrayIconDebug", 1 )
Opt("WinTitleMatchMode", 3) 
Opt("GUIOnEventMode", 1)

$parent = GUICreate("Gui" & $i, 200, 100, 50, 45)
GUISetState (@SW_SHOW)

For $i = 1 To 20
    GUICreate("Gui" & $i, 200, 100, 40*$i, 45*$i, -1, -1, $parent)
    GUISetState (@SW_SHOW)
    $contextmenu = GUICtrlCreateContextMenu ()

    $context_sub = GUICtrlCreateMenu("Play Track", $contextmenu)
    $context_verkn = GUICtrlCreateMenuItem ("Verknüpfung bearbeiten...", $contextmenu)
    GUICtrlSetOnEvent($context_verkn, "f_start_Song")
    GUICtrlCreateMenuitem ("",$contextmenu) 
    $context_entf = GUICtrlCreateMenuitem ("Delete", $contextmenu)
    GUICtrlSetOnEvent($context_entf,  "Terminate")
    $z = 0
    While $z<12
        $z = $z + 1
        $sub[$i][$z] = GUICtrlCreateMenuitem ('Title ' & $z, $context_sub)
        GUICtrlSetOnEvent($sub[$i][$z], "f_Start_Song")
        $sub_context[$i][$z] = $i
    WEnd
Next

While 1
    Sleep(10)
Wend

Func f_start_Song()
        Beep(400, 10)
    EndFunc

Func Terminate()
    Exit
EndFunc
Link to comment
Share on other sites

Every Window should represent the cover of one music-album . In the context Menu I'd like to show the name of the songs, comming from the .m3u-File of the album. And if you choose one title I want e.g. Winamp to play this song.

So the Menu is different for every Release, because the name of the Songs are different !!! ;-) Sorry my english is not the best, do you understand now what I would like to do?

Edited by Laetterman
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...