Starting from Windows Me and Windows 2000, the OpenFilename structure of GetOpenFilename () and GetsaveFilename () add three new elements. Let's take a look first:
type openfilename
lstructsize as long
hwndowner as long
hinstance as long
lpstrfilter as string
lpstrcustomFilter as string
nmaxcustFilter as long
nfilterindex as long
lpstrfile as string
nmaxfile as long
lpstrfiletital as string
nmaxfiletital as long
lpstrinitialdir as string
lpstrtital as string
Flags as long
nfileoffset as integer
nfileextension as integer
LPStrdext as string
LCUSTDATA AS Long
lpfnhook as long
LPTEMPLENAME As String
'#if (_win32_winnt> = 0x0500)
pvReserved as long
dwreserved as long
Flagsex as long
'#endif // (_win32_winnt> = 0x0500)
End Type
It is not difficult to see that the new elements PVReserVEd and Dwreserved are retained. Maybe Windows Me and Windows 2000 have not yet completed the relevant functions when they are released, so ... but the Flagsex element has a parameter of OFN_EX_NOPLACESBAR (1). Set up this bit label to turn off the quick bar on the left side of the Windows 2000 (or Windows ME) "Open the File" dialog box. This shortcut bar can store a total of five shortcuts, which can specify your own shortcut by modifying the registry. As for how to modify, it is not our topic today, so we will not discuss it for the time being. However, in actual use, I discovered a problem: procedures using this new structure cannot run on Windows 98/95/NT4. The reason may be that when setting LSTRUCTSIZE, the new three members are calculated, resulting in an increase of 12 bytes in the structure length, and the old version of the COMDLG32.dll cannot be identified, and the structure length is mistaken. The end result is that the "open file" and the "save file" dialog box cannot be displayed.
In view of this problem, we have used the following ideas to solve: Use the getVersionex () function to detect the Windows version. If it is not Windows Me and Windows 2000, subtract 12 bytes after calculating the length of the OpenFilename structure with Len (), and then assign a value to LSTRUCTSIZE. In this way, the version of the COMDLG32.DLL will ignore the three new elements. After practice, it proves that this method is feasible.
Of course, we also consider that there may be a new version of the new version of the COMDLG32.DLL due to the installation of certain software due to the installation of certain software, so that the new features can be used. So the best way is to detect the version of the comDLG32.dll itself, and then determine whether the length of the OpenFilename structure must ignore the length of the new three elements.
The largest cool station demonstration center in China!