473,750 Members | 2,190 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2612
si****@ensco.co m (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.c om 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****@teluspl anet.net> wrote in
news:2l******** *************** *********@4ax.c om:
si****@ensco.co m (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.c om 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********@bwa y.net.invalid> wrote in message news:<Xn******* *************** ************@24 .168.128.78>...
Tony Toews <tt****@teluspl anet.net> wrote in
news:2l******** *************** *********@4ax.c om:
si****@ensco.co m (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.c om 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.co m (Rob) wrote in
news:bd******** *************** **@posting.goog le.com:
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
8279
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 must get a requester that says the file is temporarily unavaillable because it is edited somewere else.
11
3763
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 2003 Server or ADO or ODBC issue, I am posting this on all of the three newsgroups. That's the setup: Windows 2003 Server with IIS and ASP.NET actiavted Access 2002 mdb file (and yes, proper rights are set on TMP paths and path,
2
8125
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 following value: Version, and see if the version is 6.0 or not. However, not all installed software can be checked as easily. For example, Windows Media Player 9 has the following registry path:
3
14537
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 dialog. The strange thing is that sometimes the save dialogue
12
15917
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. The problem is that I don't know when the file is complete when using Explorer copy or move. I have tried to use FileIOPermission but I always get that the file is
5
2065
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
10266
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 always allow me to open the file. I've tried r, r+, w, w+, a, and a+ but still the fopen call will not return null. Basically what I'm doing is using a kqueue to watch a particular
6
39970
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
15527
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 check the password. The thing is I can't access the password attribute to compare with the user's password provided.
10
4845
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 file is periodically updated (overwritten) through out the day and night by some mainframe jobs. Right now I just manually run a macro that just basically appends data from the linked "LedgerTemp" table to a local table "Ledger"
0
8999
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8836
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9575
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9394
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9338
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6803
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4885
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3322
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 we have to send another system
2
2798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.