This is a sample piece of code showing the problem. I need to use the PostMessage function but i can't seem to get the symbol recognised. I've created a simple program to opening a win32 window which works fine but when i use either PostMessage or UnregisterClass they don't seem to be defined. I've check the D source and they are there but why does the compiler complain? I tried using the ascii and wide versions too.
import std.c.windows.windows;
extern(Windows):
void main(string[] Args)
{
PostMessage(0, WM_CLOSE, 0, 0);
PostMessageA(0, WM_CLOSE, 0, 0);
PostMessageW(0, WM_CLOSE, 0, 0);
}
Output:
Error: undefined identifier PostMessage
Error: undefined identifier PostMessageA
Error: undefined identifier PostMessageW
How can i use this function call in a D program?
std.c.windows.windows is very incomplete. Use the WindowsApi bindings project, instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With