Hello,
the WIN32 API uses the stdcall calling convention, i.e. the stack pointer is adjusted by the called routine on return. This is not supported by GNU Pascal. Borland Pascal uses the keyword "stdcall" to specify this call format. This is needed for GNU Pascal, too.
Best regards, Peter Dietrich