Quote Originally Posted by adeyblue View Post
Unless outputCSV() spawns a thread I don't see why you'd want it to stall, as your program has finished doing it's work. That assumes what you posted is the entirety of your WinMain. Given those two conditions, you'll need to wait for it to the spawned thread to finish before exiting your app (WaitForSingleObject or whatever joining capability your thread api exposes).
outPutCSV() doesn't spawn a thread, It extracts some RCDATA, accesses the registry, saves to a CSV file and that's it.

I'm not sure if I've managed to get my point across. Consider the following:

From a cmd prompt, I run calc. The calc.exe process runs, and I can interact with it. Yet, the command prompt has returned. If calc.exe were a console app, the prompt would not be usable until main() from calc.exe returns.

I want to achieve console app behavior with my Windows app, but only when command line params are passed.

Quote Originally Posted by adeyblue View Post
DialogBox implements it own message loop, adding another one would be redundant if no other windows are created.
No other windows are created.