Tuesday, September 21, 2010

Using Shortcut Flags for MFC Applications

If you've ever messed around with a shortcut's settings, you've probably noticed that some shortcuts include flags after the target path. Generally, they look something like this:



If we want to use those flags in our MFC applications, this can easily be done by accessing the LPCSTR m_lpCmdLine parameter from the application's class. The flag set in the above shortcut would give that parameter the following value:

-testFlag