🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #3352

Re: file associations

#3352
From: Remy Lebeau (TeamB)
Date: Thu, 29 Jun 2006 01:44
26 lines
1773 bytes
"smartdude80" <smartdude81@comcast.net> wrote in message
news:44a32f0c@newsgroups.borland.com...

> My program works with a specific file type and I just need to
> figure out how to get the file name of a file (belonging to my file
> class) when its being opened.  Hopefully i'll figure this out.

The filename will be passed to the application via its command line
parameters.  In the Registry, you have to specify the format of the command
line that is passed to the application, which %1 specifying where the
filename is to be placed, ie:

    c:\folder\myapp.exe "%1"

    c:\folder\myapp.exe "/openfile:%1"

    etc...

Using pure Win32 API coding, you can use the GetCommandLine() function, or
the lpCmdLine parameter of WinMain(), to get the command line.  If you are
using the VCL, you can alternatively use the GetParamCount() and
GetParamStr() functions.


Gambit
Technical Details
Message-ID: <44a33119$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <44a1a549$1@newsgroups.borland.com> <44a1bf72@newsgroups.borland.com> <44a32f0c@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,6e370b62a53e7432
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <44a1a549$1@newsgroups.borland.com> <44a1bf72@newsgroups.borland.com> <44a32f0c@newsgroups.borland.com>
Subject: Re: file associations
Date: Wed, 28 Jun 2006 18:44:47 -0700
Lines: 28
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 68.69.17.41
Message-ID: <44a33119$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1151545625 68.69.17.41 (28 Jun 2006 18:47:05 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail