Using Common File Dialogs as Modeless Views


Desktop-as-a-Service Designed for Any Cloud ? Nutanix Frame

Environment: VC6 SP3, NT4 SP5, Windows 98, MSIE 5.0

This application was implemented for exercise purposes only. However I hope that ideas enclosed in it can be useful since it is sometimes required to get a Common Dialog modeless. Each Common File Dialog window has its style changed during creation and then lives in its own thread (CThreadRunningDlg class). The class for starting threads and wrapping of these dialog windows in the creation thread is CChildView. CdlgFileBrowse class is a descendant of standard MFC CFileDialog class running in its own thread. It implements actual initialization of parent Common File Dialog window. Common File Dialog window is sub-classed to maintain file list size fit under NT (CWndFileBrowse class). Of partial interest are also: splitter which allows maximally two panes opened and toggles windows tiling between horizontal and vertical (CTwixSplitter class) and edit bar derived from CControlBar class (CEditBar class).


Download demo project - 9 Kb
Download source - 24 Kb


  • Added fix for improved draw performance

    Posted by Legacy on 10/24/2003 07:00am

    Originally posted by: Gareth

    What a great article! I have a small fix though...

    BOOL CDlgFileBrowse::OnInitDialog()
    CWnd* pParent = GetParent();


    ...I've added the WS_CLIPCHILDREN. You'll notice this will fix any werid painting problems when passing other windows over the file dialog. Great article though...

    g :�)

  • Nice. But is it possible to do it in a CPropertyPage instead?

    Posted by Legacy on 07/17/2003 07:00am

    Originally posted by: Tomas Rasmussen

    Very nice application. But I would like it to appear in a CPropertyPage instead. Anyone able to solve that one???

    Best regards

    Tomas Rasmussen

  • Two panes

    Posted by Legacy on 05/12/2003 07:00am

    Originally posted by: Dragan M

    Select more than 15 files. Press Enter. File Open dlg is gone.

  • Very cool--anyone know how to do this in .Net (C#)?

    Posted by Legacy on 07/09/2002 07:00am

    Originally posted by: Scott

    Very good job on this...do you know how to do the same thing in C#? I want to put a file open dialog on a tab page. Any ideas?
    Thanks for the great work!

  • Not Bad

    Posted by Legacy on 06/14/2001 07:00am

    Originally posted by: Jim.Rong

    Not Bad!

  • Neat, but could be better commented

    Posted by Legacy on 06/11/2001 07:00am

    Originally posted by: JohnE

    First impressions.... Nice little app with some useful concepts. Does what it says on the tin, but (and it's only a minor but)... would it have hurt to sprinkle a few more comments here & there?

  • You must have javascript enabled in order to post comments.

Leave a Comment
  • Your email address will not be published. All fields are required.

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date