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
"Ken Slovak - [MVP - Outlook]" wrote:
I've never seen or heard of that but it's most likely that you're getting
the hWnd for an incorrect window. Get the hWnd and then use Spy++ to see
what window handle you're actually getting.
--
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
...
Ken,
Sorry to bother you again, but this is driving me crazy. My Add-in adds a
dropdowncombo on every mail inspector toolbar. When user selects something
from dropdowncombo, new modal form dialog opens on the top of the
inspector.
I used SetwindowPos to set this small dialog on the top and also used
SetForegroundWindow for inspector window. However when I click on the
modal
form Inspector window gets minimized and whatever window is under becomes
foreground. When I close modal dialog form, Inspector gets active and it
shows. I get hWnd of the inspector on Inspector activate event and use
that
handle to set inspector as foreground window inn modal form activate
event.
No matter what I do inspector window flashes and gets minimized when I
click
on anything on modal form. I need the inspector to stay in place until
modal
form is closed. Any ideas how to fix this? This only happens when email
editor is WordMail and when dll compiled, in design mode everything is OK.
Thanks in advance,
Goran