JvMail & Outlook Express

Posted on 2009-02-14
Medium Priority
Last Modified: 2012-05-06
XP Pro III + D2007

I also used RapWare, same problem.

I create a PDF File, which I attach.

After JvMail1.SendMail a couple of problems manifest themselves:

1) On closing the OE New Message Screen, my App disappears into the Background
2) When I delete the Tempfile with Assignfile(F); erase(F); it takes a very long time to execute

I have tried with Application.BringToFront which works, but produces a lot of Flickering and with anything other than OE, for instance Thunderbird, Thunderbird disappears into the Background.

BringWindowToTop(Handle)  doesn't always keep the App on Top.

I have also tried to run the SendMail procedure in a separate Thread, but also to no avail.

The OE Interface appears to be system modal, while Thunderbird doesn't.

I think, if there were a way to run OE Non-Modal, I could cater for both, but I don't seem to find anything anywhere.

Kind Regards
Question by:WRieder
  • 2

Author Comment

ID: 23644263
After some googling I found, that a problem with some versions of OE was that after calling a mapi send function the calling window became non-modal and disappeard  into the background. The following solution was recommended:

EnableWindow(Application.MainForm.Handle, False);

This seems to also prevent the App from disappearing into the Background.

I should maybe more clearly define my question, which actually is comprised of two parts:

1) Is it possible to make the NewMessage Popup of OE Non-Modal to prevent this annoying flickering?

2) What could cause the deletion of a File using "AssignFile(F); Erase(F)" to be so slow? The computer almost seems to "hang" for up to 25 Secs. (This is not consistent behaviour though, sometimes there is absolutely no delay)

If this is too complex for the points assigned, please indicate what you would like for a solution.

Kind Regards

Accepted Solution

WRieder earned 0 total points
ID: 23644394
I just found the solution. In JvMail I definded a public Variable like so:

CallingWindow: HWND;

In the calling Window:

JvMail1.CallingHandle := Self.Handle;

and then changed the TJvMail.SendMail procedure to use CallingHandle instead of Application.Handle
like so:

procedure TJvMail.SendMail(ShowDialog: Boolean);
  Flags: ULONG;
    Flags := LogonFlags;
    if ShowDialog then
      Flags := Flags or MAPI_DIALOG;
      ErrorCheck(FSimpleMapi.MapiSendMail(FSessionHandle, CallingHandle,
        FMapiMessage, Flags, 0));

Maybe someone might find this useful.

Kind Regards

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month15 days, 7 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question