Outlook 2007 allows you to test for equality of two Inspector or Explorer
objects using the C# == operator or the VB Is operator. Earlier versions of
Outlook don't allow that.
What I usually do is to test for the window.Caption and also for the window
rectangle dimensions and coordinates. I use the Explorer (or Inspector) Top,
Left, Height and Width properties compared to the window I get using
FindWindow (a Win32 API call). If it's the foreground window you're working
with you can use GetForegroundWindow instead of using FindWindow.
--
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
"gernot" wrote in message
ups.com...
I am always getting different interface pointers for same explorer
objects. The same happens for inspector objects. What can a do to
unquely identify these objects?
Scenario:
1. In the NewInspector handler I save the _Inspector pointer.
2. In an event handler from a control in this inspector I use
IRibbonControl::get_Context() to obtain the corresponding _Inspector
pointer.
These pointers are never the same (comparing IUnknown pointers). These
COM objects are not the same!
In the case of inspectors I get away identifying them by its creation
date.
What can I do to identify explorers? Is there any Outlook method to
compare these objects?
Thanks, Gernot