• Welcome to Valhalla Legends Archive.
 

Plugin Problem

Started by Blaze, April 17, 2005, 02:08 PM

Previous topic - Next topic

Blaze

Okay, I am making plugins for my bot, and they create menus on the main form of my bot. I need to make that menu's onclick goto code in the plugin, how would I go about doing this?
Quote
Mitosis: Haha, Im great arent I!
hismajesty[yL]: No

UserLoser.

Just have the plugin hook the main window and the plugin create the menu.  In your message hook, watch for WM_COMMAND message and look for when your menu is commanded (clicked, pressed) then do the appropriate actions in your plugin

Networks

Out of curiosity how exactly does your plugin create a menu? What did you do to do this?

UserLoser.

#3
The plugins I write are BinaryChat Plugins, which I use on SphtBot.  All I simply do is: API.GetMenu(PluginAPI::MainWindowMenu), and from I use the PluginMenu package inside the plugin to do whatever you wish.

Otherwise, pass the window handle over to your plugin, then use GetMenu, AppendMenu, CreateMenu, InsertMenuItem, etc.  Also, use SetWindowsHookEx and UnhookWindowsHookEx to hook and unhook the window.