🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #13684

Re: Send a mail with attachment

#13684
From: Remy Lebeau (TeamB)
Date: Sun, 28 Sep 2003 20:54
30 lines
2453 bytes
"Rodolfo Frino" <rodolfofrino@yahoo.com> wrote in message
news:3f770460@newsgroups.borland.com...

> I have never said that MAPI is not the best way to go, and
> what's more I agree that MAPI
> is probably the most general method to do this job.

Then why do you keep suggesting to people to use your OE "automation"
instead of SimpleMapi/MAPI?

Asside from the issues already mentioned, there is another subtle reason why
your "automation" is not reliable - it uses keybd_event().  You cannot
direct where keybd_event() sends its input.  If the user happens to switch
windows while your code is still sending keystrokes, or if the message
window simply delays being displyed for whatever reason, then the keystrokes
will be directed to the wrong window, not the message window.  Thus, you
leave the message window incomplete and potentially mess up what the user is
doing with the new window, if any.

If you really want to "automate" OE's message window and fill it in
manually, then a more reliable approach would be to use FindWindow() to
locate the HWND for the new message window after it has been opened, then
use GetDlgItem() to get the HWND of each individual field a desired, then
use the WM_SETTEXT message to send the desired text to each field.  Then it
doesn't matter what the user does, the text will always be directed to the
correct HWND regardless of focus.


Gambit
Technical Details
Message-ID: <3f774a65@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3f70794d@newsgroups.borland.com> <3f7545de@newsgroups.borland.com> <3f763170$1@newsgroups.borland.com> <3f770460@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,23d9e1242f297072
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-09-28 14:09:07 PST
From: "Remy Lebeau \(TeamB\)" <gambit47@yahoo.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3f70794d@newsgroups.borland.com> <3f7545de@newsgroups.borland.com> <3f763170$1@newsgroups.borland.com> <3f770460@newsgroups.borland.com>
Subject: Re: Send a mail with attachment
Date: Sun, 28 Sep 2003 13:54:59 -0700
Lines: 32
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 67.23.78.204
Message-ID: <3f774a65@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1064782437 67.23.78.204 (28 Sep 2003 13:53:57 -0700)
Path: arc1-ca.pugleaf.net!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail