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?

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


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: (it's a Microsoft file supplied by Borland including complete search index).