M
Markus Breugst
Hi all,
we have a stand-alone application that interacts with Visio via the Visio
object model.
Among others, the application creates Visio documents. We would like to use
global unique identifiers (GUIDs) as filenames of the Visio documents.
However, this does not look very nice, since the filename is shown in the
titlebar of the document window, and GUIDs are not really made to be read by
humans.
Therefore, we tried to modify the caption of the document windows via the
SetWindowText method (user32) in order to substitute the GUID by a
human-readable document name:
IntPtr hwnd = (IntPtr) this.visioApplication.ActiveWindow.WindowHandle32; //
or WindowHandle
SetWindowText( hwnd, "NEW DOCUMENT NAME" )
Unfortunately, it does not work. The caption remains unchanged.
However, it does work for the application's main window, where the window
handle is
this.visioApplication.WindowHandle32.
So, if the document window is maximized, the document file name appears in
the main window title bar, and everything's fine (we can change the
caption). But if we have multiple documents open and cascaded or tiled, each
document has its own window, and the titlebars show the GUID filenames and
cannot be changed.
Does anybody have an idea how to solve this problem?
Thanks a lot in advance,
Markus
we have a stand-alone application that interacts with Visio via the Visio
object model.
Among others, the application creates Visio documents. We would like to use
global unique identifiers (GUIDs) as filenames of the Visio documents.
However, this does not look very nice, since the filename is shown in the
titlebar of the document window, and GUIDs are not really made to be read by
humans.
Therefore, we tried to modify the caption of the document windows via the
SetWindowText method (user32) in order to substitute the GUID by a
human-readable document name:
IntPtr hwnd = (IntPtr) this.visioApplication.ActiveWindow.WindowHandle32; //
or WindowHandle
SetWindowText( hwnd, "NEW DOCUMENT NAME" )
Unfortunately, it does not work. The caption remains unchanged.
However, it does work for the application's main window, where the window
handle is
this.visioApplication.WindowHandle32.
So, if the document window is maximized, the document file name appears in
the main window title bar, and everything's fine (we can change the
caption). But if we have multiple documents open and cascaded or tiled, each
document has its own window, and the titlebars show the GUID filenames and
cannot be changed.
Does anybody have an idea how to solve this problem?
Thanks a lot in advance,
Markus