Page 1 of 1

Using WinAPI in Script Measure.

Posted: July 31st, 2013, 9:49 am
by GOST
How to use WinAPI in script?

Re: Using WinAPI in Script Measure.

Posted: July 31st, 2013, 11:20 am
by jsmorley
You can't.

Re: Using WinAPI in Script Measure.

Posted: July 31st, 2013, 5:36 pm
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.

Re: Using WinAPI in Script Measure.

Posted: July 31st, 2013, 5:57 pm
by Brian

Re: Using WinAPI in Script Measure.

Posted: July 31st, 2013, 6:11 pm
by GOST
Okay! :( Than, another question: can i working with Windows Registry?

Re: Using WinAPI in Script Measure.

Posted: July 31st, 2013, 9:32 pm
by jsmorley
No, you can't.

Sent from my Kindle Fire using Tapatalk 2

Re: Using WinAPI in Script Measure.

Posted: August 1st, 2013, 8:09 am
by GOST
OK, thanks for help.