Subjects WinMenu DLL Version 0.1

Introduction

WMMark
WMCreateMenuBar
WMCreateSubMenu
WMSetItem
WMSetSubMenu
WMSetMenu
WMIsMenuID
WMMenuIDStyle
Events
Version
Futur Expansions
 

>> Introduction



This DLL lets you add a menubar (File Edit ...) in a mIRC @window. The syntax to create the menu is quite simple and you receive the events of the menu ID clicks by a mIRC signal. There ie no limit on the number of sub-menus to create. You can enable/disable or/and check/uncheck a menu item with a command.

N.B. You can only have a menubar in a window that is not a Child window. So basically you could put a menu in a channel window if it wasn't a child window (i.e. a desktop window).

Important: Every command in the DLL returns a message that is of 2 possible kind when used with $dll():

S_OK <optionnal data> - Message indicating succes with optionnal data or message

S_ERROR <error message> - Message indicating Error with error message

>> WMMark



This command let's you mark the @window so you can receive the menu ID messages when a menu item is clicked.

Command:

/dll WinMenu.dll WMMark $window(@win).hwnd @win
$dll(WinMenu.dll,WMMark,$window(@win).hwnd @win)

Succes Return Value:

S_OK

>> WMCreateMenuBar



Creates an empty menubar.

Command:

$dll(WinMenu.dll,WMCreateMenuBar,.)

Succes Return Value:

S_OK HMENU

where HMENU is the Menubar Handle used to attach the menu to the Window.

>> WMCreateSubMenu



Creates an empty submenu.

Command:

$dll(WinMenu.dll,WMCreateSubMenu,.)

Succes Return Value:

S_OK HSMENU

where HSMENU is the SubMenu Handle used to attach the menu to the menubar or another menu (nested submenus).

>> WMSetItem



Command to add a menu item to the specified menu.

Command:

/dll WinMenu.dll WMSetItem HSMENU > ID STYLE TEXT
$dll(WinMenu.dll,WMSetItem,HSMENU > ID STYLE TEXT)

  • ID - Menu Item ID (1 - 500)
  • STYLE - Menu Item Style (0 - normal, 1 - disabled, 2 - checked, 3 - disabled+checked)
  • TEXT - Menu Item Text
N.B. To create a Menu Separator : HSMENU > 0 0 -

Succes Return Value:

S_OK

>> WMSetSubMenu



This function attaches a submenu onto a menu item. The menu item can be part of the Menu Bar (HMENU) or another submenu (HSMENU).

Command:

/dll WinMenu.dll WMSetSubMenu [HMENU|HSMENU] > HSMENU2 TEXT
$dll(WinMenu.dll,WMSetSubMenu,[HMENU|HSMENU] > HSMENU2 TEXT)

  • HMENU|HSMENU - Parent Menubar or Submenu Handle
  • HSMENU2 - Submenu Handle
  • TEXT - Menu Item Text
Succes Return Value:

S_OK

>> WMSetMenu



This function attaches the Menubar to the @window.

Command:

/dll WinMenu.dll WMSetMenu $window(@win).hwnd > HMENU
$dll(WinMenu.dll,WMSetMenu,$window(@win).hwnd > HMENU)

Succes Return Value:

S_OK

>> WMIsMenuID



This function returns true or false whether de ID is a menu ID or not.

Command:

/dll WinMenu.dll WMIsMenuID $window(@win).hwnd > ID
$dll(WinMenu.dll,WMIsMenuID,$window(@win).hwnd > ID)

Succes Return Value:

S_OK $true|$false

>> WMMenuIDStyle



This function changes the Menu Item Style.

Command:

/dll WinMenu.dll WMMenuIdStyle $window(@win).hwnd > ID STYLE
$dll(WinMenu.dll,WMMenuIdStyle,$window(@win).hwnd > ID STYLE)

  • ID - Menu Item ID
  • Style - Menu Item Style (0 - normal, 1 - disabled, 2 - checked, 3 - disabled+checked)
Succes Return Value:

S_OK

>> Events



You receive a signal event when a menu item is clicked.

Format:

ON *:SIGNAL:WMENU: { 
  echo -a WMENU SIGNAL $1-
}
  • $1 - Window Name
  • $2 - Menu Item ID

>> Version



Returns information on the DLL Version.

>> Future Expansions



Futur Exapnsions include being able to:
  • manage dynamically the menus by inserting, deleting or moving items in the menus
  • inserting menu icons
  • maybe owner drawn menus
This project may also lead to a custom Popup Menu DLL later on.

WinMenu DLL



- ClickHeRe
- © 2003
- Testing-> Artwerks
- #scriptsdb.org @ Undernet @ Webnet
- http://scriptsdb.org


Tha... Help SDB mIRC Group Contact