You need to set the z-order of the Inspector window before you set the form
dialog's z-order. I usually use SetWindowLong to make the Inspector window
parented by the main Outlook window, then I make the dialog window a child
of the Inspector window. I try to avoid SetWindowPos() with HWND_TOPMOST
because if the user clicks in a completely different application the dialog
using HWND_TOPMOST still remains on top and that tends to completely annoy
users.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
"goran" wrote in message
...
I checked in Spy++. I have correct OpusApp window handle.I can't believe it
neither.
I have this on dropdown change event that suppose to launch dialog form:
SetWindowPos(frmDialog.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE Or
SWP_NOMOVE)
frmDialog.Show 1
then on Inspector_Activate I have:
hw = FindWindow("OpusApp", vbNullString) this is where I capture Inspector
Handle
and on dialog form Activate event I try to set Inspector as foreground
window like:
Form1_Activate()
SetForegroundWindow(hw)
end sub
And when I click dialog form Inspector window which is foreground window
gets minimized. I even tried SetActiveWindow(hw), ShowWindow hw,
SW_SHOWACTIVATE etc to keep Inspector from dissapearing. I event put code
in
Inspector_Deactivate event to check if DialogForm is visible, If it is I
call
inspector.activate method. That does help sometimes but not always. Any
ideas
what should I try?
Thanks