summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-07-09 15:38:35 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-07-09 15:38:35 +0000
commit6f7232fc9830161c2a2b2eee1adba92fd4108193 (patch)
tree5934f5c1ab02c0461ee47d818af8e625032647d1
parent700303c4a0b4cc5665bb4a8cb0efdf883aed7dbd (diff)
MirLua: added MessageBox to m_windows
git-svn-id: http://svn.miranda-ng.org/main/trunk@14517 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/MirLua/src/m_windows.cpp14
1 files changed, 14 insertions, 0 deletions
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 }