lua 5.3最简单plugin编写

时间:2023-03-09 13:43:00
lua 5.3最简单plugin编写
#include <windows.h>
#include "lauxlib.h" /* Pop-up a Windows message box with your choice of message and caption */
int lua_msgbox(lua_State* L)
{
const char* message = luaL_checkstring(L, );
const char* caption = luaL_optstring(L, , "");
int result = MessageBoxA(NULL, message, caption, MB_OK);
lua_pushnumber(L, result);
return ;
} int __declspec(dllexport) libinit(lua_State* L)
{
lua_register(L, "msgbox", lua_msgbox);
return ;
}