网站首页  词典首页

请输入您要查询的函数:

 

术语 dlgdirlistcombobox
释义 DlgDirListComboBox
语法:
int DlgDirListComboBox( HWND hDlg,
LPTSTR lpPathSpec,
int nIDComboBox,
int nIDStaticPath,
UINT uFiletype
);
DlgDirListComboBox功能
替换了在一个特定的目录的子目录和文件名组合框的内容。您可以通过指定过滤器的文件属性设置名单。该名单可以包括映射的驱动器号。
参数
hDlg
[in]的句柄对话框,其中包含组合框。
lpPathSpec
[中,输出]指向一个缓冲区包含null结尾的字符串,指定一个绝对路径,相对路径,或文件名。一个绝对路径,才能开始使用(例如驱动器号用D:\\)或UNC名称(例如,\\ \\计算机名\\共享名)。
函数拆分为一个目录和文件名的字符串。该函数搜索目录的名称相匹配的文件名。如果字符串不指定目录,函数搜索当前目录。
如果该字符串包含一个文件名,文件名必须至少包含一个通配符(?或*)。如果字符串不包含文件名,函数的行为就像您已指定星号通配符(*)作为文件名。在指定的目录中的所有名称相匹配的文件名,并通过uFiletype参数指定的属性添加到组合框中显示的列表中。
nIDComboBox
[in]的在hDlg对话框中的组合框标识符。如果此参数为0,DlgDirListComboBox不会尝试填充组合框。
nIDStaticPath
[的]的在hDlg对话框中的静态控制标识符。 DlgDirListComboBox设置此控件的文本显示当前驱动器和目录。此参数可以是零,如果您不想显示当前驱动器和目录。
uFiletype
[in]一位标志,它指定的文件或目录的属性设置为添加到组合框。此参数可以是下列值的组合。
DDL_ARCHIVE
包括归档文件。
DDL_DIRECTORY
包括子目录,这是在方括号([])。
DDL_DRIVES
所有映射的驱动器被添加到列表中。驱动器中列出的表格[- X光],其中x是驱动器号。
DDL_EXCLUSIVE
包括与指定属性的文件。默认情况下,读写文件中列出,即使DDL_READWRITE未指定。
DDL_HIDDEN
包括隐藏文件。
DDL_READONLY
包括只读文件。
DDL_READWRITE
包括读写不需要额外属性的文件。这是默认设置。
DDL_SYSTEM
包括系统文件。
DDL_POSTMSGS
如果设置此标志,DlgDirListComboBox使用PostMessage函数将消息发送到组合框。如果此标志没有设置,DlgDirListComboBox使用SendMessage函数。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。例如,如果lpPathSpec指定的字符串不是一个有效的路径,功能失败。为了获得更多错误信息,调用GetLastError。
备注
如果lpPathSpec指定一个目录,DlgDirListComboBox改变当前目录到指定的目录之前,填补了组合框。至于由nIDStaticPath参数确定的静态控制文本设置为新的当前目录名称。
DlgDirListComboBox发送CB_RESETCONTENT和CB_DIR信息组合框。
微软Windows NT 4.0和更高版本:如果uFiletype包括DDL_DIRECTORY国旗和lpPathSpec指定一级目录,如C:\\ Temp,则组合框将始终包含一个“..”入职的根目录。这是真的,即使根目录有隐藏或系统属性和DDL_HIDDEN和DDL_SYSTEM没有指定标志。在NTFS卷的根目录有隐藏和系统属性。
安全警告:使用这个函数不正确可能会损害您的程序的安全性。此函数不正确的使用,包括有lpPathSpec表明非无空可写缓冲区,缓冲区或离职。您应该检讨安全方面的考虑:在继续之前微软Windows控件。
Windows NT 4.0和更高版本:该列表显示长文件名,如果有的话。
Microsoft Windows 95或更高版本:该列表显示短文件名(8.3形式)。您可以使用SHGetFileInfo或GetFullPathName函数来获取相应的长文件名。
Windows 95或更高版本:DlgDirListComboBoxW是由Microsoft层支持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版本。
参见
DlgDirList函数,DlgDirSelectComboBoxEx
==英文原文==DlgDirListComboBox Function
Replaces the contents of a combo 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 of names can include mapped drive letters.
Syntax
int DlgDirListComboBox( HWND hDlg,
LPTSTR lpPathSpec,
int nIDComboBox,
int nIDStaticPath,
UINT uFiletype
);
Parameters
hDlg
[in] A handle to the dialog box that contains the combo box.
lpPathSpec
[in, out] A pointer to a buffer containing a null-terminated string that specifies an absolute path, relative path, or file name. 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 file name. The function searches the directory for names that match the file name. If the string does not specify a directory, the function searches the current directory.
If the string includes a file name, the file name must contain at least one wildcard character (? or *). If the string does not include a file name, the function behaves as if you had specified the asterisk wildcard character (*) as the file name. All names in the specified directory that match the file name and have the attributes specified by the uFiletype parameter are added to the list displayed in the combo box.
nIDComboBox
[in] The identifier of a combo box in the hDlg dialog box. If this parameter is zero, DlgDirListComboBox does not try to fill a combo box.
nIDStaticPath
[in] The identifier of a static control in the hDlg dialog box. DlgDirListComboBox sets the text of this control to display the current drive and directory. This parameter can be zero if you don't want to display the current drive and directory.
uFiletype
[in] A set of bit flags that specifies the attributes of the files or directories to be added to the combo box. This parameter can be a combination of the following values.
DDL_ARCHIVE
Includes archived files.
DDL_DIRECTORY
Includes subdirectories, which 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 this flag is set, DlgDirListComboBox uses the PostMessage function to send messages to the combo box. If this flag is not set, DlgDirListComboBox 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 GetLastError .
Remarks
If lpPathSpec specifies a directory, DlgDirListComboBox changes the current directory to the specified directory before filling the combo box. The text of the static control identified by the nIDStaticPath parameter is set to the name of the new current directory.
DlgDirListComboBox sends the CB_RESETCONTENT and CB_DIR messages to the combo box.
Microsoft 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 combo 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.
Security Alert Using this function incorrectly might compromise the security of your program. Incorrect use of this function includes having lpPathSpec indicate a non-writeable buffer, or a buffer without a null-termination. You should review the Security Considerations: Microsoft Windows Controls before continuing.
Windows NT 4.0 and later: The list displays long file names, if any.
Microsoft Windows 95 or later: The list displays short file names (the 8.3 form). You can use the SHGetFileInfo or GetFullPathName functions to get the corresponding long file name.
Windows 95 or later: DlgDirListComboBoxW 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 .
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
DlgDirList , DlgDirSelectComboBoxEx
==原始网址==http://msdn.microsoft.com/en-us/library/bb775935(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:18:43