Not a Pelles C bug.
Problem is hereGetSystemMetrics( SM_CYCAPTION) - GetSystemMetrics( SM_CYSIZEFRAME)
Use linker subsystem version 5,1 or 5,2 to verify it.
Thank you for your help Timo.
I haven't yet found an explanation why "GetSystemMetrics( SM_CYCAPTION) - GetSystemMetrics( SM_CYSIZEFRAME)" causes the problem. I'll keep looking.
I can confirm that including a linker "/subsystem:windows,
5.01" or "/subsystem:windows,
5.02" using Pellesc 9.0 corrects the problem in the OP.
What I can say, is that the subsystem version number has always been OPTIONAL with Polink and is still that way with Pelles 9.00
/STUB:filename
/SUBSYSTEM:{CONSOLE|NATIVE|WINDOWS}[,#[.##]]/SWAPRUN:{CD|NET}
Omitting the subsystem version number in
Pelles C 8.00 and earlier still allowed Ian's test program to execute correctly.
Maybe that was just dumb luck.
Polink in Version 9 seems now to require a correct subsystem version number in order to
guarantee a correctly linked program.
As you and others know,
5.01 refers to Windows XP and
5.02 refers to Windows Server 2003.
Substituting either of those two WORKING subsystem versions numbers for anything newer (
6.00 Vista) to (
A00 Windows 10)
causes big problems.
I will update my batch files and resume using Pelles 9.00
Thanks again!