LB_DIR

2.x

LB_DIR
wParam = (WPARAM) (UINT) uAttrs;         /* file attributes           */
lParam = (LPARAM) (LPCSTR) lpszFileSpec; /* filename string's address */

An application sends an LB_DIR message to add a list of filenames to a list box.

Parameters

uAttrs

Value of wParam. Specifies the attributes of the files to be added to the list box. It can be any combination of the following values:

Value Meaning

0x0000 File can be read from or written to.
0x0001 File can be read from but not written to.
0x0002 File is hidden and does not appear in a directory listing.
0x0004 File is a system file.
0x0010 The name pointed to by the lpszFileSpec parameter specifies a directory.
0x0020 File has been archived.
0x4000 All drives that match the name specified by the lpszFileSpec parameter are included.
0x8000 Exclusive flag. If the exclusive flag is set, only files of the specified type are listed. Otherwise, files of the specified type are listed in addition to files that do not match the specified type.

lpszFileSpec

Value of lParam. Points to the null-terminated string that specifies the filename to add to the list. If the filename contains wildcards (for example, *.*), all files that match and have the attributes specified by the uAttrs parameter are added to the list.

Return Value

The return value is the zero-based index of the last filename added to the list. The return value is LB_ERR if an error occurs; the return value is LB_ERRSPACE if insufficient space is available to store the new strings.

Example

This example adds the names of all available drives to a list box:

DWORD dwIndexLastItem;

dwIndexLastItem = SendDlgItemMessage(hdlg, ID_MYLISTBOX, LB_DIR,
    0x4000 | 0x8000, (LPARAM) ((LPCSTR) "*"));

See Also

DlgDirList