News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Send a mail from application

Started by franlou, June 18, 2010, 10:49:44 AM

Previous topic - Next topic

jj2007

Hi P1,
François was inspired by some "About" boxes containing clickable links - which is a legitimate purpose, and for which a ShellExecute mailto: is probably the right solution. So the thread (and my attachment above) deals mainly with the most elegant way to put a clickable link into a dialog.

franlou

sorry but "ResDlgHyperLink.exe"   works with Vista and not with W7!!

jj2007

Reassemble - it might work. Otherwise you may need a manifest.

Please tell me if the attached version works.

franlou

jj: I don't understand;
I can't see dialogbox when I "Buid "  again with Qeditor or Radasm?

I don't get error message...
Nothing is displaying on my computer


However when I use your .exe file from the zip file, I can see the dialogbox which works with Vista and not with W7; it is the same with your version "3"

jj2007

Try renaming ResDlgHyperLink.rc as rsrc.rc - Qeditor or Radasm probably assume that you create a new folder for each source (my own editor checks first if there is MySourceFile.rc, and only if a) it doesn't find that and b) there is a need for an rc file, it will use rsrc.rc).

jj2007

Here is a version that uses an interesting technique: a user-defined class in the resource file:

#include "\masm32\include\resource.h"

TestWin DIALOGEX DISCARDABLE 10, 10, 206, 132, 0
STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_CAPTION | WS_SYSMENU | WS_VISIBLE | WS_POPUP
CAPTION "Simply mail"
FONT 11, "MS Sans Serif", 900, 0
BEGIN
EDITTEXT 100, 2,2,156,128, ES_AUTOHSCROLL | ES_AUTOVSCROLL | ES_LEFT | ES_MULTILINE | ES_WANTRETURN, , 0
CONTROL "Type or paste your text, then click on the link below to launch your default mailer:", 126, STATIC, SS_NOTIFY | SS_LEFT, 160, 2, 44, 50+2
CONTROL "Send mail", 127, "MyStatic", SS_NOTIFY | SS_LEFT, 160, 5+50, 38, 10
END


With this new MyStatic class, the cursor behaves better than in the previous example (which would not have allowed a second static control).

franlou

jj:
I try tour different version

1/ I must change name of file "ResDlgHyperLink.rc" to "rsrc.rc" file to Built correctly the file   .exe with Qeditor
why ?  I don't know


2/ the different version that I get , so with  that uses a user-defined class in the resource file,
don't work with W7, but works with Vista

jj2007

I can't test it because I still have Win XP,  but I guess fumbling with security settings, compatibility modes, manifest files is the way to go...

franlou

With W7 the return valor after invoke ShellExecute , is : 31 (1F hexa)

jj2007

Quote from: franlou on June 24, 2010, 10:13:03 AM
With W7 the return valor after invoke ShellExecute , is : 31 (1F hexa)

So the proggie works in principle. Good news. Error 31 is SE_ERR_NOASSOC: There is no application associated with the given file name extension.

Save this as MyTest.htm and open it with a browser.

<html><head><title>Just a test</title></head><body>
<a href="mailto:Hutch@movsd.com">A link, wow!</a>
</body></html>

franlou

with Vista I got a window Mail
with W7 I got error message:(traduction...?!)
" Impossible to do this operationthen (le client de courrier électronique par défaut) is not icorrectly installed"

franlou

jj: finally I installed thinderbird  and that works !!  :lol
Windows7  not instal application for mail like Windows mail; we have the choice (!!) to install that we like!

jj2007


P1

Quote from: jj2007 on June 21, 2010, 10:04:49 PM
Hi P1,
François was inspired by some "About" boxes containing clickable links - which is a legitimate purpose, and for which a ShellExecute mailto: is probably the right solution. So the thread (and my attachment above) deals mainly with the most elegant way to put a clickable link into a dialog.
Thanks for extra info !!!

I was trying to discourage a SMTP engine send routine, seeing that it would not be either transmitting off private LANs or recieved on major mail systems.  Because of past SMTP viruses behavoir.

There should be some error control that should account for a missing "system" email component to use.

Regards,  P1   :8)

Farabi

If you had a website it would be easier to send email, you can use PHP script to deal for the Mail protocol. Your application just sent the text to the script.
Those who had universe knowledges can control the world by a micro processor.
http://www.wix.com/farabio/firstpage

"Etos siperi elegi"