Take the 2-minute tour ×  I have an existing MFC application
which I'm trying to extend to accept command line parameters and
run unattended.  I need to kick off some events after the
InitInstance() has finished and the existing GUI has been fully
loaded. I've looked at winmain.cpp, but it's not clear to me how
to run my events as it seems to kick off a thread and
'disappear' from the debugger (i.e. what gets executed next?
Must be the MFC loop, right? Is it possible to hook into there?)
I'm new to this and it's entirely possible I'm missing something
insight at a higher level, which is not that easily googled.
Grateful for pointers.   share|improve this question add comment
3 Answers  I would parse the command line in InitInstance just
like usual, but instead of immediately processing all the
commands you find, add some special processing for the ones you
care about that (for example) post messages back to your own
message queue so when you're ready to start processing messages,
they'll show up as the first