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

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?
 
D

Dmitry Streblechenko \(MVP\)

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
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top