How to get active inspector window handle?

M

madhavi

Hi,

I am trying to get the inspector window handle as I need to add one or two components (like button etc) to the inspector. I used the below code and I am getting the active window of outlook is correct. But the handle I am getting is not correct when I examined it with spy++.

What could be wrong in this?

Also if I have more than one mail opened with same title, How can we get the handle of the actually the currently active inspector window? (As to find the handle, we are just passsing the tile and two or more windows have the same title)

Please provide me some help to resolve this problem.
Thanks in advance.
Submitted using http://www.outlookforums.com
 
K

Ken Slovak - [MVP - Outlook]

I have no idea what code you're referring to, since you never showed in
either of your duplicate posts. Get the handle when the Inspector opens, in
the first Activate() event. At that time the Inspector will be the
ActiveInspector.
 
M

madhavi

I am using findwindow method to find the handle of the active inspecto
window. But my doubt is if we have two three inspector windows with sam
caption, as I am supplying classname and caption to the findwindo
method, will I get the handle of active inspector.

Because for testing purpose I sent mails with same subject and body, s
multiple inspectors can have same window class and caption.

Earlier I forgot to mention this.
Thank you for looking into this. Please let me know whether I am doin
correctly or not.


'Ken Slovak - [MVP - Outlook said:
;83932']I have no idea what code you're referring to, since you neve
showed in
either of your duplicate posts. Get the handle when the Inspecto
opens, in
the first Activate() event. At that time the Inspector will be the
ActiveInspector.




madhavi said:
Hi,

I am trying to get the inspector window handle as I need to add on or two
components (like button etc) to the inspector. I used the below cod and I
am getting the active window of outlook is correct. But the handle am
getting is not correct when I examined it with spy++.

What could be wrong in this?

Also if I have more than one mail opened with same title, How can w get
the handle of the actually the currently active inspector window? (A to
find the handle, we are just passsing the tile and two or mor windows
have the same title)

Please provide me some help to resolve this problem.
Thanks in advance. Submitted using http://www.outlookforums.co
 
K

Ken Slovak - [MVP - Outlook]

If you have multiple Inspectors that have the same class name and caption
then FindWindow() could retrieve any of them.

In that case you might want to use FindWindowEx() and test each found window
for size and location on the screen to figure out which is which.

Of course that test case is an edge case, it's not likely in the real world
that a user would have multiple Inspectors opened at the same time all with
the same caption.
 

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