When debugging a large project it is sometimes convenient to print to a file. Instead of using fprintf and carrying around a file handle you can redirect stdout to a file and use printf.
As an example, at the top of WinMain
fclose(stdout);
*stdout = *fopen("c:\\debug.log", "w");
Then use printf throughout the project.
stdout is closed on exit but one could close it manually before one exits.
fclose(stdout);
I don't know if this is considered bad practice but it works.
John