Delphi-Kylix
  Home arrow Delphi-Kylix arrow Page 3 - Creating an Associator
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Sun Developer Network 
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? 
DELPHI-KYLIX

Creating an Associator
By: Jacques Noah
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2006-08-09

    Table of Contents:
  • Creating an Associator
  • Continuing with the code
  • How to enable the application to load the file that has been clicked
  • The entire code

  • 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


    Creating an Associator - How to enable the application to load the file that has been clicked


    (Page 3 of 4 )

    When an application starts, it has certain variables at its disposal. One of them is ParamStr();. "ParamStr(n)" is a global variable that contains various pieces of information in the following order:

    ParamStr(0) = The current application name and path

    ParamStr(1) = The file name that the user clicked on in Explorer or passed through the command line.

    We are interested in ParamStr(1) since it will contain the parameters that the user passed to the application.  So to check whether this variable contains something:

    Var
    Applicationname,Avariable:string;
    begin
    ApplicationName := ParamStr(0);
    If ParamCount = 1 then AVariable := ParamStr(1);
    ...
    //Use AVariable for whatever purpose you want to.....
    End;

    Make sure to add the above code to your applications' OnCreate event, and it will be able to start if a file that it is associated to is passed.

    More Delphi-Kylix Articles
    More By Jacques Noah


     

    DELPHI-KYLIX ARTICLES

    - Delphi Wrapper Classes and XML
    - Delphi and the DOM
    - Delphi and XML
    - Internet Access: Client Service
    - Finishing the Client for an Internet Access ...
    - The Client for an Internet Access Control Ap...
    - User Management for an Internet Access Contr...
    - Important Procedures for an Internet Access ...
    - Server Code for an Internet Access Control A...
    - Constructing the Interface for an Internet A...
    - Building a Server Application for an Interne...
    - Building an Internet Access Control Applicat...
    - Client Dataset: Working with Data Packets an...
    - Using the Client Dataset in an N-Tiered Appl...
    - Using the Client Dataset in Two-Tiered Clien...






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
    Stay green...Green IT