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, 1);
    const char* caption = luaL_optstring(L, 2, "");
    int result = MessageBoxA(NULL, message, caption, MB_OK);
    lua_pushnumber(L, result);
    return 1;
}

int __declspec(dllexport) libinit(lua_State* L)
{
    lua_register(L, "msgbox", lua_msgbox);
    return 0;
}

 

上一篇:Windows核心编程_Miniblin(6) 前后端交互数据


下一篇:c# – asp.net的确认消息BOx功能?