Windows Shell declarations for folder-path lookup through caller-supplied UTF-16 storage.
Constants
Folder identifiers and path selection
| Name | Value | Meaning |
|---|---|---|
CSIDL_APPDATA | 0x001A | Per-user application-data folder identifier. |
SHGFP_TYPE_CURRENT | 0 | Selects the current folder path. |
SHGFP_TYPE_DEFAULT | 1 | Selects the default folder path. |
Constant example
"control" use
"windows/shell32" use
{} () {} [
CSIDL_APPDATA printStack _:;
SHGFP_TYPE_CURRENT printStack _:;
SHGFP_TYPE_DEFAULT printStack _:;
] "main" exportFunction
Expected Output During Compilation
26
0
1
Imported functions
Stack effects list a C function's parameters with the first parameter on top; see importFunction.
SHGetFolderPathW
(pszPath dwFlags hToken csidl hwnd -- result) Retrieves a Shell folder path.Inputs
pszPath:Natxaddress of caller-owned writable storage for at least 260 UTF-16 code units; on success the call writes a zero-terminated folder path.dwFlags:Nat32path-selection value; cast theInt32constants before passing them, for exampleSHGFP_TYPE_CURRENT 0n32 cast.hToken:Natxaccess-token handle, or0nxfor the current user.csidl:Int32CSIDL folder identifier such asCSIDL_APPDATA.hwnd:HWNDreserved; pass aNILHWND.
Outputs
result:Int320on success, or a nonzero status otherwise.
Signature example
Printing @SHGetFolderPathW during compilation shows its imported Code signature.
"control" use
"windows/shell32" use
{} Int32 {} [
@SHGetFolderPathW printStack _:;
0
] "main" exportFunction
Expected Output During Compilation
{hwnd: {WND: (); unused: Int32;} Cref; csidl: Int32; hToken: Natx; dwFlags: Nat32; pszPath: Natx;} Int32 {convention: "";} codeRef
See also
- windows/unicode: UTF-8 to zero-terminated UTF-16 conversion helper.
- windows/user32: User32 windowing, message, cursor, monitor, and device-context declarations.