From 6f7232fc9830161c2a2b2eee1adba92fd4108193 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Thu, 9 Jul 2015 15:38:35 +0000 Subject: MirLua: added MessageBox to m_windows git-svn-id: http://svn.miranda-ng.org/main/trunk@14517 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/MirLua/src/m_windows.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'plugins') diff --git a/plugins/MirLua/src/m_windows.cpp b/plugins/MirLua/src/m_windows.cpp index 82b3a40d9e..6277d5a82b 100644 --- a/plugins/MirLua/src/m_windows.cpp +++ b/plugins/MirLua/src/m_windows.cpp @@ -1,5 +1,17 @@ #include "stdafx.h" +static int lua_MessageBox(lua_State *L) +{ + ptrT text(mir_utf8decodeT(lua_tostring(L, 1))); + ptrT caption(mir_utf8decodeT(lua_tostring(L, 2))); + UINT flags = lua_tointeger(L, 3); + + int res = ::MessageBox(NULL, text, caption, flags); + lua_pushinteger(L, res); + + return 1; +} + static int lua_ShellExecute(lua_State *L) { ptrT command(mir_utf8decodeT(lua_tostring(L, 1))); @@ -14,6 +26,8 @@ static int lua_ShellExecute(lua_State *L) static luaL_Reg winApi[] = { + { "MessageBox", lua_MessageBox }, + { "ShellExecute", lua_ShellExecute }, { NULL, NULL } -- cgit v1.2.3