I downloaded a dll, that has it set so you can disbale and enable the close button in custom windows, channels, querts, status and such. I have made it so far that it will list the channels of the servers you are on. So if you click on a channel that is on irc.someserver.net it will list all the channels that is on that server. But I want it so it would list all the channels of all the servers. like.

Win Ctrl
-Enable Close
--Network Name of one Server
---#channel1
---#channel2
--network of another server
---#channel1
--yet another network
---#channel1
---#channel2
---#channel3

and so on. here is what I have so far.
Code:
menu channel { 
  win ctrl 
  .enable close
  ..$submenu($chan_mod($1).a)
  .disable close
  ..$submenu($chan_mod($1).d)
}

alias chan_mod {
  if ($prop == d) {
    if (!%i) { 
      window -hs @chan    
      var %j = $chan(0)  
      while (%j) {         
        aline @chan $chan(%j)   
        dec %j 
      }   
      set %i 1 
    }  
    var %j = 1  
    while ($line(@chan,0) >= %j) {   
      if ($1 == %j) { return $remove($line(@chan,%j),:) ://dll dlls\hstylus.dll x_desabilitar $window($chan(%j)).hwnd }
      inc %j 
    }  
    window -c @chan
    unset %i 
  }
  if ($prop == a) {
    if (!%i) { 
      window -hs @chan    
      var %j = $chan(0)  
      while (%j) {         
        aline @chan $chan(%j)   
        dec %j 
      }   
      set %i 1 
    }  
    var %j = 1  
    while ($line(@chan,0) >= %j) {   
      if ($1 == %j) { return $remove($line(@chan,%j),:) ://dll dlls\hstylus.dll x_habilitar $window($chan(%j)).hwnd }
      inc %j 
    }  
    window -c @chan
    unset %i 
  }
}


We don't just write the scripts, we put them to the test! (ScriptBusters)