Double click on Visio title bar

K

kippi

Hello everyone,

I am controlling VISIO by the COM interface (VC++, MFC). When the
Visio title bar is double clicked, the Visio window is maximized and
my title bar caption is replaced by Visio standard text. I want to
stop the double click in this case. Has anybody an idea how to do
that?


Thanks,
Kippi
 
J

JuneTheSecond

Hi, Kippi

May be, window.State property is any help.
Though next code shows just how to get window state
in VBA placed in ThisDocument, may be any help.

Option Explicit

Private WithEvents win As Visio.Window

Sub SetWindow()
Set win = ActiveWindow
End Sub

Private Sub win_WindowChanged(ByVal Window As IVWindow)
If Application.Window.WindowState = visWSMaximized + visWSVisible Then
MsgBox "Max"
' Rewrite window.caption
End If
If Application.Window.WindowState = visWSRestored + visWSVisible Then
MsgBox "Restored"
' Rewrite window.caption
End If
End Sub
 
K

kippi

Hi, Kippi

May be, window.State property is any help.
Though next code shows just how to get window state
in VBA placed in ThisDocument, may be any help.

Option Explicit

Private WithEvents win As Visio.Window

Sub SetWindow()
    Set win = ActiveWindow
End Sub

Private Sub win_WindowChanged(ByVal Window As IVWindow)
    If Application.Window.WindowState = visWSMaximized + visWSVisible Then
        MsgBox "Max"
        ' Rewrite window.caption
    End If
    If Application.Window.WindowState = visWSRestored + visWSVisibleThen
        MsgBox "Restored"
        ' Rewrite window.caption
    End If
End Sub

Hi,
thanks for your hint! I have included the following code in m program:

case 0x2001: /*(8193)*/ { // WindowChanged
VISIO::IVWindow VWindow;
VWindow.AttachDispatch(m_appVisio.GetActiveWindow());
long lState = VWindow.GetWindowState();
break;
}

I get in lState always the same value 0x4c000000, independent on the
window´s size.
Would you have an idea more?
Thanks,
Kippi
 
J

JuneTheSecond

kippi,
please try Application.WinDow.WindowState.
ActiveWindow seems somewhere different from
Application.Window.
 
C

Chris Roth [Visio MVP]

Guys,

As June said, ActiveWindow is different. ActiveWindow is a child window
of the application - it could be a drawing window, a stencil window, a
ShapeSheet window. But it's not the main window Kippi is looking for!

--
Hope this helps,

Chris Roth
Visio MVP


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

kippi

Guys,

As June said, ActiveWindow is different. ActiveWindow is a child window
of the application - it could be a drawing window, a stencil window, a
ShapeSheet window. But it's not the main window Kippi is looking for!

--
Hope this helps,

Chris Roth
Visio MVP

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




- Zitierten Text anzeigen -

Hi,

unfortunatelly I cannot find any object "WinDow".
After receiving the event "WindowChanged" I set my text for the title
bar. The text appears always correct -> I have to strike the main
window exactly. The problem is with "...WindowState()" only.

Thanks,
Kippi
 
P

Paul Herber

Hi,

unfortunatelly I cannot find any object "WinDow".
After receiving the event "WindowChanged" I set my text for the title
bar. The text appears always correct -> I have to strike the main
window exactly. The problem is with "...WindowState()" only.

I think you need the Application.Windows
which is a collection of windows.
 

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