Griga Posted August 29, 2003 Share Posted August 29, 2003 As announced in this thread - here it is: The new menu creator plugin for the DVBViewer (full version only, sorry). It allows to create your own menu structure in the Plugins Menu, with menu items that launch programs, open files or folders, switch over to channels... with submenus and sub-submenus (up to 9 levels)... maybe you'll find even more possibilties. What you have to do: Put the MenuCreator.dll into the DVBViewer\Plugins folder and create a little textfile there (can be done with any text editor), that defines the menu structure. The file must be stored under the name MenuList.ini in the Plugins folder and may look like this: ITEM Item without any paramter creates a separator line in the menu This line and the line above are regarded as comments and do nothing ITEM Open DVBViewer Folder|C:\Programme\DVBViewer ITEM MPEG2Cut|C:\Programme\MPEG2Cut\MPEG2CUT.exe SUBMENU Radio Favorites ITEM Rock Antenne|DVBViewer.exe|-cROCK ANTENNE:160 ITEM Paris Jazz|DVBViewer.exe|-cParis Jazz:8535 ITEM RTL Francais|DVBViewer.exe|-cRTL:8528 END SUBMENU Video Favorites ITEM Stadtgespräch|E:\Videos\Stadtgespräch.mpg ITEM Dick und Doof|E:\Videos\Dick und Doof.avi END ITEM The menu items have the following format: ITEM Caption|Command|Parameters where "Caption" is what you see in the menu. "Command" specifies the command to be executed, or file to be opened, and "Parameters" any command line parameters that are passed to the called program (may be left out). Well, it's quite simple - just have a try, and you will see how it works. I will upload the DLL in the following posting (Delphi source included). The screenshot shows the result of the menu script above: Quote Link to comment
Griga Posted August 29, 2003 Author Share Posted August 29, 2003 ...and here is the uploaded ZIP, containing the DLL and the Delphi 6 source. Some additional hints: - Caption, Command and Parameters have to be separated by the "|" character (pipe). - If you do not specify a path for the program/file to be executed/opened, the plugin assumes that it is in the DVBViewer folder. - If you specify no command at all, the plugin assumes DVBViewer.exe. The following line creates a menu item that switches the DVBViewer to standby mode (no channel tuned): ITEM DVBViewer Standby||-c Please don't blame me if there are bugs - the MenuCreator plugin is just a quick and dirty hack If you encounter a bug, report it here, and it will be fixed. And if there are questions, ask. Enjoy! Griga MenuCreator.zip Quote Link to comment
vrodo Posted August 29, 2003 Share Posted August 29, 2003 Hey Griga, Thank you for this wonderful Plugin, it works great and gave me a new idea for my little program. More on this topic inthis thread. Gruß, Vrodo Quote Link to comment
Griga Posted September 1, 2003 Author Share Posted September 1, 2003 Two additional hint for creating your own menus: - You can make a menu item selectable via keyboard by using the ampersand character '&': Example: ITEM Open &DVBViewer Folder|C:\Programme\DVBViewer After this, the letter 'D' appears underlined in the menu, and the item can be selected by pressing [D] on your keyboard (after the menu has been opened, of course). - If you use several plugins, you can change the menu order by renaming the DLLs in the Plugins folder. E.g. if you want the entries created via the MenuCreator.dll to appear topmost in the Plugins menu, just rename it to AAMenuCreator.dll, so it becomes first in alphabetical order. That won't work with plugin-DLLs that rely on their name, but usually there should be no reason for that (the ones I have written don't), and the DVBViewer doesn't mind... Griga Quote Link to comment
Griga Posted September 3, 2003 Author Share Posted September 3, 2003 Well, here we go again... I've spent some more time hacking the DVBViewer menus, and I suggest, that you first have a look at the attached picture. You'll see the DVBViewer context menu there - but wait: If you have a closer look, you'll see something that should not be there: A Radio Favorites submenu. How did it get there? Actually, it is *not* the DVBViewer context menu - though it functions almost in the same way. It's an imitation that replaced the original. OK, I think you already know what's going on: There is a new version 1.5 of the MenuCreator Plugin (download link see above, Delphi source included). Some tricky things had to be done in the plugin (e.g. installing a message hook to catch Windows messages before the DVBViewer sees them), in order to provide the following features: In the menu script you may define your own popup menu, that appears after clicking the DVBViewer window with the middle mouse button. You may define your own context menu, that appears after right-clicking the DVBViewer window. It replaces the original context menu. However, the original still can be accessed via the tray icon or by holding down the shift key while right-clicking. In the menu script you may use all DVBViewer functions that are listed under Options/Control. Now let's see how it is done. In the menu script some more identifiers can be used: All items/submenus between a PLUGINS and PLUGINS END statement appear in the DVBViewer's Plugins Menu. In order to keep compatibility with the former version, PLUGINS is by default switched on at the beginning of the script. Thus the script has to begin with PLUGINS END, if you don't want your menu items to appear in the Plugins Menu. All items/submenus between POPUP and POPUP END appear in the "middle mouse button" popup menu. All items/submenus between CONTEXT and CONTEXT END appear in a new context menu. that replaces the original. In the new ZIP you'll find a sample script (see ContextMenu.ini), that contains a fairly complete imitation of the original DVBViewer context menu. You may use it as a base for own scripts Commands, that perform one of the DVBViewer's control functions are identified by numbers. The new ZIP download contains the text file DVBCommands.inc, that lists all numbers for all available DVBViewer functions. The file is "designed" for Delphi programmers, which may use these numbers for remote-controlling the DVBViewer. Now have a look at the following sample script, and you will know... ITEM // The line above creates a separator line in the menu // The following lines call two DVBViewer functions by numbers // The second one is included in the popup menu ITEM Videotext|135 POPUP ITEM EPG Window|137 POPUP END SUBMENU Radio Favorites POPUP // Now the channels by using the -cName:Service-PID format ITEM Rock Antenne|DVBViewer.exe|-cROCK ANTENNE:160 ITEM Paris Jazz|DVBViewer.exe|-cParis Jazz:8535 ITEM RTL Francais|DVBViewer.exe|-cRTL:8528 POPUP END END ITEM The whole stuff will appear in the Plugins Menu, as usual. Additionally the Radio Favorites will appear in the "middle mouse button" popup menu, but - please note - not as a submenu, because the submenu statement is not included in the POPUP... POPUP END part. The CONTEXT... CONTEXT END statements may be used in the same way. OK, that's most of it - the rest is up to your creativity. The plugin has become more sophisticated, the menu scripting too... I hope you don't mind. If you want to have a list of 20 favorite channels in a menu, accessible in full screen mode - now you can have it! Let's see how it works on your computer (especially the tricky techniques I had to use). If you encounter any problems, post them here, and we will solve them... Griga Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.