diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2015-07-04 17:37:55 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2015-07-04 17:37:55 +0000 |
commit | 7a82eba37f1dd4567b16292bec78e6b07dd94fe4 (patch) | |
tree | c818cabfcb230aa6533ff0b3b0ee7102fb359036 /plugins/MirLua/src/m_windows.cpp | |
parent | f8d2adeb2908bfddb5ef5fa5a3347b0ed20e3ae4 (diff) |
MirLua: added module m_windows
git-svn-id: http://svn.miranda-ng.org/main/trunk@14489 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirLua/src/m_windows.cpp')
-rw-r--r-- | plugins/MirLua/src/m_windows.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/plugins/MirLua/src/m_windows.cpp b/plugins/MirLua/src/m_windows.cpp new file mode 100644 index 0000000000..82b3a40d9e --- /dev/null +++ b/plugins/MirLua/src/m_windows.cpp @@ -0,0 +1,27 @@ +#include "stdafx.h"
+
+static int lua_ShellExecute(lua_State *L)
+{
+ ptrT command(mir_utf8decodeT(lua_tostring(L, 1)));
+ ptrT file(mir_utf8decodeT(lua_tostring(L, 2)));
+ ptrT args(mir_utf8decodeT(lua_tostring(L, 3)));
+ int flags = lua_tointeger(L, 4);
+
+ ::ShellExecute(NULL, command, file, args, NULL, flags);
+
+ return 0;
+}
+
+static luaL_Reg winApi[] =
+{
+ { "ShellExecute", lua_ShellExecute },
+
+ { NULL, NULL }
+};
+
+LUAMOD_API int luaopen_m_windows(lua_State *L)
+{
+ luaL_newlib(L, winApi);
+
+ return 1;
+}
|