// http://wiki.teamliquid.net/starcraft/BWL4_Plugin_Format_Specification // Sample BWL4 Plugin // BOOL is a 32Bit Value // All BWL4 functions are C-CallingConvention(cdecl) not stdcall #define BWLAPI 4 #define STARCRAFTBUILD 8 /* STARCRAFTBUILD -1 All 0 1.04 1 1.08b 2 1.09b 3 1.10 4 1.11b 5 1.12b 6 1.13f 7 1.14 8 1.15 9 1.15.1 10 1.15.2 11 1.15.3 12 1.16.0 13 1.16.1 */ struct ExchangeData { int iPluginAPI; int iStarCraftBuild; BOOL bNotSCBWmodule; //Inform user that closing BWL will shut down your plugin BOOL bConfigDialog; //Is Configurable }; BOOL APIENTRY DllMain( HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { //Is this DLL also StarCraft module? /* switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: MessageBox(NULL, "StarCraft messagebox", "Hue", MB_OK); return TRUE; case DLL_THREAD_ATTACH: case DLL_THREAD_DETACH: case DLL_PROCESS_DETACH: break; } */ return TRUE; } // // GetPluginAPI and GetData get called during the startup of the Launcher and gather information about the plugin // extern "C" __declspec(dllexport) void GetPluginAPI(ExchangeData &Data) { // BWL Gets version from Resource - VersionInfo Data.iPluginAPI = BWLAPI; Data.iStarCraftBuild = STARCRAFTBUILD; Data.bConfigDialog = false; Data.bNotSCBWmodule = true; } extern "C" __declspec(dllexport) void GetData(char *name, char *description, char *updateurl) { // if necessary you can add Initialize function here // possibly check CurrentCulture (CultureInfo) to localize your DLL due to system settings strcpy(name, "Plugin"); strcpy(description, "Author lala\r\n\r\nDescription of this plugin. This plugind does this and that."); strcpy(updateurl, "http://www.bwprogrammers.com/files/update/bwl4/plugin/"); } // // Called when the user clicks on Config // extern "C" __declspec(dllexport) BOOL OpenConfig() { // If you set "Data.bConfigDialog = true;" at function GetPluginAPI then // BWLauncher will call this function if user clicks Config button // You'll need to make your own Window here return true; //everything OK } // // ApplyPatchSuspended and ApplyPatch get // called during the startup of Starcraft in the Launcher process // the hProcess passed to them is shared between all plugins, so don't close it. // Best practice is duplicating(DuplicateHandle from Win32 API) it if you want to use if after these function returns extern "C" __declspec(dllexport) bool ApplyPatchSuspended(HANDLE hProcess, DWORD dwProcessID) { // This function is called in the Launcher process while Starcraft is still suspended // Durning the suspended process some modules of starcraft.exe may not yet exist. return true; //everything OK } extern "C" __declspec(dllexport) bool ApplyPatch(HANDLE hProcess, DWORD dwProcessID) { // This function is called in the Launcher process after the Starcraft window has been created return true; //everything OK }