The 3rd param to WinMain provides the command line as an unprocessed string. While that may be useful for allowing you to cope with expansion of wildcards and what-not, is there any chance that lurking somewhere in the Win32 API that there's a way to get the usual C argc, argv version of it?
WinMain is the conventional name used for the application entry point.
WINAPI is a macro that evaluates to __stdcall , a Microsoft-specific keyword that specifies a calling convention where the callee cleans the stack. The function's caller and callee need to agree on a calling convention to avoid corrupting the stack.
You can use CommandLineToArgvW()
to convert to an argv-style array of Unicode strings. Unfortunately, there is no ANSI-string version. Also, beware that this does not set argv[argc]
(i.e. the element after the last argument) to NULL.
microsoft speciffic:
__argc and __argv
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With