Sorry, I found my error, I made this : alias extern(C) BOOL function(HWND, DWORD) REGISTERSHELLHOOKPROC; It looks like it's working (the generated code is the right code).