Shapes Window Close Event??

G

Guy..L

This code below fires events for several Visio windows in the application
(AxDrawingControl, C#.NET3.5, VS2007SDK) when the user clicks on the little X
on the Pan & Zoom, Drawing Explorer, Size & Position windows. Buttons on a
toolstrip can then be toggled to the off state when the event fires...

EventList eW = win.Windows.EventList;
eW.AddAdvise((short)VisEventCodes.visEvtWindow +
(short)VisEventCodes.visEvtDel, eventHandler, "", "");

where win is the AxDrawingControl.Window. These work great for said windows
because events occur wherever the window may be docked inside the ruler,
outside the ruler or floating around the desktop.

No such event fires when the Shapes window X is clicked. (I've looked at
all the other window events--they don't fire. I've tried looking at events
on ShapesWindow.ParentWindow. Shapes window is opened using
document.OpenStencilWindow.)

How can I synchronize the application toolstripbutton with the Shapes window
on X closings?
 
C

Chris Roth [Visio MVP]

Hi Guy,

I fired up the Event Monitor tool to see what happens. You can get the
event monitor tool by downloading the "Visio 2007 SDK".

It says that an event "ViewChanged" fires when I close the Shapes window.

Here is the Event Monitor dump for opening, then closing the Shapes window:

1949 ViewChanged window[1] Drawing1 Page-1 subtype is 128 [/hwnd=5965866]

2272 ViewChanged window[1] Drawing1 Page-1 subtype is 128 [/hwnd=5965866]

Maybe this will help get you going...

--
Hope this helps,

Chris Roth
Visio MVP


Visio Guy: Smart Graphics for Visual People
http://www.visguy.com
 

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