On 5/25/2007 10:08:39 PM, Ian Binnie wrote:
>
>Ted, I have no problem with the current.
>XP has a list of "Recommended Programs"
>(not sure where this resides in
>registry)
>
>There is also an option "Always use this
>program to open these files", which may
>be worth investigating.
On my computer, the "Always use this program.." option is gray, so it can not be unchecked. (Maybe this is because of some security settings.)
Anyway, I changed the "Open with" setting from the properties, and now double-click does open the file in Vedit.
Strange thing is that on the "General" tab, it said "Open with CodeWright". But when I clicked "Change" to display the list of programs, Vedit was already highlighted.
>
>You can check associations at cmd prompt by:-
>assoc .txt
>(.txt=txtfile)
>
>then
>ftype txtfile
>(txtfile=d:\vedit\vpw.exe "%1")
I tried that. Before I had changed the association from Properties, the command assoc .c displayed
cfile
and then "ftype cfile" command displayed
cfile="c:\apps\vedit\vpw.exe" "%1"
Still, when I entered a filenamme, e.g. main.c,
the file opened in CodeWrigth.
After I had changed the properties, the command prompt opens the files in Vedit.
Looks like Windows XP does not actually use the keys that are displayed with cfile etc. but instead those displayed in the properties.
I compared the keys before and after changing the "Opens with" property. The only difference I found was that when any other application was associated to an extension, there is the following key (for .c files):
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.c\Application
and it contains the name of the exe file (without path), e.g. "cw32.exe".
When Vedit is set as "Open with" program, the key above disappears.
(The same key is in HKEY_USERS hierarchy, too.)
So, I guess you need to either delete the key or set it's value to "vpw.exe". The following command seems to work:
Registry_Set_Item("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.c\Application=vpw.exe")
But I don't know if that should be set in HKEY_USERS, too.
--
Pauli
|
|