I now have a mild hangover and I noticed I forgot to ZeroMemory() in the above procedure.

I've never heard of KOL. Could it be used within the IDE? (I'm not sure you'll get what I mean.)

Years ago, as an experiment, I made a complete text editor with nothing but pure Win32. The binary was something like 6k smaller than the MSVC 6 version of the same program.