Essentially what you're trying to do is the reverse of what I described in https://stackoverflow.com/a/6882500/524368
Your code examples use WinMain
for the entry point but changing to the console subsystem by defaults uses the int main(int argc, char *argv[])
entry point as defined by the C standard.
So you can use this
/SUBSYSTEM:console
/ENTRY:WinMainCRTStartup
Or use the following #pragma in the source file with the WinMain
#pragma comment(linker, "/SUBSYSTEM:console /ENTRY:WinMainCRTStartup")