How to display a modal dialog box on top of an email msg window in

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm writing a C# add-in for Outlook.
The add-in supposed to show a dialog box to the user before the user sends
an email.
My problem is that this dialog box is actually showing on top of the main
Oulook Application window and therefore it's not visible unless you change
focus to show it (although it's modal and blocks all other UI).
The question is how to find the href for the window of the email that is
being sent.
I can get the Inspector object for this dialog but there isn't seem to be
anyway to find the window handle.
Any ideas?
 
QI the Inspector object for IOleWindow, then call IOleWindow::GetWindow.
This won't work for the Word editor; GetForegroundWindow Windows API
function is a possible workaround.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
1. What do you mean by QI?
2. How do I define IOleWindow in C# ?
3. How do I define GetForegroudnWindow in C# ?
4. Does GetForegroundWindow returns the handle for the active window? (the
one that is in focus?

Thanks,

Inbar.
 
Back
Top