(SST) ShlWAPI.pas Version 1.08

Developer Reference
(SST)ShlWAPI PathGetArgs Function
Returns a pointer to the command line parameters/arguments (if present) in a path string.
Global (i.e. this function can be called/accessed from code in any unit that includes/uses (SST)ShlWAPI.pas).
function PathGetArgs(pszPath : LPCSTR) : LPSTR;
pszPath [in] Pointer to a zero-terminated path/command line string.
Return Values
Returns a pointer to the beginning of the command line parameters/arguments in the input string. If no command line parameters/arguments are present in the input string, a pointer to the end of the input string (pszPath) is returned.
PROCEDURE TForm4.TestShlWAPIPathGetArgs(Sender : TObject); VAR democmdline : STRING; VAR cmdlineargsp : PChar; VAR newinfoline : STRING; BEGIN democmdline := ''; cmdlineargsp := NIL; newinfoline := ''; //Fabricate a command line with fictious command line parameters democmdline := ParamStr(0) + ' -Arg1 /Arg2'; cmdlineargsp := PathGetArgs(PChar(democmdline)); newinfoline := 'PathGetArgs called with command line : "' + democmdline + '" returned '; Memo1.Lines.Add(newinfoline); newinfoline := cmdlineargsp; Memo1.Lines.Add(newinfoline); Memo1.Lines.Add(''); END;
The above example will produce an output similar to that shown below
PathGetArgs called with command line : "C:\Program Files\SSTShlWAPISamplesApp\TestShlWAPIFunctions3.exe -Arg1 /Arg2" returned -Arg1 /Arg2
Unit: Declared and imported in (SST)ShlWAPI.pas
Library: (SST)ShlWAPI.dcu/(SST)ShlWAPI.obj
Unicode: Implemented as ANSI (PathGetArgs and PathGetArgsA) and Unicode (PathGetArgsW) functions.
Min. ShlWAPI.dll version according to MS SDK doc.: 4.71
Min. ShlWAPI.dll version based on SST research: 4.71
Min. OS version(s) according to Microsoft SDK doc.: Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0.
Min. OS version(s) according to SST research.: Windows NT 4.0 with IE 4.0, Windows 95 with IE 4.0, Windows 98, Windows 2000 and later.
See Also
PathRemoveArgs, PathFindFileName, PathFindExtension, PathFindNextComponent, PathFindSuffixArray.
Windows APIs: PathGetArgs, PathFindSuffixArray, PathFindFileName, PathFindExtension, PathFindNextComponent

Document/Contents version 1.00
Page/URI last updated on May 04, 2022
Copyright © Stoelzel Software Technologie (SST) 2010 - 2017
Suggestions and comments mail to: