WPM_initDll() WPM_createPopupMenu(border color) WPM_showPopupMenu(x, y) : returns the selected item or 0 if no item was selected WPM_destroyPopupMenu() WPM_setItemFontSel(item index(zero based), font family, font size) WPM_setItemFontNotSel(item index, font family, font size) WPM_setItemsSize(width, height) : auto if not used WPM_setItemIcon(item index, bitmap file name) WPM_appendMenu(text) : returns item index (zero based) WPM_setItemColors(item index, txton, txtoff, bkon, bkoff) WPM_freeDll() extra WPM_setItemsToDefaultStyle(index begin, index end) WPM_appendMenu2(string "item1|item2|item3")
completed project gm6 + gm7 :
download GM Custom Popup Menu
The dll no longer uses a windows hook
it's more robust
i've made two dll's with exactly the same functions (neither use a hook)
the difference is that WPM.dll will not prevent the mouse up events when the user chooses not to select an item
and WPM2.dll will take care of that. there might be different circumstances where you'd want to choose one over the other
Original Post :
I've made a dll that allows you to create a windows popup menu in the following ways :
set colors of text and background for individual selected / deselected menu items
set style of font for individual selected items
set style of font for individual unselected items
add a bitmap image as an icon for specified items with the bottom left corner defining the transparent colour
set the size of all items
show the popup menu and get the item selected
I really made this so i could have a custom popup menu in the game i'm working on.
It seems to work well but it's the second dll i've made so i'm probably very mistaken.
i can't spot any problems with it but i've also just completed it and tested it on one computer.
hope this is a legit dll for this forum area. there's probably a better way of programming this but i'm happy with the way it runs on my pc. the thing i don't like about it is i used a windows hook to handle the clicking issues on a popup menu's destruction. well, anyway, i'd appreciate somebody having a look at it and notifying me of any errors and by all means use the dll if you like it . or if there's a better implementation of a styled popup i'd like to have a look.
Edited by doug25, 22 November 2009 - 09:54 AM.