Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to get the filename, if a file is opened with your application. Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
Get the filename, if a file is opened with your application. 15-Aug-04
Category
Files Operation
Language
Delphi All Versions
Views
402
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
Lauridsen, Tobias
Reference URL:
			1   unit Unit1;
2   
3   interface
4   
5   uses
6     Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
7     Dialogs, StdCtrls;
8   
9   type
10    TForm1 = class(TForm)
11      procedure FormCreate(Sender: TObject);
12    private
13      { Private declarations }
14    public
15      { Public declarations }
16    end;
17  
18  var
19    Form1: TForm1;
20  
21  implementation
22  
23  {$R *.dfm}
24  
25  // open an file with the project to test it. 
26  // if a file is available an message will appear.
27  
28  procedure TForm1.FormCreate(Sender: TObject);
29  var
30    S : string;
31  begin
32    // Get commandline
33    S := CmdLine;
34    // Remove the application path from CmdLine, +3 = "" and space
35    Delete(S,1,length(Application.ExeName)+3);
36    if length(S) > 0 then
37     begin
38      // Found filename
39      Showmessage('Found File : ' + S);
40     end;
41  end;
42  
43  end.


			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC