|
-
August 19th, 2003, 01:12 PM
#1
Associating extension with my application
hi,
with my VB application, i create files with extention ".myext". LEts say i created a file called abc.myext. Now, when i double click on the abc.myext, it should launch my application. I know I can do this manually by associating the extention with the application. But for my users, i dont expect them to know this. Is there a way i can do this programmatically...?
Thanks!
-
August 19th, 2003, 02:32 PM
#2
You could try creating a batch file using the ASSOC command to associate files and then call the batch file in your program. Never tried this so I can't guarantee anything.
Cubbie
-
August 19th, 2003, 03:20 PM
#3
would you be knowing the command or someplace to look how to associate extensions with application????
-
August 19th, 2003, 04:42 PM
#4
At least three places:
1)
http://www.codeguru.com/forum/showth...ight=associate
-------------------------------------------------------------
2)
(The following should be really clear for your purpouse
http://www.**************/Item.asp?Pa...odeBank&ID=334
-------------------------------------------------------------
3)
http://www.mvps.org/vbnet/code/reg/association.htm
Last edited by Cimperiali; August 19th, 2003 at 04:44 PM.
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
-
August 19th, 2003, 09:53 PM
#5
I was successful in associating the file extention with my application. I created an entery called ".myext" under HKEY_CLASSES_ROOT pointing to MyApp.Document.
Created another entry under HKEY_CLASSES_ROOT called MyApp.Document.
Under MyApp.Document created two keys:
\shell\open\command : "path to my exe" %1
\DefaultIcon": "path to my exe",1
Still whenver i create file with extention ".myext" it is associated correctly with my application, but the icon appearing next to the file is not the icon of my applicaiton, i think it is the icon of the wordpad file.
any idea how to display the icon..
Thanks!
-
August 19th, 2003, 11:07 PM
#6
Try to add "-" (negative sign) before the icon number
"path to my exe",-1
Hope it will help you
-
August 20th, 2003, 12:22 AM
#7
i had to use :
SHChangeNotify SHCNE_ASSOCCHANGED, SHCNF_IDLIST, 0, 0
from my application to notify other windows. But the problem is when i uninstall my program, the icon in front of the files created with my application still remains. i have to logout or something like that to remove it..is there an easier way to remove the icon..
-
August 23rd, 2003, 02:06 PM
#8
The file association does not work on XP...is there a different wayt to associate the extention to the application on XP.
I was successful in associating the file extention with my application on W2K. I created an entery called ".myext" under HKEY_CLASSES_ROOT pointing to MyApp.Document.
Created another entry under HKEY_CLASSES_ROOT called MyApp.Document.
Under MyApp.Document created two keys:
\shell\open\command : "path to my exe" %1
\DefaultIcon": "path to my exe",-1
But the baove procedure doe snot work on XP. Any idea??
Thanks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|