473,495 Members | 2,058 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

File Association and other

pek
First Question:
OK, I know how to make a simple file association with the registry.
What I can't figure out is how do I fetch multiple files. So far I
managed to add to the context menu an "Add to my app" menu item and
associated it with some video formats. Now, if I select 1 video format
and click the "Add to my app" my app opens correctly and adds the name
in the list. What I can't do is select more than 1 .avi files and do
the same thing. When I attempt to, a "Windows Move file to folder"
dialog appears twice (?!) for each file I choose.
This is what I add to the registry:

Key: HKEY_CLASSES_ROOT\.avi\shell\addToMyApp\Command
Value: "pathToMyApp" "%1"

and this is the code at load:

Private Sub main_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
If (Environment.GetCommandLineArgs.Length 1) Then
MsgBox(Environment.GetCommandLineArgs.GetValue(1))
For i As Integer = 1 To
Environment.GetCommandLineArgs().Length - 1

lstFiles.Items.Add(Environment.GetCommandLineArgs. GetValue(i), True)
Next
End If
End Sub

Second Question
I'm looking all over the internet to find out what the hell is the %1
placeholder. I learned some things about %1 %2 etc. but didn't find a
good explanation and example. I once also found an %L placeholder.
What is the difference..? How many % are there..?

Third Question
This is more like a registry hack question. If windows doesn't
recognize a filetype and you double-click it, it will pop up a window
asking you what program to associate to. If you choose to always open
it with that program windows adds the following to the registry:
(assuming associating .foo extension with bar app)

Key: HKEY_CLASSES_ROOT\.foo
Value: barfile

Key: HKEY_CLASSES_ROOT\barfile\shell
Value: open

Key: HKEY_CLASSES_ROOT\barfile\shell\open\command
Value: "PathToApp" "%1"

Now, because HKEY_CLASSES_ROOT\.foo default value is barfile anything
you create under shell for additional context menu items renders them
useless. If you simply remove the default value everything works
normal but the file association is gone.

So my question is, how can you make both work..?

Jun 25 '07 #1
0 1147

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
4297
by: steve | last post by:
Hi, I just upgraded my php but ran into a problem. Never seen this before. Somehow it seems I lost php file association. When I do a http://localhost/something.php I get a prompt for dowload...
6
486
by: Justin F | last post by:
I have set up file association for my application (VB.Net). I'm having problems getting the filename that was double-clicked. On my machine at work, if the filename being passed in to the...
2
1973
by: David | last post by:
Hi, I am trying to create a two way association between 2 objects. I intended to do it by having a pointer to each other but I am getting compilation errors. At the moment I can create both...
2
2109
by: Mark | last post by:
I have a windows 2000 PC and it does not know what a hta file is. any ideas. Mark
4
2587
by: Rob | last post by:
I have an Access application that allows users to open up certain files from within Access (.doc files with automation, .pdf's with a pdf viewing form). Other formats, we want to use Internet...
1
4450
by: JerryP | last post by:
Hi Experts, from my program I offer the user to launch different files from a directory (normaly in this directory are .txt files) - but sometimes other files may be in there - so if my program...
1
4402
by: Allen | last post by:
I have installed the Updater Application Block, and then I should Deploy the QuickStarts. " Install the QuickStarts After you install the Updater Application Block, you should install the...
6
1744
by: Nak | last post by:
Hi there, I am implementing file association from within my application, association that occurs after installation. Anyway, I remember a while back seeing a key in the registry that was used...
28
20395
by: Tim Daneliuk | last post by:
I have a program wherein I want one behavior when a file is set as executable and a different behavior if it is not. Is there a simple way to determine whether a given named file is executable...
0
6991
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7160
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7373
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5456
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4897
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4583
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1405
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
649
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
286
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.