How to set default file type for CFileDialog?

I use CFileDialogto display an open file dialog box. I set the filter as follows:

static TCHAR BASED_CODE szFilter[] = _T("Chart Files (*.xlc)|*.xlc|")
                                     _T("Worksheet Files (*.xls)|*.xls|Data Files (*.xlc;*.xls)|")
                                     _T("*.xlc; *.xls|All Files (*.*)|*.*||");

I need to set the default file type as “Worksheet Files” whenever I have a DoModaldialog box. I can’t figure out how to do this. MS Paint does, it selects "All image files" when we open the open file dialog.

Please let me know how to do this.

+3
source share
1 answer

SetDefExt.. / . , (.).

, . - (lpszDefExt).

0

Source: https://habr.com/ru/post/1786647/


All Articles