Deutsch | English | Español | Français |
Italiano | 日本語 | 한국어 | Português |
Pусский | 简体中文 | 繁體中文 |
Retrieves the command-line string for the current process.
Syntax
LPTSTR WINAPI GetCommandLine(void);
Parameters
This function has no parameters.
Return value
The return value is a pointer to the command-line string for the current process.
Remarks
ANSI console processes written in C can use the argc and argv arguments of the main function to access the command-line arguments. ANSI GUI applications can use the lpCmdLine parameter of the WinMain function to access the command-line string, excluding the program name. The main and WinMain functions cannot return Unicode strings.
Unicode console process written in C can use the wmain or _tmain function to access the command-line arguments. Unicode GUI applications must use the GetCommandLineW function to access Unicode strings.
To convert the command line to an argv style array of strings, call the CommandLineToArgvW function.
Requirements
Minimum supported client |
Windows XP [desktop apps | UWP apps] |
---|---|
Minimum supported server |
Windows Server 2003 [desktop apps | UWP apps] |
Header |
|
Library |
|
DLL |
|
Unicode and ANSI names |
GetCommandLineW (Unicode) and GetCommandLineA (ANSI) |
See also