Windows Scripting
  Home arrow Windows Scripting arrow User Interaction with Common Dialogs in WS...
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

User Interaction with Common Dialogs in WSH
By: Nilpo/Developer Shed Staff Writer
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 5
    2007-04-24

    Table of Contents:
  • User Interaction with Common Dialogs in WSH
  • Accessing the Common Dialog control directly
  • Accessing dialogs through other applications
  • Watch it in action

  • 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


    User Interaction with Common Dialogs in WSH


    (Page 1 of 4 )

    As you progress into more detailed and more powerful code, you will find yourself focusing more and more on how your scripts appear to your users. Using common Windows dialog boxes will give your script a familiar, comfortable feel while appearing more like a fully functional application.

    You've all seen the classic File Open and File Save dialog boxes in Windows.  These standard dialogs are provided by the Common Dialogs Control that ships with Windows.  Updates are made available via subsequent releases of the Visual Basic runtime environment and some Microsoft applications.

    The Common Dialogs control is housed in the comctl32.dll library in your System32 directory.  It is a registered component and is therefore made available to any application in the Windows environment.

    As with any object, you can connect to the Common Dialogs control and use any of its available methods.  In a standard programming language, such as Visual Basic or C++, this is a fairly simple task.  However, it's not quite so simple in WSH.

    Take the time to read this article slowly and thoroughly.  WSH does not have native support for Common Dialogs.  Whether the lack of support was intentional or a mere oversight is mostly irrelevant.  The fact remains that the normal conditions that scripting was designed for have no real need for Common Dialogs.

    But as is generally the case with programming technologies, the uses for scripting have evolved far beyond their intended purpose and, thus, the interest in Common Dialogs implementation has been born.

    Please keep in mind that due to the nature of the examples that follow, they may not work in all situations or under every condition.  These are all workarounds!  While I will be making the attempt to provide code that should work, it's not possible for me to accurately forecast every scenario that may arise.

    One final suggestion before we dive into things: if you are interested in applying a GUI to your scripts in an effort to make them look like real applications, you may want to consider the use of HTML applications.

    HTAs are a scripting technology that allows you to house code in standalone web pages.  This allows you to design a sort of UI with the use of forms and other web elements in full HTML and CSS.  You may find this a more suitable solution.

    More Windows Scripting Articles
    More By Nilpo/Developer Shed Staff Writer


       · Hey, guys. Thanks for joining me again. In this article how show you how to give...
       · Hi,I am regular reader of your articles. Its very informative. Keep...
       · Thanks for reading.Beginning with the basics, this does require Internet...
     

    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 1 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek