473,320 Members | 1,858 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Can you check for Windows File-type Association

Rob
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 Explorer to
show, using a plug-in).
THis works fine as long as they have the plug-in installed. If they
don't have the plug-in, when I try to open the file with IE, it gives
the old "Would you like to OPEN this file or SAVE it to disk?" and it
displays the full path to the file. We want to hide the location of
the files, so we either need to eliminate that piece of the dialog
box, or don't allow the dialog to pop up at all. I guess if we could
test to see whether or not they have a valid "file association" in
windows for the filetype they are trying to open, we could provide our
own message about loading the plug-in and then NOT show the dialog to
open/save.
Any help would be appreciated.
Rob
Nov 13 '05 #1
4 2578
si****@ensco.com (Rob) wrote:
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 Explorer to
show, using a plug-in).
THis works fine as long as they have the plug-in installed. If they
don't have the plug-in, when I try to open the file with IE, it gives
the old "Would you like to OPEN this file or SAVE it to disk?" and it
displays the full path to the file. We want to hide the location of
the files, so we either need to eliminate that piece of the dialog
box, or don't allow the dialog to pop up at all. I guess if we could
test to see whether or not they have a valid "file association" in
windows for the filetype they are trying to open, we could provide our
own message about loading the plug-in and then NOT show the dialog to
open/save.


I know there are API calls for determining what file extensions belong to what
programs. I just saw a title to an article at vbnet.mvps.org yesterday.

Presumably there is an API call for IE as well. If you don't get But you'd have to
do some digging. I'd suggest starting at groups.google.com if you don't get an
answer here.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Nov 13 '05 #2
Tony Toews <tt****@telusplanet.net> wrote in
news:2l********************************@4ax.com:
si****@ensco.com (Rob) wrote:
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
Explorer to show, using a plug-in).
THis works fine as long as they have the plug-in installed. If
they don't have the plug-in, when I try to open the file with IE,
it gives the old "Would you like to OPEN this file or SAVE it to
disk?" and it displays the full path to the file. We want to hide
the location of the files, so we either need to eliminate that
piece of the dialog box, or don't allow the dialog to pop up at
all. I guess if we could test to see whether or not they have a
valid "file association" in windows for the filetype they are
trying to open, we could provide our own message about loading the
plug-in and then NOT show the dialog to open/save.
I know there are API calls for determining what file extensions
belong to what programs. I just saw a title to an article at
vbnet.mvps.org yesterday.


I don't know the APIs. But maybe delving into the ShellExecute code
on the Access web might give some clues.

Then again, maybe not, as it's probably using the native API that
does all the determination of the application to load in its
internal workings.

Then again, just Googling a bit, I came up with this about
ShellExecute:

http://www.mentalis.org/apilist/ShellExecute.shtml

And that has an error code for no file association.
Presumably there is an API call for IE as well. If you don't get
But you'd have to do some digging. I'd suggest starting at
groups.google.com if you don't get an answer here.


Why program to IE, a browser that is no longer in development, and
for which there will be no more updates independent of OS service
packs, when you could handle the problem in a way that makes your
solution browser-agnostic?

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #3
Rob
"David W. Fenton" <dX********@bway.net.invalid> wrote in message news:<Xn**********************************@24.168. 128.78>...
Tony Toews <tt****@telusplanet.net> wrote in
news:2l********************************@4ax.com:
si****@ensco.com (Rob) wrote:
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
Explorer to show, using a plug-in).
THis works fine as long as they have the plug-in installed. If
they don't have the plug-in, when I try to open the file with IE,
it gives the old "Would you like to OPEN this file or SAVE it to
disk?" and it displays the full path to the file. We want to hide
the location of the files, so we either need to eliminate that
piece of the dialog box, or don't allow the dialog to pop up at
all. I guess if we could test to see whether or not they have a
valid "file association" in windows for the filetype they are
trying to open, we could provide our own message about loading the
plug-in and then NOT show the dialog to open/save.
I know there are API calls for determining what file extensions
belong to what programs. I just saw a title to an article at
vbnet.mvps.org yesterday.


I don't know the APIs. But maybe delving into the ShellExecute code
on the Access web might give some clues.

Then again, maybe not, as it's probably using the native API that
does all the determination of the application to load in its
internal workings.

Then again, just Googling a bit, I came up with this about
ShellExecute:

http://www.mentalis.org/apilist/ShellExecute.shtml

And that has an error code for no file association.
Presumably there is an API call for IE as well. If you don't get
But you'd have to do some digging. I'd suggest starting at
groups.google.com if you don't get an answer here.



Why program to IE, a browser that is no longer in development, and
for which there will be no more updates independent of OS service
packs, when you could handle the problem in a way that makes your
solution browser-agnostic?


Thanks to you both for your help. I found EXACTLY what I wanted at
the Access Web at http://www.mvps.org/access/modules/mdl0013.htm
Code courtesy of Dev Ashish.
Thanks!

As far as using IE, is it going away? I just used it because I could
open a variety of files with it (some via a plug-in). How could I
allow users to open a file (from inside my app) of unknown file-type,
when I don't know if the user will have an app available to open it?
(making my app more browser-agnostic)
Anyway, thanks for your help.
Nov 13 '05 #4
si****@ensco.com (Rob) wrote in
news:bd*************************@posting.google.co m:
As far as using IE, is it going away? . . .
As a separate, downloadable, product, yes, it's going away.

The security fixes to IE in WinXP SP2 (which are essential to having
the most minimal level of safety) are not scheduled to be broken out
for download as separate patches, so WinXP SP2's IE is going to be
the only one with even the most minimal security.
. . . I just used it because I could
open a variety of files with it (some via a plug-in). How could I
allow users to open a file (from inside my app) of unknown
file-type, when I don't know if the user will have an app
available to open it? (making my app more browser-agnostic)


I explained an avenue of how to go about this in describing the
ShellExecute article -- the ShellExecute API returns an error value
when there is no app installed to execute a file type. If you
trapped for that error, you could then create your own prompt for
the user based on that.

If you don't understand the ShellExecute code there, then post to
the group and I'm sure folks here will help you through it.

As to browser-agnostic techniques, I don't understand, given all the
myriad weaknesses in IE's security and the numerous really dangerous
exploits that have caused CERT to advise users to install non-IE
browsers, I don't understand why anyone in their right mind would be
using IE at this late date.

It lacks so many features and is slower than the Mozilla-based
browsers.

Coding to its specific API (assuming it hasn't changed with every
major IE release, which I wouldn't bet 10 cents on) would be tying
your users to the worst browser available today.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #5

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

Similar topics

2
by: martijn | last post by:
Hi There, my vb app can open files. Well, actually my vb app launches word or excell to open them. These files are shared in a network. If somebody else has allready opened that file, you...
11
by: Wolfgang Kaml | last post by:
Hello All, I have been working on this for almost a week now and I haven't anything up my sleeves anymore that I could test in addition or change.... Since I am not sure, if this is a Windows...
2
by: Jak Sparrow | last post by:
What are some good ways to programmatically check for software already installed on a computer? For example, to check a version of Internet Explorer, a program can check the registry for the...
3
by: Chris | last post by:
Hi, In C# I tried to save a file from a generated file name. Just before launching the dialog I check for a valid file name to be sure. There for I used the method ValidateNames from the save...
12
by: Anders Eriksson | last post by:
Hello! I'm trying to create a program that will watch a directory and when a file is created print that file. I have used FileSystemWatcher for watching the directory and I get an created event....
5
by: DazedAndConfused | last post by:
How would you check in an application for missing dll's so that the application would inform the user what is wrong?
9
by: Mark | last post by:
Hi all, This is something which has been bugging me for ages. How can I check if a file is already in use by a different program? It doesn't seem to matter which mode I pass to fopen, it will...
6
by: Fred W. | last post by:
When my application starts I need to check folder permissions to ensure they have "Full Control" before I let them proceed on. How can I check this permission. Thank you, Fred
9
by: webrod | last post by:
Hi all, how can I check a user/password in a LDAP ? I don't want to connect with this user, I would like to connect to LDAP with a ADMIN_LOG/ADMIN_PWD, then do a query to find the user and...
10
by: Cliff72 | last post by:
Is there a way in VBA to check if a linked table in the database has been updated? Example: I have a table "LedgerTemp" which is a direct link to a text file on the LAN "Ledger.txt" This text...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.