Modal Dialog in ItemSend event

Add-in Express™ Support Service
That's what is more important than anything else

Modal Dialog in ItemSend event
 
Oliver Engst


Guest


Hi,

I created a COM Add-In for Outlook. It works as expected except the modal dialog.

For most users it stays at the top and blocks the Outlook window. This is as intended. For one user it disappears to the taskbar.

I call the dialog with MyForm.ShowDialog();

I realized that I should give the form the handle of the parent form. But I failed in getting a tutorial how to get the open mail window in the ItemSend event in Outlook.

Is there a tutorial somewhere?

Any hint will be appreciated

Thanks in advance
Oliver
Posted 20 Dec, 2010 09:21:53 Top
Andrei Smolin


Add-in Express team


Posts: 19111
Joined: 2006-05-11
Hi Oliver,

You need to use the ShowDialog(IWin32Window) overload. Please search our forums for " IWin32Window".

To find the hwnd of the corresponding Outlook window, use ADXAddinModule.GetOutlookWindowHandle(object outlookWindow).

Is this what you are looking for?


Andrei Smolin
Add-in Express Team Leader
Posted 20 Dec, 2010 09:37:10 Top
Oliver Engst


Guest


Hi Andrei,

thanks for your fast reply.

I realized that I need the handle. But I could not find a way to retrieve it in the ItemSend event. What do I need to pass to the ADXAddinModule.GetOutlookWindowHandle(object outlookWindow) call?

Best regards
Oliver
Posted 22 Dec, 2010 02:52:23 Top
Andrei Smolin


Add-in Express team


Posts: 19111
Joined: 2006-05-11
Hi Oliver,

An Outlook.Inspector or Outlook.Explorer object.


Andrei Smolin
Add-in Express Team Leader
Posted 22 Dec, 2010 04:51:06 Top