Windows Scripting
  Home arrow Windows Scripting arrow Page 3 - Improving MFC for Windows Vista
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
WINDOWS SCRIPTING

Improving MFC for Windows Vista
By: Gabor Bernat
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 2
    2009-02-18

    Table of Contents:
  • Improving MFC for Windows Vista
  • First Impressions
  • The Open/Save Dialog
  • Final Thoughts

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Improving MFC for Windows Vista - The Open/Save Dialog


    (Page 3 of 4 )

    One of the most impressive changes made to Vista that you’ll observe once you get to mess around a little is the improved Explorer. With it there are also some more stylish and practical open/save dialogs.

    In MFC you can pop up these kinds of dialogs by simply declaring a CFileDialog type and calling its DoModal() function. So implementing this can be done on the fly and resolved by the container. Once you recompile an older solution with the new one you’ll automatically replace the old ones with the more stylish/practical ones.

    To maintain compatibility with older applications and still leave a path for the user to choose which one to use, the solution was to simply extend the constructor in the new library with a extra parameter that signals whether or not to use the Vista style open dialog.


    explicit CFileDialog(BOOL bOpenFileDialog,

    LPCTSTR lpszDefExt = NULL,

    LPCTSTR lpszFileName = NULL,

    DWORD dwFlags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,

    LPCTSTR lpszFilter = NULL,

    CWnd* pParentWnd = NULL,

    DWORD dwSize = 0,

    BOOL bVistaStyle = TRUE);


    So we get the following new Open/Save dialog with a simpler Save As… that initially doesn't show the folder view tree, but lets you choose the save directory by choosing the Browse Folders button.


    ->Old type open <-

    ->New type open<-


    ->Old type Save As <-

    ->New type Save As <-


    More Windows Scripting Articles
    More By Gabor Bernat


     

    WINDOWS SCRIPTING ARTICLES

    - More Windows Scripting Workarounds from Nilpo
    - Overloading Methods and More in VBScript
    - Improving MFC for Windows Vista
    - Regular Expressions in VBScript
    - Working with Dates in WMI
    - Completing Calendars with VBScript Date Func...
    - Building Calendars with VBScript Date Functi...
    - Working With Dates and Times in VBScript
    - Designing WCF DataContract Classes Using the...
    - Understanding Dates and Times in VBScript
    - Working With Arrays in VBScript
    - Compressed Folders in WSH
    - Using .NET Interops in VBScript
    - Nilpo`s Scripting Secrets, Vol I
    - Database operations using Silverlight 2.0 WC...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek