We help IT Professionals succeed at work.

Howto programaticaly associate http:// to a application

mindphaser
mindphaser asked
on
or any other 'protocol' like ftp:// or whatever://
Comment
Watch Question

TimCotteeHead of Software Services
CERTIFIED EXPERT

Commented:
Generally speaking, it is not the protocol that you associate, rather the filetype. For instance, a file with an extension of .htm or .html will normally be associated with your webbrowser (Internet Explorer etc). The different connection protocols cannot be identified and associated in the same way (if at all).

Author

Commented:
I believe I'm confused on what grounds associated
applications is launched.

When executing "ftp://" or "http://" on my box MSIE is launched and "mailto:" triggers Outlook.

I want to create "myapp:" as an association to my application.

Doable?

Author

Commented:
I believe I'm confused on what grounds associated
applications is launched.

When executing "ftp://" or "http://" on my box MSIE is launched and "mailto:" triggers Outlook.

I want to create "myapp:" as an association to my application.

Doable?

Author

Commented:
No, that is not what I'm looking for.

That explains why "c:\index.html" launches MSIE (or browser of your choice :-)

I'm looking for the registry settings that associates a
string like "http://www.altavista.com/" with the browser.

Are you talking about shortcuts? i.e. You could have a shortcut called 'fred' on your desktop that would launch any app you choose? When you say 'executing' what do you mean? Double-clicking on an icon (that may be a shortcut as described above) or do you mean from a command line?

Author

Commented:
I'm not sure shortcut is the term. Consider this code:

Dim i As Long
Dim Scr_hDC As Long
Scr_hDC = GetDesktopWindow()
i = ShellExecute(Scr_hDC, "", "mailto:mindphaser@domain.com", "", "C:\", SW_SHOWNORMAL)

It launches Outlook on my box.

I want to make the registry settings to allow the following code launch the util I'm writing

Dim i As Long
Dim Scr_hDC As Long
Scr_hDC = GetDesktopWindow()
i = ShellExecute(Scr_hDC, "", "myapp:mindphaser@domain.com", "", "C:\", SW_SHOWNORMAL)

Commented:
I think you need to set your app as the default mail client to do that.




Author

Commented:
Problem is I don't want my app to handle stuff starting with "mailto:", I want it to handle "myapp:"

I think I'm onto something. Check:

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\mailto
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\PROTOCOLS\Handler\mailto

Author

Commented:
To anyone monitoring, those of you who kindly has commented or if you're just wondering what the heck I'm trying to accomplish, here's where I am at the moment:

Asynchronous Pluggable Protocol
 
http://msdn.microsoft.com/library/default.asp?url=/workshop/networking/pluggable/overview/overview.asp

What is proper manners at the site? Leave the question open and post the solution myself when (hopefully) done?

I'll happilly throw points on anyone bringing me faster to the complete solution.

Author

Commented:
And this link has the complete solution to my poorly defined question:

http://msdn.microsoft.com/library/default.asp?url=/workshop/networking/pluggable/overview/appendix_a.asp
TimCotteeHead of Software Services
CERTIFIED EXPERT

Commented:
mindphaser, looks like you found the solution. Protocol here would be to post a zero point question in http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt and ask them to reduce the points to 0 and PAQ the thread as it has useful information that others may require.

Author

Commented:
Thanks for the help TimCottee
Commented:
As mindphaser has answered his/her own question, I will refund the points, and will PAQ the queston myself.

Thanks all,
ComTech
Community Support Moderator

Author

Commented:
Solution has moved at MSDN:
http://msdn.microsoft.com/en-us/library/aa767916.aspx

the essence of the article in case articles move again:

Example
The following example shows how to register an application, alert.exe in this case, to handle an alert protocol.

HKEY_CLASSES_ROOT
alert
(Default) = "URL:Alert Protocol"
URL Protocol = ""
DefaultIcon
(Default) = "alert.exe"
shell
open
command
(Default) = "C:\Program Files\Alert\alert.exe" "%1"

Explore More ContentExplore courses, solutions, and other research materials related to this topic.