One reason it got bigger when you changed WinMainCRTStartup() to main() is that you are now bringing in chunks of the C runtime library startup code. When your program runs normally (either a WinMain() program or a main() program) WinMain/main isn't the first function that's called. Usually there's a stub tacked on the front, called crt0.o or something similar, which does all the initialisation for the stack, the heap, file handles, the clock, program arguments, and the rest of the C runtime, and the very last thing it does is call WinMain or main. By having WinMainCRTStartup in a Windows program you avoid having the runtime startup in there because you've overridden it, but then if you try calling C functions or much other stuff it will barf. Sometimes you can find out the name of the function before main() in a non-Windows program and override that too.
So that's the size problem.
It doesn't look to me like the stack would get messed up, but there's a problem with the PIXELFORMATDESCRIPTOR. The code assumes the stack has all 0s in it at least, so that pfd is all blank. I think Windows might guarantee that, else it might let you look at the stack from some old program that just ran which could be a security issue, but I wouldn't know for sure. Even then though, that's wrong. I would think you'd have to add this to be totally sure, even if it was all 0s.
pfd.nSize = sizeof(PIXELFORMATDESCRIPTION);
pfd.nVersion = 1;
Then there's the CreateWindow. It's being subclassed off an "edit" style window (like text boxes), which is probably OK, and means there'll be a basic message pump happening, but the Windows API doesn't say what happens when you pass a caption of NULL and width and height of 0,0. I suspect that's OK, especially since WS_POPUP windows have no caption. I also don't know whether "edit" style windows have CS_OWNDC class style, so the fact that ReleaseDC isn't called might be significant - if it doesn't let's hope Windows doesn't try drawing to our window. That bit right there is a cute but nasty hack

There's also no clean up at the end, but I guess that's to be expected

Jim