In Windows, there is a shlwapi. dll file that contains a large number of windows string processing methods.ProgramIt is often used in applications. Some processing methods also exist in cruntime, but it is not convenient to use. There are some functions and related Windows API functions, such as strcpy's string processing functions such as lstrcpy. From the shlwapi name, this should be a Windows Shell API function.
Shlwapi. DLL provides a lot of methods to process windows strings. These methods can make your work easier. Generally, we need to get the suffix of a file name and use the cstring of MFC to find the string, but it is troublesome. Everyone's implementation is different. The pathfindextension function provided in shlwapi directly returns a pointer with a suffix.
Shlwapi is mainly divided into three types of functions. The first type is string processing function, which usually starts with Str. The second type is path or folder processing function, which usually starts with path and the third type is registry processing function, it usually starts with SH. Each type of function must be divided into A and W.
Common string processing functions include:
Strchr, strchri, strcmpn, strcmpni, strcspn, strcspni, strdup, bytes (formatted in bytes), bytes, bytes, strncat, bytes, strrchr, strrchri, strrstri, strspn, strstr, strstri, strtoint, strtointex (hexadecimal string can be converted to 10 hexadecimal value), strtrim (delete trailing empty string), strcat, strcmp, strcpy, chrcmpi,
Common Path processing functions include:
Upload, pathaddextension, pathappend, begin, combine, pathcombine, pathcompactpath, pathcompactpathex, pathcommonprefix, pathfileexists, pathfindextension, pathfindfilename (similar to the part after the basename to obtain the entire file name ), pathfindnextcomponent (get all file names except drive letters), pathfindonpath, pathgetargs, pathgetchartype, pathgetdrivenumber, pathisdirectory, pathisfilespec (only file name part, not including: And \ symbols), pathisprefix, pathisrelative, pathisroot, pathissameroot, pathisunc, pathisuncserver, pathisuncservershare, pathiscontenttype, pathisurl,
Pathmakepretty, pathmatchspec, pathparseiconlocation, pathquotespaces, pathrelativepathto, pathremoveargs, pathremovebackslash, pathremoveblanks,
Pathremoveextension, pathremovefilespec, pathrenameextension, pathsearchandqualify, pathsetdlgitempath, pathskiproot, pathstrippath,
Pathstriptoroot, pathunquotespaces, pathmakesystemfolder, pathunmakesystemfolder, pathissystemfolder
Common registry processing functions include:
Shdeleteemptykey, shdeletekey, shdeletevalue, shgetvalue, shsetvalue, shqueryvalueex, shenumkeyex, shenumvalue, shqueryinfokey,
Shregcreateuskey, shregopenuskey, shregqueryusvalue, shregwriteusvalue, shregdeleteusvalue, shregdeleteemptyuskey, shregenumuskey,
Shregenumusvalue, shregqueryinfouskey, shreggetusvalue, shregsetusvalue, shreggetboolusvalue, shopenregstream,
Other functions
Create a GDI help Function
Shcreateshellpalette
Dllgetversionproc pointer, used to obtain the dll version number
And dllinstall prototype Definition
Stdapi dllinstall (bool binstall, lpcwstr psz1_line );