The information in this article applies to:
SYMPTOMSSending an LB_DIR message to a list box that specifies a long filename in the lParam returns LB_ERR in Windows 95 but works fine in Windows NT version 3.51. CAUSEThe implementation of list boxes in Windows 95 thunks down to 16-bit USER.EXE, and the LB_DIR command has not been enhanced to support long filenames. RESOLUTIONConvert the long filename to its short form before passing it as the lParam to LB_DIR by using GetShortPathName(). Similarly, when calling DlgDirList() to fill a list box with filenames, make sure the lpPathSpec parameter refers to the short name of the file. Sample Code
NOTE: If a file with a long filename exists under the subdirectory
specified, Windows 95 displays the short name in the list box, whereas
Windows NT displays the long name.
STATUSThis behavior is by design. MORE INFORMATION
This is not a problem under Windows NT because it always supported long
filenames.
Additional query words: LongFileName LFN DlgDirList CB_DIR DlgDirListComboBox
Keywords : kbcode kbCtrl kbListBox kbGrpUser kbWinOS95 |
Last Reviewed: December 7, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |