网站首页  词典首页

请输入您要查询的函数:

 

术语 dlgdirlist
释义 DlgDirList
语法:
int DlgDirList( HWND hDlg,
LPTSTR lpPathSpec,
int nIDListBox,
int nIDStaticPath,
UINT uFileType
);
DlgDirList函数功能
替换了在一个特定的目录的子目录和文件名列表框中的内容。您可以通过指定过滤器的文件属性设置名单。该清单可以选择包括映射驱动器。
参数
hDlg
[in]的句柄对话框,其中包含列表框。
lpPathSpec
[中,输出]指向一个缓冲区包含null结尾的字符串,指定一个绝对路径,相对路径,或文件名。一个绝对路径,才能开始使用(例如驱动器号用D:\\)或UNC名称(例如,\\ \\计算机名\\共享名)。
函数拆分为一个目录和文件名的字符串。该函数搜索目录的名称相匹配的文件名。如果字符串不指定目录,函数搜索当前目录。
如果该字符串包含一个文件名,文件名必须包含至少一个通配符(?或*)。如果字符串不包括文件名,该函数的行为就像您已指定星号通配符(*)作为文件名。在指定的目录中的所有名称相匹配的文件名,并在uFileType参数指定的属性添加到列表框中。
nIDListBox
[in]的在hDlg对话框中的列表框标识符。如果此参数为0,DlgDirList函数不尝试填充列表框。
nIDStaticPath
[的]的在hDlg对话框中的静态控制标识符。 DlgDirList函数设置此控件的文本显示当前驱动器和目录。此参数可以是零,如果您不想显示当前驱动器和目录。
uFileType
[in]指定的文件或目录的属性添加到列表框中。此参数可以是一个或多个下列值。
DDL_ARCHIVE
包括归档文件。
DDL_DIRECTORY
包括子目录。子目录名称括在方括号([])。
DDL_DRIVES
所有映射的驱动器被添加到列表中。驱动器中列出的表格[ - X光],其中x是驱动器号。
DDL_EXCLUSIVE
包括与指定属性的文件。默认情况下,读写文件中列出,即使DDL_READWRITE未指定。
DDL_HIDDEN
包括隐藏文件。
DDL_READONLY
包括只读文件。
DDL_READWRITE
包括读写不需要额外属性的文件。这是默认设置。
DDL_SYSTEM
包括系统文件。
DDL_POSTMSGS
如果设置,DlgDirList函数使用PostMessage函数将消息发送到列表框中。如果没有设置,DlgDirList函数使用SendMessage函数。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。例如,如果lpPathSpec指定的字符串不是一个有效的路径,功能失败。为了获得更多错误信息,请调用。
备注
如果lpPathSpec指定一个目录,DlgDirListComboBox改变当前目录到指定的目录之前,填补了列表框。至于由nIDStaticPath参数确定的静态控制文本设置为新的当前目录名称。
DlgDirList函数发送LB_RESETCONTENT和LB_DIR消息到列表框中。
Windows NT 4.0和更高版本:如果uFileType包括DDL_DIRECTORY国旗和lpPathSpec指定一级目录,如C:\\ Temp,则列表框将始终包含一个“..”入职的根目录。这是真的,即使根目录有隐藏或系统属性和DDL_HIDDEN和DDL_SYSTEM没有指定标志。在NTFS卷的根目录有隐藏和系统属性。
Windows NT/2000/XP的:目录列表显示长文件名,如果有的话。
在Windows 95/98/Me:目录列表显示(8.3表)短文件名。您可以使用或函数来获取相应的长文件名。
在Windows 95/98/Me:DlgDirListW是支持微软层对于Unicode。要使用此,您必须将某些文件到您的应用,概述了对Unicode的Microsoft层在Windows 95/98系统。
例如
例如,见以下主题:创建一个目录列表,在单项选择列表框和创建多重选择列表框。
功能信息
最低DLL版本 user32.dll
在Winuser.h中HeaderDeclared,头文件:winuser.h
import libraryUser32.lib
最低操作系统Windows 95,Windows NT 3.1
UnicodeImplemented为ANSI和Unicode版本。
参见
DlgDirListComboBox,DlgDirSelectComboBoxEx,DlgDirSelectEx
==英文原文==DlgDirList Function
Replaces the contents of a list box with the names of the subdirectories and files in a specified directory. You can filter the list of names by specifying a set of file attributes. The list can optionally include mapped drives.
Syntax
int DlgDirList( HWND hDlg,
LPTSTR lpPathSpec,
int nIDListBox,
int nIDStaticPath,
UINT uFileType
);
Parameters
hDlg
[in] A handle to the dialog box that contains the list box.
lpPathSpec
[in, out] A pointer to a buffer containing a null-terminated string that specifies an absolute path, relative path, or filename. An absolute path can begin with a drive letter (for example, d:\\) or a UNC name (for example, \\\\ machinename\\ sharename).
The function splits the string into a directory and a filename. The function searches the directory for names that match the filename. If the string does not specify a directory, the function searches the current directory.
If the string includes a filename, the filename must contain at least one wildcard character (? or *). If the string does not include a filename, the function behaves as if you had specified the asterisk wildcard character (*) as the filename. All names in the specified directory that match the filename and have the attributes specified by the uFileType parameter are added to the list box.
nIDListBox
[in] The identifier of a list box in the hDlg dialog box. If this parameter is zero, DlgDirList does not try to fill a list box.
nIDStaticPath
[in] The identifier of a static control in the hDlg dialog box. DlgDirList sets the text of this control to display the current drive and directory. This parameter can be zero if you do not want to display the current drive and directory.
uFileType
[in] Specifies the attributes of the files or directories to be added to the list box. This parameter can be one or more of the following values.
DDL_ARCHIVE
Includes archived files.
DDL_DIRECTORY
Includes subdirectories. Subdirectory names are enclosed in square brackets ([ ]).
DDL_DRIVES
All mapped drives are added to the list. Drives are listed in the form [- x-], where x is the drive letter.
DDL_EXCLUSIVE
Includes only files with the specified attributes. By default, read-write files are listed even if DDL_READWRITE is not specified.
DDL_HIDDEN
Includes hidden files.
DDL_READONLY
Includes read-only files.
DDL_READWRITE
Includes read-write files with no additional attributes. This is the default setting.
DDL_SYSTEM
Includes system files.
DDL_POSTMSGS
If set, DlgDirList uses the PostMessage function to send messages to the list box. If not set, DlgDirList uses the SendMessage function.
Return Value
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 .
Remarks
If lpPathSpec specifies a directory, DlgDirListComboBox changes the current directory to the specified directory before filling the list box. The text of the static control identified by the nIDStaticPath parameter is set to the name of the new current directory.
DlgDirList sends the LB_RESETCONTENT and LB_DIR messages to the list box.
Windows NT 4.0 and later: If uFileType includes the DDL_DIRECTORY flag and lpPathSpec specifies a first-level directory, such as C:\\TEMP, the list box will always include a ".." entry for the root directory. This is true even if the root directory has hidden or system attributes and the DDL_HIDDEN and DDL_SYSTEM flags are not specified. The root directory of an NTFS volume has hidden and system attributes.
Windows NT/2000/XP: The directory listing displays long filenames, if any.
Windows 95/98/Me: The directory listing displays short filenames (the 8.3 form). You can use the or functions to get the corresponding long filename.
Windows 95/98/Me: DlgDirListW is supported by the Microsoft Layer for Unicode. To use this, you must add certain files to your application, as outlined in Microsoft Layer for Unicode on Windows Me/98/95 Systems .
Example
For examples, see the following topics: Creating a Directory Listing in a Single-selection List Box and Creating a Multiple-selection List Box .
Function Information
Minimum DLL Versionuser32.dll
HeaderDeclared in Winuser.h, include Windows.h
Import libraryUser32.lib
Minimum operating systemsWindows 95, Windows NT 3.1
UnicodeImplemented as ANSI and Unicode versions.
See Also
DlgDirListComboBox , DlgDirSelectComboBoxEx , DlgDirSelectEx
==原始网址==http://msdn.microsoft.com/en-us/library/bb761366(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 13:26:18