Thread View: borland.public.cppbuilder.nativeapi
7 messages
7 total messages
Started by smartdude80
Tue, 27 Jun 2006 21:38
file associations
Author: smartdude80
Date: Tue, 27 Jun 2006 21:38
Date: Tue, 27 Jun 2006 21:38
4 lines
1015 bytes
1015 bytes
How do you associate a file type with a program? Does this just involve registry keys? Thanks.
Re: file associations
Author: Mike Collins
Date: Tue, 27 Jun 2006 23:29
Date: Tue, 27 Jun 2006 23:29
17 lines
1535 bytes
1535 bytes
Yes and know. The registry is used to make the association but if you want to interact with the context pop-up menu then it is a bit more advanced. This has been covered many, many time before on these groups - I would suggest a Google search. Also, Remy has a component on his web site that wraps the file extension / registration process. HTH Mike "smartdude80" <smartdude81@comcast.net> wrote in message news:44a1a549$1@newsgroups.borland.com... > How do you associate a file type with a program? Does this just involve > registry keys? > > Thanks. > > >
Re: file associations
Author: Remy Lebeau (TeamB)
Date: Wed, 28 Jun 2006 00:03
Date: Wed, 28 Jun 2006 00:03
21 lines
1686 bytes
1686 bytes
"Mike Collins" <its@TheBottomOfThePost.com> wrote in message news:44a1bf72@newsgroups.borland.com... > Yes and know. The registry is used to make the association but if you > want to interact with the context pop-up menu then it is a bit more advanced. That depends on what kind of interaction you are looking for. Static menu items are controlled by the Registry, whereas dynamic menu items are controlled by a COM object implemented inside a DLL instead. > Also, Remy has a component on his web site that wraps the > file extension / registration process. That component is years outdated. I've been working on a new version that is a complete re-write from scratch. Contact me privately if you want to try a beta version. Gambit
Re: file associations
Author: Remy Lebeau (TeamB)
Date: Wed, 28 Jun 2006 00:05
Date: Wed, 28 Jun 2006 00:05
22 lines
1596 bytes
1596 bytes
"smartdude80" <smartdude81@comcast.net> wrote in message
news:44a1a549$1@newsgroups.borland.com...
> How do you associate a file type with a program? Does
> this just involve registry keys?
For the most part, yes. There are articles on MSDN that explain the
details, ie:
Creating a File Association
http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/programmersguide/shell_basics/shell_basics_extending/fileassociations/fileassoc.asp
Creating Context Menu Handlers
http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/programmersguide/shell_int/shell_int_extending/extensionhandlers/contextmenuhandlers.asp
Just to name a couple.
Gambit
Re: file associations
Author: smartdude80
Date: Thu, 29 Jun 2006 01:38
Date: Thu, 29 Jun 2006 01:38
12 lines
1653 bytes
1653 bytes
> Yes and know. The registry is used to make the association but if you > want to interact with the context pop-up menu then it is a bit more > advanced. This has been covered many, many time before on these groups - I > would suggest a Google search. Also, Remy has a component on his web site > that wraps the file extension / registration process. > That was helpful guys. I just tried out Remy's component, TRegExtension, and it seems to work. 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.
Re: file associations
Author: Remy Lebeau (TeamB)
Date: Thu, 29 Jun 2006 01:44
Date: Thu, 29 Jun 2006 01:44
26 lines
1773 bytes
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
Re: file associations
Author: smartdude80
Date: Thu, 29 Jun 2006 15:15
Date: Thu, 29 Jun 2006 15:15
9 lines
1385 bytes
1385 bytes
> 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: > Thanks. Thats what i thought.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads