Re: GetSaveFileName

Tech-Archive recommends: Fix windows errors by optimizing your registry



Which is why Igor refers you to the nFilterIndex element which reflects the
selected type.


"Alexander Grigoriev" <alegr@xxxxxxxxxxxxx> wrote in message
news:O$eE0Q5FGHA.3056@xxxxxxxxxxxxxxxxxxxxxxx
> One can directly type a file name with different extension (or select from
> drop-down list in modern file dialog), which will be different from the
> currently selected type.
>
> "Igor Tandetnik" <itandetnik@xxxxxxxx> wrote in message
> news:%23z0Sfp3FGHA.1396@xxxxxxxxxxxxxxxxxxxxxxx
>> <bob@xxxxxxxxxxxxxx> wrote in message
>> news:1137067824.770643.309280@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
>>> Is there an easy way to tell what type of file the user selected when
>>> you do a GetSaveFileName(&ofn); ?
>>>
>>> For instance, I want to see if they chose GIF or JPEG.
>>
>> You could look at the file extension - see PathFindExtension. Or, you can
>> set up various file types you support in lpstrFilter string and read
>> nFilterIndex when the function returns.
>> --
>> With best wishes,
>> Igor Tandetnik
>>
>> With sufficient thrust, pigs fly just fine. However, this is not
>> necessarily a good idea. It is hard to be sure where they are going to
>> land, and it could be dangerous sitting under them as they fly
>> overhead. -- RFC 1925
>>
>
>


.



Relevant Pages

  • Re: GetSaveFileName
    ... > Which is why Igor refers you to the nFilterIndex element which reflects ... >> from drop-down list in modern file dialog), ... >> the currently selected type. ...
    (microsoft.public.vc.language)
  • problem with OFN_EXPLORER and lpfnHook
    ... I want to modify CFileDialog so that when user changes ... selected type, the extension is appended at the end of the filename. ...
    (microsoft.public.vc.mfc)