-
Jun 18th, 2012, 01:47 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Vb6 - how to (detect and) lauch default email program ?
Dears,
as the title says but also without using additional controls if possible, that's cos I want to make all my programs free from any kind of dependacies as much as I can
thanks, regards
-
Jun 18th, 2012, 01:51 PM
#2
Frenzied Member
Re: Vb6 - how to (detect and) lauch default email program ?
Yes ,That is ok .but which type of programme you want to make .can you explain at bit ?.
-
Jun 18th, 2012, 02:07 PM
#3
Re: Vb6 - how to (detect and) lauch default email program ?
This example shows how to launch default email client and default browser. It uses a button control but you can remove that and put the code in your Form_Load but then you have no control over it from one time to another so I think you will at least need a button and a textbox if you want to include the recipient,
Code:
Private Declare Function ShellExecute Lib _
"shell32.dll" Alias "ShellExecuteA" _
(ByVal hWnd As Long, ByVal lpOperation _
As String, ByVal lpFile As String, ByVal _
lpParameters As String, ByVal lpDirectory _
As String, ByVal nShowCmd As Long) As Long
Private Const SW_SHOWNORMAL = 1
Private Sub Command1_Click()
'
' Optional -----------------------------------+
' |
ShellExecute 0&, vbNullString, "mailto:someone@somewhere.com", vbNullString, vbNullString, SW_SHOWNORMAL
'
' For browser
'
'ShellExecute 0&, vbNullString, "http://www.google.com", vbNullString, vbNullString, SW_SHOWNORMAL
End Sub
Last edited by jmsrickland; Jun 18th, 2012 at 02:33 PM.
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
-
Jun 18th, 2012, 02:08 PM
#4
Re: Vb6 - how to (detect and) lauch default email program ?
A bit more info on what you are trying to,achieve may help ?
Do you really need to detect the default email program ?
If you are wishing to open the user's default email program with say your email address as the recipient, you do not need to detect the default email program, you can let Windows handle that for you. You just use ShellExecute and pass it the email address, and it does the rest for you.
If I am on the wrong track, providing more info would have avoided that.
I will dig up an example, whilst awaiting your reply
Rob
PS I see someone else has taken a punt at guessing what your needs were, and has posted an example of that API call.
Were we both right (in our guesses) ?
-
Jun 18th, 2012, 02:26 PM
#5
Re: Vb6 - how to (detect and) lauch default email program ?
Originally Posted by Bobbles
PS I see someone else has taken a punt at guessing what your needs were, and has posted an example of that API call.
Were we both right (in our guesses) ?
Correction: I didn't guess
Last edited by jmsrickland; Jun 18th, 2012 at 02:30 PM.
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
-
Jun 18th, 2012, 02:41 PM
#6
Re: Vb6 - how to (detect and) lauch default email program ?
Originally Posted by jmsrickland
Correction: I didn't guess
Unless you have contacted horazio outside of this thread, you did guess - because there is absolutely nothing in his post to say (or even imply) that he wants to create a new email. It is a likely possibility, but far from being a certainty... there are lots of other reasons to open an email program.
-
Jun 18th, 2012, 02:52 PM
#7
Thread Starter
Hyperactive Member
Re: Vb6 - how to (detect and) lauch default email program ?
I'm designing a "phone book" program and I want to add a lot of cool stuff.
My programming skills are kinda basic and I'm sure there are thousands of phone book apps out there for free, but I still want to make my own.
For example I want to doubleclick on a contact and it automatically launches the email to that contact, for instance.
So yes, I need to auto-detect the default email software.
Shellexecute from what I've seen here on yr replies seem to be pretty solid and quick to use.
Last edited by horazio; Jun 18th, 2012 at 02:55 PM.
-
Jun 18th, 2012, 03:32 PM
#8
Re: Vb6 - how to (detect and) lauch default email program ?
horazio,
It appears that this thread is resolved ?
If so then you should mark it RESOLVED, using the Thread Tools menu.
Sorry to 'nit pick' but it may help for your future threads.
When you still say "So yes, I need to auto-detect the default email software" the use of the term "auto-detect" implies that your program needs to know (detect) the email program. Whereas all your program needs is the ability to "auto launch a new email", using whatever default method the user has previously set up..
Si,
Thanks for chipping in. I was stunned speechless there for a while.
-
Jun 18th, 2012, 04:08 PM
#9
Re: Vb6 - how to (detect and) lauch default email program ?
Sorry about the confusing. I thought you meant I guessed at the code I posted but as I read what you posted better I see you said his requirements. Didn't mean to sound aggressive.
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
-
Jun 19th, 2012, 04:51 AM
#10
Thread Starter
Hyperactive Member
Re: [RESOLVED] Vb6 - how to (detect and) lauch default email program ?
OK I confirm shellexecutes is perfect for what I was lookin for.
I also added reputation to yr answer .
Thanks again.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|