RubbeR DuckY
March 28th, 2008, 03:52 PM
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
How can I parse lpCmdLine to get a filename passed if there are other command line parameters. For example, if the parameters are as follows:
/test /silent /play C:\test.wmv
How can I get the file name if I do not know where it will be. The way I do it in other languages is replace known command line parameters.
If /test exists, replace it with an empty string and set a variable.
If /silent exists, replace it with an empty string and set a variable.
If /play exists, replace it with an empty string and set a variable.
Now what I would be left with would be C:\test.wmv. Is there a better way to achieve this?
How can I parse lpCmdLine to get a filename passed if there are other command line parameters. For example, if the parameters are as follows:
/test /silent /play C:\test.wmv
How can I get the file name if I do not know where it will be. The way I do it in other languages is replace known command line parameters.
If /test exists, replace it with an empty string and set a variable.
If /silent exists, replace it with an empty string and set a variable.
If /play exists, replace it with an empty string and set a variable.
Now what I would be left with would be C:\test.wmv. Is there a better way to achieve this?