It is currently March 28th, 2024, 11:48 am

Using WinAPI in Script Measure.

Discuss the use of Lua in Script measures.
Post Reply
User avatar
GOST
Posts: 4
Joined: July 31st, 2013, 9:31 am

Using WinAPI in Script Measure.

Post by GOST »

How to use WinAPI in script?
Last edited by GOST on August 1st, 2013, 8:10 am, edited 1 time in total.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Using WinAPI in Script Measure.

Post by jsmorley »

You can't.
User avatar
GOST
Posts: 4
Joined: July 31st, 2013, 9:31 am

Re: Using WinAPI in Script Measure.

Post by GOST »

jsmorley wrote:You can't.
But, what you say about this:

Code: Select all

 require "alien"

f = alien.Kernel32.Beep
f:types{ret = 'long', abi = 'stdcall', 'long', 'long' }
print(f(500, 100))
print(f(550, 100))
print(f(600, 300))

f = alien.Kernel32.ExpandEnvironmentStringsA
f:types{ret = "long", abi = 'stdcall', "string", "pointer", "long" }
local buffer = alien.buffer(512)
f("%USERPROFILE%", buffer, 512)
print("%USERPROFILE% - " .. tostring(buffer))

f = alien.User32.MessageBoxA
f:types{ret = 'long', abi = 'stdcall', 'long', 'string', 'string', 'long' }
print(f(0, "Привет, MessageBoxA (stdcall)!", "Заголовок", 64)) 
This is LUA code.
User avatar
Brian
Developer
Posts: 2673
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: Using WinAPI in Script Measure.

Post by Brian »

User avatar
GOST
Posts: 4
Joined: July 31st, 2013, 9:31 am

Re: Using WinAPI in Script Measure.

Post by GOST »

Okay! :( Than, another question: can i working with Windows Registry?
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Using WinAPI in Script Measure.

Post by jsmorley »

No, you can't.

Sent from my Kindle Fire using Tapatalk 2
User avatar
GOST
Posts: 4
Joined: July 31st, 2013, 9:31 am

Re: Using WinAPI in Script Measure.

Post by GOST »

OK, thanks for help.
Post Reply