www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Calling a DLL

reply n00b <n00b nospam.com> writes:
I'm not familiar with DLLs, I would like to know how can I call a 
function in User32.dll ? (specifically, RegisterWindowMessage)
Thank you for any help!
Apr 25 2011
parent reply Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
You'll need a couple of things:

Link with the user32.dll import library, which is located in
Either pass it to DMD during compilation or more simply just can add a
pragma(lib) in your source file like so:
pragma(lib, "user32.lib");

And you need the function prototype. for windows api it needs the
extern(Windows) calling convention. So your code would look like:

You are better off using the WindowsAPI bindings project, which
includes almost all windows api function prototypes. You can download
and read about it here:
Apr 25 2011
parent n00b <n00b nospam.com> writes:
Thanks a lot!
Apr 26 2011