473,569 Members | 2,634 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Determining the application currently associated w/ file type...

I'm writing an application where then end-user will want to view and print
(not edit) TIFF and JPEG images. For now, I simply use the
System.Diagnost ics.Process.Sta rt method to open the desired image with the
application currently associated with that file type.

However, sometimes the wrong application is associated with a file type.
For example, Microsoft Office Picture Manager will only display the first
page of a multi-page TIFF image with no way to view the additional pages
(that I know of). Also, I suspect it may be possible that some older
machines running Windows ME or Windows 98 may not have an application
associated with TIFF images.

So, I'd like to check on the current application associated with TIFF
images. What is the best way to go about doing that?

Any advice or suggestions are greatly appreciated.

Thanks,

Carl
Nov 21 '05 #1
1 1565
On Fri, 22 Jul 2005 10:19:17 -0700, "Vagabond Software" <vagabondsw-X-@-X-gmail.com> wrote:

¤ I'm writing an application where then end-user will want to view and print
¤ (not edit) TIFF and JPEG images. For now, I simply use the
¤ System.Diagnost ics.Process.Sta rt method to open the desired image with the
¤ application currently associated with that file type.
¤
¤ However, sometimes the wrong application is associated with a file type.
¤ For example, Microsoft Office Picture Manager will only display the first
¤ page of a multi-page TIFF image with no way to view the additional pages
¤ (that I know of). Also, I suspect it may be possible that some older
¤ machines running Windows ME or Windows 98 may not have an application
¤ associated with TIFF images.
¤
¤ So, I'd like to check on the current application associated with TIFF
¤ images. What is the best way to go about doing that?
¤
¤ Any advice or suggestions are greatly appreciated.

You can use the FindExecutable API function call:

Declare Function FindExecutable Lib "shell32.dl l" Alias "FindExecutable A" (ByVal lpFile As
String, _
ByVal lpDirectory As
String, _
ByVal lpResult As
System.Text.Str ingBuilder) As Int32

Function FindAssociatedA pp(ByVal FullFilePath As String) As String

Dim FileDir As String

Dim FileExecutableP ath As New System.Text.Str ingBuilder(255)

If FindExecutable( FullFilePath, FileDir, FileExecutableP ath) > 32 Then
Return (FileExecutable Path.ToString)
End If

End Function
FileExecutableP ath = FindAssociatedA pp("e:\My Documents\book1 .xls")

Paul
~~~~
Microsoft MVP (Visual Basic)
Nov 21 '05 #2

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

Similar topics

3
9879
by: Jenkins | last post by:
I have a page with frames. The left frame is a list of urls. The main frame is loaded based on the url that was clicked in the left frame. Is there a way for the main frame to tell which url was clicked in the left frame? I'd like to avoid having to use a name/value pair in the links in the left frame, which I'm currently doing. I'd prefer...
1
5399
by: RWC | last post by:
Hi Folks, I'm looking for a way to determine if the client machine has access installed and if so, what version. The reason I need this is to determine (programatically) if the Access Runtime is required to be installed and if not, which version of the program database needs to be installed with the current version of Access. (hope that...
1
1486
by: Funk | last post by:
Hi, I am currently creating a system that will support web based research. The idea is that the researcher is able to use Internet Explorer or Mozilla, or whichever browser to search for information and then be able to paste little tidbits of information to a seperate frame which will then be associated with the page they are viewing in...
6
3631
by: Kenneth Courville | last post by:
Hello, I'm looking for assistance with the Access object model. I know this is VB, but I'm building an Office Add-using C# directed at Access 2002. I'm literate in VB, so you can reply in VB... I think my problem mainly lies in knowing the quirks of the Access object model. Basically, I'm looking for a method of determining if an Access...
2
4007
by: Stephen Walch | last post by:
I have seen many examples on the web for downloading attachments ffrom ASP.NET forms using response.WriteBinary, but they all use hard-coded ContentTypes (for example, Response.ContentType = "application/pdf"). Is there a good way to "guess" the content type for arbritary file name? Every web server has a mapping from file extension to...
2
1589
by: david | last post by:
I have a basic problem about MS. I can not change the associated application with file type. I have done the following. go Tools -->Folder Options-->File Types. However, the buttons such as New, Delete, Change, and Apply are disabled for all file type items in the file type list. Anyone could tell how to configure it or reset it? Thank...
2
2613
by: Robert | last post by:
I have an application migrated from 1.1 to 2.0 via VS2005. Under 1.1 I could do the following to return the version information (as found in the assemblyinfo.vb file) GetVersion = System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetExecutingAssembly.Location).FileMajorPart.ToString + "." +...
0
1118
by: bloggs | last post by:
I am writting an application that runs on an FTP server. The purpose of the app is to uncompress gzip files that are sent to the server and then move the file to another folder according to it's contents. The challenge I am having is preventing the application from uncompressing a file before the file has landed on the server in its entirety. ...
3
1596
by: Larry Hunt | last post by:
I am developing a class which will be used in both a WinForm and ASP.NET 2.0 application. The class needs to know which type of application it is running in. How do you programmatically determine what type of application (WinForm or ASP.NET) you are currently running in? I have looked at Environment.UserInteractive but this will not have the...
0
7924
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. ...
0
8130
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...
1
7677
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...
0
7979
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2115
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
1
1223
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
940
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.