Visio Guy

Visio Discussions => Programming & Code => Topic started by: Visano on June 30, 2008, 02:25:59 PM

Title: Merging two custom windows
Post by: Visano on June 30, 2008, 02:25:59 PM
Hi,

I have added two anchored windows using the following code with VB 6.

    varWindowStates = VisWindowStates.visWSVisible + VisWindowStates.visWSDockedLeft
    varWindowTypes = VisWinTypes.visAnchorBarAddon
   
    1st window
    Set vsoAnchorWindow = myVisioApp.ActiveWindow.Windows.Add("A", varWindowStates, varWindowTypes, 0, 0)
    vsoAnchorWindow.MergeCaption = "AnchorWindow 1"
    vsoAnchorWindow.MergeID = CUSTOM_MERGE_ID_1
    vsoAnchorWindow.MergeClass = ""
   
    2nd window
    Set vsoAnchorWindow = myVisioApp.ActiveWindow.Windows.Add("A", varWindowStates, varWindowTypes, 0, 0)
    vsoAnchorWindow.MergeCaption = "AnchorWindow 2"
    vsoAnchorWindow.MergeID = CUSTOM_MERGE_ID_2
    vsoAnchorWindow.MergeClass = ""
   
 
I can merge them manually by dragging one over the other. Programatically how can I merge these windows?

If anybody has any idea on this please let me know.

:)
Thanks

Visano
Title: Re: Merging two custom windows
Post by: Visio Guy on June 30, 2008, 05:27:52 PM
Buon Giorno, Visano,

I've been playing with this for the past hour, because it's a GOOD QUESTION, and I can't figure it out.

There are a bunch of merge-related arguments in the Windows.Add method, which I didn't try. I wonder if setting them for newly-added windows has any effect?

I also noticed, that in merged windows, the MergeID is the same, but I can't figure out how to merge them. I've tried putting windows in the same place, setting their WindowStates to be "merged", etc.

The Macro Recorder and Visio Event Monitor tool were also of no help.

Hopefully somebody will see this that has figured it out!
Title: Re: Merging two custom windows
Post by: Visano on July 02, 2008, 08:10:37 AM
Hi Mr. Visio Guy,

thank you for your quick respond.
I have tried a lot with all the parameters of the ActiveWindow.Add method but merging the windows was not possible.
If you get clue or some informations from MS please let me know.

WR
Visano

P.S.

By the way I found this newsgroup nice & transparent. :)



Title: Re: Merging two custom windows
Post by: Visano on August 28, 2008, 08:31:43 AM
Hi Guys,

has anyone still no answer for this problem?

:)

WR
Visano
Title: Re: Merging two custom windows
Post by: 9rey on November 25, 2012, 07:02:30 PM
Hi,
sorry for "necroposting" :)
but I guess I know how to merge windows.

After many unsuccessful attempts, finally, I've done it:

    Set wnd1 = ActiveWindow.Windows.add("wnd1", visWSVisible Or visWSDockedRight, visAnchorBarAddon)
    'any random GUID
    wnd1.MergeID = "{BD8994FC-A032-412B-B557-9039E82AB7FA}"
    wnd1.MergeCaption = "wnd1"
    wnd1.MergeClass = "1"

    Set wnd2= ActiveWindow.Windows.add("wnd2", visWSVisible Or visWSDockedRight Or visWSAnchorMerged, visAnchorBarAddon, , , , , "{BD8994FC-A032-412B-B557-9039E82AB7FA}", "1", 2)
    wnd1.MergeCaption = "wnd2"
Title: Re: Merging two custom windows
Post by: Nikolay on November 26, 2012, 01:51:41 PM
Yooo! The Merge-Windows Mystery is finally solved! :D
Thank you for sharing!

A bit simplified version (it seems that you just have to set MergeID separately to a GUID, and then create the window to be merged with that GUID):

Set wnd1 = ActiveWindow.Windows.Add("wnd1", visWSVisible, visAnchorBarAddon)
wnd1.MergeID = "{BD8994FC-A032-412B-B557-9039E82AB7FA}"
Set wnd2= ActiveWindow.Windows.Add("wnd2", visWSVisible Or visWSAnchorMerged, visAnchorBarAddon, , , , , "{BD8994FC-A032-412B-B557-9039E82AB7FA}")
Browser ID: smf (is_webkit)
Templates: 1: Printpage (default).
Sub templates: 4: init, print_above, main, print_below.
Language files: 1: index+Modifications.english (default).
Style sheets: 0: .
Hooks called: 56 (show)
Files included: 25 - 925KB. (show)
Memory used: 775KB.
Tokens: post-login.
Cache hits: 7: 0.00164s for 22,301 bytes (show)
Cache misses: 1: (show)
Queries used: 9.

[Show Queries]