Set Dialog-owner to Outlook-window

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

Set Dialog-owner to Outlook-window
Bert Stomphorst

Posts: 21
Joined: 2005-10-31

When I call a ShowDialog from my toolbar in Outlook, I want to 'bind' the dialog to the Outlook-window. Therefore I use the owner-parameter from ShowDialog, but what do I have to specify for that parameter? Which object does expose the IWin32Window-object?

thank you,
Posted 29 May, 2006 03:55:56 Top
Sergey Grischenko

Add-in Express team

Posts: 7235
Joined: 2004-07-05
Hi Bert.

You should implement the IWin32Window interface yourself.
As a handle in the Handle property you should pass the handle of the active window. You can use the GetForegroundWindow (when Word is used as an editor) or GetActiveWindow functions to obtain the handle of the parent window (see MSDN to read about these function).
Posted 29 May, 2006 12:46:11 Top