Following is the sample code in [VB.NET]
'--Declaration
Public Declare Auto Function FindExecutable Lib "shell32.dll" (ByVal lpFile As String, ByVal lpDirectory As String, ByVal lpResult As String) As Int32
'--
Dim intRetval As Integer = FindExecutable(PDF FILE FULL PATH NAME, "", "")
If intRetval < = 32
MessageBox.Show("The Adobe Reader, which is required to view this file, may not be correctly installed.", "Adobe Reader Not found", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
End if
http://www.mindfiresolutions.com/FindExecutable-API-569.php
Josh wrote:
Get default browser NOT by the registry
21-Feb-10
Hi group
I have been searching for a while for the "right" way to get the defaul
program for specific protocols and file types, namely http and http
protocols as well as the various htmlfile types. Everything that I com
across has to do with querying the HKCR section of the registry, but thi
does not seem to be the right way of doing it. When I launch a URL on m
computer, Windows performs some action to determine what program shoul
handle that call. I assumed that there'd be an API call in Win32 o
elsewhere that I could use to determine this same information, as opposed t
going to the registry. The location of this information varies betwee
OSes, so instead of trying to go around the Windows API layer to get th
info, I'd like to write my code to basically say, "Hey, Windows. YOU kno
what to launch when an http request is invoked, same with https (whic
~could~ be different), same with any htmlfile-associated extension. Woul
you please let me know what executable you would call for each of these?
So, does anyone know of an API call to get this info as opposed to going t
the registry for it
Thank you
Previous Posts In This Thread:
Get default browser NOT by the registry
Hi group
I have been searching for a while for the "right" way to get the defaul
program for specific protocols and file types, namely http and http
protocols as well as the various htmlfile types. Everything that I com
across has to do with querying the HKCR section of the registry, but thi
does not seem to be the right way of doing it. When I launch a URL on m
computer, Windows performs some action to determine what program shoul
handle that call. I assumed that there'd be an API call in Win32 o
elsewhere that I could use to determine this same information, as opposed t
going to the registry. The location of this information varies betwee
OSes, so instead of trying to go around the Windows API layer to get th
info, I'd like to write my code to basically say, "Hey, Windows. YOU kno
what to launch when an http request is invoked, same with https (whic
~could~ be different), same with any htmlfile-associated extension. Woul
you please let me know what executable you would call for each of these?
So, does anyone know of an API call to get this info as opposed to going t
the registry for it
Thank you
On 2/21/2010 3:55 PM, Josh wrote:If I understand what you are after, I have
On 2/21/2010 3:55 PM, Josh wrote
If I understand what you are after, I have always just done it this way
Process p = new Process()
p.StartInfo.FileName = "
http://www.microsoft.com"
p.StartInfo.Verb = "open"
p.Start()
-
Mike
Thanks Mike, but no, I am not looking to launch a URL.
Thanks Mike, but no, I am not looking to launch a URL. I am looking to fin
out what program *would* be launched, not actually launch it. I am lookin
for info on the default http handler, default https handler, and defaul
htmlfile handler, but I am not looking to launch anything.
toThere is not one.
t
There is not one. ShellExecute uses HKCR\http\shell\open to determin
which browser to launch when it is passed a string that starts with http:/
..
"Josh" <no spam please.
"Josh" <no spam please. Thanks> wrote in message
You could TRY using the FindExecutable() API function, but the docs state
that the file name you pass in "should be a document." I do not know it it
will work with a simple URL, like
http://www.microsoft.com. You could go the
cheesy way and give it the name of an HTML file and just play the odds that
99.99999999999% of people have the same program associated with .HTM that
they do with the HTTP
protocol.
Thank you Jeff.
Thank you Jeff. it is interesting that there is not a single point of entry
for determining this info, but at least I know to stop looking. ![Smile :) :)](/styles/default/custom/smilies/smile.gif)
There is a slight chance for this product I am making that someone would want
to distinguish among http, https, and htmlfile, but I am not going to get
bogged down by it now. We'll save that for release 2!
Thanks a lot for your input.
Submitted via EggHeadCafe - Software Developer Portal of Choice
Free Online Courses Available for Eggheadcafe.com Users
http://www.eggheadcafe.com/tutorial...8-fc3cf6855293/free-online-courses-avail.aspx