Click here to Skip to main content
15,895,656 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: show text in statusbar Pin
Jon Hulatt30-Sep-02 5:09
Jon Hulatt30-Sep-02 5:09 
GeneralRe: show text in statusbar Pin
jafrazee30-Sep-02 5:18
jafrazee30-Sep-02 5:18 
GeneralRe: show text in statusbar Pin
Jon Hulatt30-Sep-02 5:37
Jon Hulatt30-Sep-02 5:37 
GeneralRe: show text in statusbar Pin
jafrazee30-Sep-02 6:25
jafrazee30-Sep-02 6:25 
GeneralRe: show text in statusbar Pin
jmkhael30-Sep-02 6:52
jmkhael30-Sep-02 6:52 
GeneralRe: show text in statusbar Pin
jmkhael30-Sep-02 5:31
jmkhael30-Sep-02 5:31 
GeneralCFileDialog question Pin
Brakanjan30-Sep-02 4:38
Brakanjan30-Sep-02 4:38 
GeneralRe: CFileDialog question Pin
jmkhael30-Sep-02 5:04
jmkhael30-Sep-02 5:04 
MSDN:
Filters
The information in this section applies to both Explorer-style and old style Open and Save As dialog boxes.

You can provide filename filters to assist the user in limiting the filenames that the dialog box displays. A filename filter consists of a pair of null-terminated strings, a description and a pattern, one concatenated to the other. The dialog box displays the description to let the user pick which filter to use; and it uses the pattern to select the files to display.

To specify the filters, set the lpstrFilter member of the OPENFILENAME structure to point to a buffer that contains an array of filter string pairs. The last string in the array must be followed by an extra null character.

A pattern string can be a combination of valid filename characters and the asterisk (*). The asterisk is a wildcard that represents any combination of valid filename characters. The dialog box displays only those files that match the pattern. To specify multiple patterns for the same description, you must use a semicolon (;) to separate the patterns. Note that space characters in the pattern string can produce unexpected results.

The following code fragment specifies two filters. The filter with the "Source" description has two patterns. If the user selects this filter, the dialog box displays only files that have the .C and .CXX extensions.

OPENFILENAME ofn; // common dialog box structure

ofn.lpstrFilter = "Source\0*.C;*.CXX\0All\0*.*\0"
ofn.nFilterIndex = 1;

The nFilterIndex member of the OPENFILENAME structure specifies an index that indicates which filter the dialog box initially uses. The first filter in the buffer has index 1, the second 2, and so on. If the user changes the filter while using the dialog box, the nFilterIndex member is set to the index of the selected filter on return.

You can create a custom filter by setting the lpstrCustomFilter member to the address of a buffer that contains a single filter, and by setting the nMaxCustFilter member to the size of the buffer, in characters or bytes. The dialog box always places the custom filter at the beginning of the list of filters and, on return, always updates the pattern part of the filter with the pattern from the filter selected by the user.

For Explorer-style dialog boxes, the default extension may change if the user selects a different filter. If the user selects a filter whose first pattern is of the form *.xxx (that is, the extension does not include a wildcard character), the dialog box uses xxx as the default extension. This occurs only if you specified a default extension in the lpstrDefExt member of the OPENFILENAME structure. For example, if the user selects the "Source\0*.C;*.CXX\0" filter, the default extension changes to "C". However, if you had defined the filter as "Source\0*.C*\0", the default extension would not change because the extension includes a wildcard.



Papa


while (TRUE)
Papa.WillLove ( Bebe ) ;
GeneralRe: CFileDialog question Pin
Brakanjan30-Sep-02 5:26
Brakanjan30-Sep-02 5:26 
Generalcatch block and 'return' Pin
ns30-Sep-02 4:33
ns30-Sep-02 4:33 
GeneralRe: catch block and 'return' Pin
Chris Losinger30-Sep-02 4:38
professionalChris Losinger30-Sep-02 4:38 
GeneralRe: catch block and 'return' Pin
ns30-Sep-02 4:48
ns30-Sep-02 4:48 
GeneralRe: catch block and 'return' Pin
Chris Losinger30-Sep-02 4:48
professionalChris Losinger30-Sep-02 4:48 
GeneralQuestion about excel automation with VC++ Pin
Gérald Mercet30-Sep-02 4:26
Gérald Mercet30-Sep-02 4:26 
GeneralRe: Question about excel automation with VC++ Pin
Stephane Rodriguez.30-Sep-02 4:42
Stephane Rodriguez.30-Sep-02 4:42 
GeneralRe: Question about excel automation with VC++ Pin
Gérald Mercet30-Sep-02 5:24
Gérald Mercet30-Sep-02 5:24 
Questiondragable view? Pin
dazinith30-Sep-02 4:00
dazinith30-Sep-02 4:00 
GeneralCreate resource dll's Pin
Zizilamoroso30-Sep-02 3:39
Zizilamoroso30-Sep-02 3:39 
GeneralRe: Create resource dll's Pin
Stephane Rodriguez.30-Sep-02 4:02
Stephane Rodriguez.30-Sep-02 4:02 
GeneralRe: Create resource dll's Pin
Zizilamoroso30-Sep-02 4:22
Zizilamoroso30-Sep-02 4:22 
GeneralRe: Create resource dll's Pin
Andreas Saurwein30-Sep-02 4:22
Andreas Saurwein30-Sep-02 4:22 
GeneralRe: Create resource dll's Pin
Zizilamoroso30-Sep-02 4:25
Zizilamoroso30-Sep-02 4:25 
GeneralProblem with tray icon - very strange behaviour Pin
s_k30-Sep-02 3:36
s_k30-Sep-02 3:36 
GeneralChild Window Focus Pin
mleslar30-Sep-02 3:24
sussmleslar30-Sep-02 3:24 
GeneralCFileDialog and "New Folder" button. Pin
ns30-Sep-02 2:57
ns30-Sep-02 2:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.