0

Does anyone know how to have a windows program accept command line options?

For example a terminal program just needs a parameter in the main function to accept command line parameters, how can I do the same for a windows main functions, since parameters are already there?

2
Contributors
2
Replies
3
Views
12 Years
Discussion Span
Last Post by BountyX
0

From the Win32 API reference (as supplied by Microsoft):

int WINAPI WinMain(

    HINSTANCE hInstance,	// handle to current instance
    HINSTANCE hPrevInstance,	// handle to previous instance
    LPSTR lpCmdLine,	// pointer to command line
    int nCmdShow 	// show state of window
   );

lpCmdLine

Points to a null-terminated string specifying the command line for the application.

You're not getting it as a nice array of commandline arguments but you are getting it.

Full helpfile is available here: http://www.borland.com/devsupport/borlandcpp/patches/BC52HLP1.ZIP (it's a Microsoft file supplied by Borland including complete search index).

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.