Tutorial - HelloCmd


Overview
In this first tutorial we'll create perhaps the simplest plugin possible in messiah, we will create a command that will use the built in Function Module MessageBox to display a message box that says "Hello World!".
Step 1 Create Project
Following the procedures from Concepts - Compiling, create a new project for whatever compiler you're using. Name this project "HelloCmd".
Step 2 Create Files
Since this is going to be such a simple plugin we're going to just put everything in one source file. Go ahead and create a source file called PluginMain.c.
Source
Here's all the code that's needed to create this plugin:

#define _MESSIAH_FULL_API
#define _MAINPLUGIN_FILE
#include <messiah_main.h>
 
_pluginEntry
{
    _MESSIAH_PLUGIN_ALL("Hello_Command");
 
    fxCommandRegister("Hi", FX_COMCLASS_GENERAL, "MessageBox(\"Hello World!\", 0)", 0);
 
    return FX_PLUGIN_OK;
}
The next tutorial will describe in detail much of how this code works. Once you have compiled this plugin and placed it in your PLUGINS directory, start messiah and type 'Hi' in the command port. You should be greeted with a message box that says "Hello World!". You will also find a command listed in Customize->Key Command Manager under the General section called "Hi". From there you can assign this command to a hot key. For more information about commands see Command Modules.


© 2003 pmG WorldWide, LLC.


www.projectmessiah.com

groups.yahoo.com/pmGmessiah

Last Updated on Thu Jul 10 04:49:37 2003