,------------------------------------------------------------------------------------------------------------------- ; DLL: menuedit.dll v1.33; released: 3/4/02 ; ; Author: GrimZ (GrimZ@ScriptaZ.com) ; ; Website: http://www.ScriptaZ.com ; ; Thanks: Naru - You're the elitest chick I've ever known ... where the hell did you go? =( ; Necroman - Your DLL tutorials are superb ... I still read over them from time to time ;) ; DragonZap - Thanks for anwsering some questions and figuring out a big bug ;) ; [-maverick-] - Main DLL beta testing, thanks schlonger. ; exn - DLL beta testing. ; ; #ScriptaZ - The 'l33test' group of people. '------------------------------------------------------------------------------------------------------------------- ,------------------------------------------------------------------------------------------------------------------- ; » Installation ; ; 1. Place the menuedit.dll file into your mIRC directory if its not (if you don't just use the path) ; 2. I recommend calling the dll with this alias (my example uses it anyway) ; ; medit { ; var %tmp = menuedit.dll ; if ($isid) return $dll(%tmp,$$1,$$2-) ; else dll %tmp $$1 $$2- ; } ; ; $medit(Function,Parms) ; /medit Function Parms ; ; menuedit.dll also calls on 1:SIGNAL:MENU: for simulating 'on MENU' events. ; ; on 1:SIGNAL:MENU: { ; if ($1 == click) echo -a *** Clicked menu item id: $2 - flags: $3 - text: $4- ; elseif ($1 == highlight) echo -a *** Highlighted menu item id: $2 - flags: $3 - text: $4- ; elseif ($1 == select) echo -a *** Selected menu id: $2 - text: $3- ; } ; ; You can use these to help in creating 'dynamic' menus. I have an example near the bottom of doing so. '------------------------------------------------------------------------------------------------------------------- ,------------------------------------------------------------------------------------------------------------------- ; » Description ; ; Thank you for downloading menuedit DLL. I hope it prooves useful for you. This was originally one of the main ideas ; that got me interested in dll coding. I finally got it done as I said I would (ha Naru, I told you I would ;)) ; ; I've posted some screenshots of this before and it seems a lot of scripters are wanting to work with it. I've tried ; to make it as easy to work with as possible, so hopefully it's not too hard to understand. ; ; And for the last time, READ THIS DOCUMENT, I didn't spend 1 hour writing it for my health. I won't anwser stupid ; questions like "How do I make a menu" etc, I'll probably kick ban you because too many people fail to read this or ; are too lazy. Well guess what? You can't learn if you don't read it so don't bother coming around and asking if ; you haven't even put enough effort to read it. ; ; Anyway, I hope this is of some use to someone out there ... '------------------------------------------------------------------------------------------------------------------- ,------------------------------------------------------------------------------------------------------------------- ; GenerateMenubar ; ; Function Usage: dll menuedit.dll GenerateMenubar . ; ; Returns Values: Success: ME_OK - Menubar generated. ; Error: ME_ERROR - Menubar could not be generated. ; ; Purpose: This will delete all of mIRC's menubar, and replace it with my own custom one. This is done to ; fix mIRC from internally trying to redraw the 'Commands' scriptable menu. ; ; Notes: You must use this if you're deleting the 'Commands' menu. '------------------------------------------------------------------------------------------------------------------- ,------------------------------------------------------------------------------------------------------------------- ; AddMenu ; ; Function Usage: dll menuedit.dll AddMenu text ; ; Returns Values: Success: ME_OK - Menu created ID: ; Error: ME_ERROR - Menu could not be created. ; ; Purpose: This will add a menu to the menubar, and places 'text' as the menu caption. ; ; Notes: You'll need to call this with $medit / $dll; $Gettok($medit(AddMenu,&bleh),6,32) will give you ; the id of the generate menu, which is used for AddMenuItem. '------------------------------------------------------------------------------------------------------------------- ,------------------------------------------------------------------------------------------------------------------- ; UpdateMenu ; ; Function Usage: dll menuedit.dll UpdateMenu menuid > text ; ; Returns Values: Success: ME_OK - Menu updated. ; Error: ME_ERROR - Menu could not be updated. ; ; Purpose: This will replace the old menu's text caption with the new one. ; ; Notes: This command can only be issued one time before it stops working (?) '------------------------------------------------------------------------------------------------------------------- ,------------------------------------------------------------------------------------------------------------------- ; AddMenuItem ; ; Function Usage: dll menuedit.dll AddMenuItem menuid > break|text [> command] ; ; Returns Values: Success: ME_OK - Menu item created ID: ; Error: ME_ERROR - The specified menu does not exist. ; ME_ERROR - Menu item could not be created. ; ; Purpose: This will add a menu item to the menubar, and places 'text' as the menu caption. ; ; Notes: If you notice, you can specify a line break by sending 'break' as the menu item; Doing this does ; NOT mean you need a command, ie: ; ; var %m = $medit(AddMenu,&ScriptaZ) ; medit AddMenuItem %m > GrimZ > query GrimZ ; medit AddMenuItem %m > break ; medit AddMenuItem %m > ian > kick $active ian wake up ! ; ; Notice how if it is NOT a 'break' I send the command to be performed when the item is clicked? ; That is required for adding non-line break items. '------------------------------------------------------------------------------------------------------------------- ,------------------------------------------------------------------------------------------------------------------- ; UpdateMenuItem ; ; Function Usage: dll menuedit.dll UpdateMenuItem menuitemid > flag|text|cmd > new flag|new text|new command ; ; Returns Values: Success: ME_OK - Menu item updated. ; Error: ME_ERROR - The specified menu does not exist. ; ME_ERROR - Menu item could not be updated. ; ; Purpose: This will allow you to alter the flag, text, or command of a menu item. ; ; Notes: You can only send one flag at a time. Also, disableing a menu item does not make it grayed out, ; that is 'grayed', it just makes it non-clickable. ; ; So if you're looking for the disabled look of $style use 'grayed' ; ; Available Flags: checked, unchecked, enabled, disabled, and grayed. '------------------------------------------------------------------------------------------------------------------- ,------------------------------------------------------------------------------------------------------------------- ; AddSubMenu ; ; Function Usage: dll menuedit.dll AddSubMenu menu > text ; ; Returns Values: Success: ME_OK - SubMenu created ID: ; Error: ME_ERROR - The specified menu does not exist. ; ME_ERROR - SubMenu could not be created. ; ; Purpose: This will add a submenu to a menu, and places 'text' as the menu caption. ; ; Notes: You'll need to call this with $medit / $dll; $Gettok($medit(AddSubMenu,menuid > &bleh),6,32) will ; give you the id of the generate menu, which is used for AddMenuItem. ; ; If you're not sure of what a 'submenu' is, basically it's like this in mIRC popups: ; ; Test ; .Item 1:halt ; .- ; .More ; ..Item2:halt ; ; The menuitem 'More' is actually a submenu, and 'Item2' is a menu item of that menu. '------------------------------------------------------------------------------------------------------------------- ,------------------------------------------------------------------------------------------------------------------- ; KillMircMenu ; ; Function Usage: dll menuedit.dll KillMircMenu N ; ; Returns Values: Success: ME_OK - mIRC menu removed. ; Error: ME_ERROR - mIRC menu could not be removed. ; ; Purpose: This will remove parts of mIRC's menubar, they start at 0 and go up. ; ; Notes: File = 0 ; Tools = 1 ; Dcc = 2 ; ... etc ; ; Please note, if you're removing the 'DCC' menu it usually leads to problems relating to the ; 'Commands' menu, I have no idea why so be warned ... '------------------------------------------------------------------------------------------------------------------- ,------------------------------------------------------------------------------------------------------------------- ; KillMenu ; ; Function Usage: dll menuedit.dll KillMenu menuid ; ; Returns Values: Success: ME_OK - Menu removed. ; Error: ME_ERROR - The specified menu does not exist. ; ME_ERROR - Menu could not be removed. ; ; Purpose: This will remove a menu you've made with the specified menu id. ; ; Notes: Once this menu is removed, it will have to be re-created if you want it back. '------------------------------------------------------------------------------------------------------------------- ,------------------------------------------------------------------------------------------------------------------- ; KillMenuItem ; ; Function Usage: dll menuedit.dll KillMenuItem menuitemid ; ; Returns Values: Success: ME_OK - Menu item removed. ; Error: ME_ERROR - The specified menu item does not exist. ; ME_ERROR - Menu item could not be removed. ; ; Purpose: This will remove a menu item you've made with the specified menuitem id. ; ; Notes: Once this item is removed, it will have to be re-added if you want it back. '------------------------------------------------------------------------------------------------------------------- ,------------------------------------------------------------------------------------------------------------------- ; KillMircMenuItem ; ; Function Usage: dll menuedit.dll KillMircMenuItem menuitemid ; ; Returns Values: Success: ME_OK - mIRC menu item removed. ; Error: ME_ERROR - mIRC menu item could not be removed. ; ; Purpose: This will remove a menu item of mIRC's. ; ; Notes: Look below at the 'OpenMenu' function for more information about the mIRC menu item ID's '------------------------------------------------------------------------------------------------------------------- ,------------------------------------------------------------------------------------------------------------------- ; OpenMenu ; ; Function Usage: dll menuedit.dll OpenMenu N ; ; Returns Values: $null - There is no return value. ; ; Purpose: To give the ability of opening mIRC dialogs that can be accessed via the toolbar. ; ; Notes: This will open up dialogs of mIRC. It has the same effect of clicking on them through the menubar ; or from the toolbar. I will list them all out that are able to be opened. (Well, the toolbar ones) ; ; I'm sure other things might open if you start randomly sending numbers I've not confirmed, so do ; that at your own risk etc. ; ; Avialable IDs: 101 - This attempts to 'Connect' ('Disconnect' if you're connected) ; 102 - This opens the mIRC options dialog (alt+o) ; 103 - This opens the mIRC options dialog (alt+o) ; 105 - This opens the 'Channel Folder' dialog ; 106 - This opens the 'Channel List' (/list) dialog ; 107 - This opens the 'Aliases' section of the mIRC editor (alt+a) ; 108 - This opens the 'Popups' section of the mIRC editor (alt+p) ; 109 - This opens the 'Remote' section of the mIRC editor (alt+r) ; 112 - This opens the 'mIRC Finger' dialog (alt+g) ; 113 - This opens the 'mIRC Online Timer' dialog (alt+i) ; 114 - This opens the 'mIRC Font' dialog (alt+v) ; 115 - This opens the 'mIRC Colours' dialog (alt+k) ; 116 - This opens the 'mIRC Address Book' dialog (alt+b) ; 117 - This opens the 'DCC Send' dialog (alt+s) ; 118 - This opens the 'DCC Chat' dialog (alt+c) ; 119 - This opens the 'DCC' section of the mIRC options (alt+o) ; 120 - This opens the 'URL List' window ; 121 - This opens the 'Notify List' window ; 130 - This opens the 'Help' file ; 133 - This opens the 'About mIRC' dialog ; ; There are many more ID's I've found, mainly associated with the menubar, but I've not included ; them. I'll tell you this though, ID 104 performs /exit like from the menubar under 'File' so ; if you start to venture into guessing (like how I found them all), avoid that one =P '------------------------------------------------------------------------------------------------------------------- ,------------------------------------------------------------------------------------------------------------------- ; DllInfo ; ; Function Usage: dll menuedit.dll DllInfo . ; ; Purpose: Nothing, just information about the dll version and author. '------------------------------------------------------------------------------------------------------------------- ,------------------------------------------------------------------------------------------------------------------- ; » Worked Example #1 - A simple menu with submenus and items. ; ; medit.example { ; var %m,%mi,%sm ; %m = $Gettok($medit(AddMenu,ScriptaZ.com),6,32) ; medit AddMenuItem %m > Forums > run http://www.scriptaz.com/forum.php ; medit AddMenuItem %m > Screenshots > run http://www.scriptaz.com/screenshots.php ; medit AddMenuItem %m > break ; medit AddMenuItem %m > Who's online? > run http://www.scriptaz.com/online.php ; medit AddMenuItem %m > break ; %sm = $Gettok($medit(AddSubMenu,%m > Profiles),6,32) ; medit AddMenuItem %sm > GrimZ > run http://www.scriptaz.com/profile.php?user=GrimZ ; medit AddMenuItem %sm > ian > run http://www.scriptaz.com/profile.php?user=ian ; medit AddMenuItem %m > break ; %mi = $Gettok($medit(AddMenuItem,%m > Advertise menuedit! > msg $active I'm using menuedit v1.3b DLL by GrimZ!),7,32) ; if (!$server) medit UpdateMenuItem %mi > flag > grayed ; } ; ; Add this in aliases then type /medit.example ; ; » Worked Example #2 - A dynamic mock of mIRC's &File menu. ; ; medit.example2 { ; ; Create a fully dynamic menu ; ; ; Let's make the menu ; ; %m.1 = $Gettok($medit(AddMenu,&My File),6,32) ; ; ; Let's add some default items (and we will store their ids in a var (You'll see why ...) ; ; %mid.1 = $Gettok($medit(AddMenuItem,%m.1 > &Connect > server irc.solarchat.net),7,32) ; ; ; Now we check if we're connected or not ... ; ; if ($server) { ; medit UpdateMenuItem %mid.1 > text > &Disconnect ; medit UpdateMenuItem %mid.1 > cmd > quit menuedit.dll v1.33 r00lz ; } ; medit AddMenuItem %m.1 > break ; medit AddMenuItem %m.1 > Options... $chr(9) Alt+O > medit OpenMenu 103 ; medit AddMenuItem %m.1 > break ; medit AddMenuItem %m.1 > &Exit > exit ; } ; ; on 1:SIGNAL:MENU: { ; if ($1 == select) { ; if ($2 == %m.1) { ; if ($server) { ; medit UpdateMenuItem %mid.1 > text > &Disconnect ; medit UpdateMenuItem %mid.1 > cmd > quit menuedit.dll v1.33 r00lz ; } ; else { ; medit UpdateMenuItem %mid.1 > text > &Connect ; medit UpdateMenuItem %mid.1 > cmd > server irc.solarchat.net ; } ; } ; } ; } ; ; Now put the /medit.example2 in your aliases and the on SIGNAL in your remotes. Then type /medit.example2 ; Look at the menu, it's just like mIRC's. If you're disconnected from IRC, click 'Connect', once you're connected, ; look at the menu again. It's changed, just like mIRC's does. Click 'Disconnect' and then look at it again, it's ; re-changed, cool huh? '------------------------------------------------------------------------------------------------------------------- ,------------------------------------------------------------------------------------------------------------------- ; » Known Bugs ; ; None. '------------------------------------------------------------------------------------------------------------------- ,------------------------------------------------------------------------------------------------------------------- ; » Support ; ; 1. IRC: /server irc.extremexweb.com - #ScriptaZ / #PHP ; 2. Email - GrimZ@ScriptaZ.com '------------------------------------------------------------------------------------------------------------------- ,------------------------------------------------------------------------------------------------------------------- ; » Misc crap ; ; ALWAYS DOWNLOAD menuedit.dll FROM SCRIPTAZ.COM -- I do NOT release it elsewhere, and I take no responsibility if ; someone puts up a fake with my name on it and it's some type of virus or something. ; ; All builds, patches, releases, etc. will be posted on ScriptaZ.com only, no where else. ;-------------------------------------------------------------------------------------------------------------------