• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 888
  • Last Modified:

JvMail & Outlook Express

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
  • 2
1 Solution
WRiederOwnerAuthor Commented:
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
WRiederOwnerAuthor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now