Skit3000 Admin Team
Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Sat Sep 06, 2003 7:11 pm Post subject: Define DLL calls |
|
|
Hello all,
I've made a little tool to easily add API functions into your VDS 5 program. You only have to fill in the fields, and press the "Generate" button. Then paste it into VDS, so you can call the functions by only mentioning the name, without all the @lib() headers. You can download it [ here ].
Example (from Microsoft's MSDN):
Code: | int MessageBoxA(
HWND hWnd,
LPCTSTR lpText,
LPCTSTR lpCaption,
UINT uType
); |
After inserting the above into my tool, you get this:
Code: | #define function,MessageBoxA
:MessageBoxA
exit @lib(user32.dll,MessageBoxA,INT:,INT:@strdel(@winexists(@dlgtext()),1,1),STR:%1,STR:%2,INT:%3) |
Then just copy the #define line to the top of your file, and the lines below to the bottom of your script, and it is ready to be called.
Example:
Code: | #define function,MessageBoxA
DIALOG CREATE,New Dialog,-1,0,240,160
DIALOG SHOW
loadlib user32.dll
%z = @MessageBoxA("Does this work?","Hello world!",4)
if @equal(%z,6)
info You clicked yes!
else
info No? Why not?
end
freelib user32.dll
exit
:MessageBoxA
exit @lib(user32.dll,MessageBoxA,INT:,INT:@strdel(@winexists(@dlgtext()),1,1),STR:%1,STR:%2,INT:%3) |
_________________ [ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial! |
|