Strange, ok, try adding,
#include <winbase.h>
after
#include <windows.h>
That should fix the first three errors.
The last error is a result of you trying to execute the C code directly. You have to save those two files in the same folder and compile/run test.bmx.