bob said:
hi richard,
having the dialog box pop is not the issue, most replies
have stated this can't be done and i don't have a problem with that.
OK.
i am creating a cd-rom and i want to put links on an auto start html
document that open some of the windows applicatioins like paint etc...
You cannot do this either. You cannot access programs (or any files for that
matter) on the local file system. You simply do not know where they are. For
example on one of platforms on one of my computers notepad lives at
e:\win2000b\notepad.exe. On the same computer there are notepads at
c:\win95chit\notepad.exe, c:\win95chis/notepad.exe and c:\win98\notepad.exe.
i can call them with file:///C:/WINDOWS/NOTEPAD.EXE but if i am to run
this on a number of windows platforms (eg: nt and win2000 would need to call
it via file:///C:/WINNT/NOTEPAD.EXE ) it won't work.
See above. WINDOWS and WINNT are only the defaults.
now i figure if i use something along the lines of:
file:///%systemroot%/NOTEPAD.EXE (although this does not work for me), the
link would work for any windows revision.
This is never going to work with a browser. I assume you obtained this by
looking at .INF files. Well, the windows installer (the bloke that processes
INF files) knows about this. The browser does not.
On most default systems you can open notepad by linking to a file like
file.txt - oops, no you can't, the browser will display it for you. Excell
*may* open if you link to spreadsheet.xls. Paint *may* open if you link to
picture.bmp (not on my system though). However this is totally beyond your
control so this is a dead end.
You *could* construct your own browser. This is actually very easy. C# is
the language to use, it comes with a built in browser control, all you have
to do is supply the chrome and you get to take action when a link is
activated. You could then use the standard Windows API functions to find
where notepad lives. You would have to abandon the visual bit and delve down
to the underlying C++. GetWindowsDirectory is the API function to use. Hmmm,
how do you find out where Word lives? Answer: you dont. Well, you actually
can if you wish to walk the registry looking for file associations that
point to word.exe (or whatever it's called)
Have you thought of using CHM files, you know, compiled html help, the ones
that windows use for all its help. The html help viewer (HH.EXE of course)
*can* run programs and *does* know about things like %systemroot%. Remember
last time you were searching around windows help and came across an icon
that said "show me"? Click on it and it opens control panel or network
diagnostics or whatever? The HTML help workshop may be downloaded from, of
course, microsoft.com. Once again though where does Word live?
We do, however, digress away from HTML
Cheers
Richard.