please dont rip this site Prev Next

DlgDirList info  Overview  Group

The DlgDirList function fills the specified list box with the names of all files matching the specified path or filename.

int DlgDirList(

    HWND hDlg,

// handle to dialog box with list box

    LPTSTR lpPathSpec,

// pointer to path or filename string

    int nIDListBox,

// identifier of list box

    int nIDStaticPath,

// identifier of static control

    UINT uFileType 

// file attributes to display



Identifies the dialog box that contains the list box.
Points to a null-terminated string that contains the path or filename. DlgDirList modifies this string, which should be long enough to contain the modifications. For more information about this parameter, see the Remarks section.
Specifies the identifier of a list box. If this parameter is zero, DlgDirList assumes that no list box exists and does not attempt to fill one.
Specifies the identifier of the static control used for displaying the current drive and directory. If this parameter is zero, DlgDirList assumes that no such control is present.
Specifies attributes of the filenames to be displayed. This parameter must be one or more of the following values:




Includes archived files.


Includes subdirectories. Subdirectory names are enclosed in square brackets ([ ]).


Includes drives. Drives are listed in the form [-x-], where x is the drive letter.


Includes only files with the specified attributes. By default, read-write files are listed even if DDL_READWRITE is not specified.


Includes hidden files.


Includes read-only files.


Includes read-write files with no additional attributes.


Includes system files.


Posts messages to the application’s message queue. By default, DlgDirList sends messages directly to the dialog box procedure.

Return Values

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. For example, if the string specified by lpPathSpec is not a valid path, the function fails. To get extended error information, call GetLastError.


If you specify a zero-length string for the lpPathSpec parameter or if you specify only a directory name with no filename, the string will be changed to *.*

The lpPathSpec parameter has the following form:

[drive:] [[\u]directory[\idirectory]\u] [filename] 

In this example, drive is a drive letter, directory is a valid directory name, and filename is a valid filename that must contain at least one wildcard (? or *).

If lpPathSpec includes a drive or directory name, or both, the current drive and directory are changed to the specified drive and directory before the list box is filled. The static control identified by the nIDStaticPath parameter is also updated with the new drive or directory name, or both.

After the list box is filled, DlgDirList updates lpPathSpec by removing the drive or directory portion, or both, of the path and filename.

DlgDirList sends the LB_RESETCONTENT and LB_DIR messages to the list box.

See Also

DlgDirListComboBox, DlgDirSelectComboBoxEx, DlgDirSelectEx 

See also:

file: /Techref/os/win/api/win32/func/src/f17_2.htm, 6KB, , updated: 2000/4/7 12:19, local time: 2022/5/20 09:36,

 ©2022 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF=""> DlgDirList</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.

Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

  PICList 2022 contributors:
o List host: MIT, Site host, Top posters @20220520
* Page Editors: James Newton, David Cary, and YOU!
* Roman Black of Black Robotics donates from sales of Linistep stepper controller kits.
* Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters.
* Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated!
* Contributors: Richard Seriani, Sr.

Welcome to!