Processing Ajax...

Title

Message

Confirm

Confirm

Confirm

Confirm

Are you sure you want to delete this item?

Confirm

Are you sure you want to delete this item?

Confirm

Are you sure?

User Image
HTHawks
9 discussion posts
Since this is practically my first post, the first thing I wish to do is thank the developers and staff, and community for this delightful project and product ...thank you.

I am trying out DisplayFusion with the following limitations...
- Win7 64-bit, DF version 9.9 -
...so I have been tweaking around with some of the function scripts to see how I may be able to tame it enough for serving me in my environment.

Problem/Challenge: I would like to save the Z-Order of Windows (specified Window Groups) when saving window positions ...which I understand is not directly possible.

I have messed around a bit (green-horn style) with scripts from Keith Lammers, diceblue96915, Thomas Malloch (and perhaps some others -thank you folks!) ...for Swapping Windows in various states between monitors ...KEEPING THE Z-ORDER ...and finally got that licked in spite of limitations in the depracated BFS framework available on my platform (or whatever the limitation actually may be - it may be the older DF App, I do not know enough to really know).

WHAT I WANT TO KNOW IS....
...how might it be possible, using a script (some script code snippet and method), after looping through the targetted windows and parsing out their info for the Monitor Swap of a selection of windows, which parses the z-order along with postions ...to SAVE THAT for REUSE LATER?
Envisioned Procedure: I would call the script for iterating a targetted group of windows (I know how to do that), SAVING the Z-Order with their positions (don't know how to save that). THEN LATER, when the positions get all screwed up (inevitable/inescapable reality), I would like to call a Script employing that data, for Restoring those Windows along with that Z-Order.

If anyone has any ideas how to approach this problem, I am eager to hear your ideas.

Thank you very much.
R Twohawks
Nov 4, 2024  • #1
Owen Muhlethaler (BFS)'s profile on WallpaperFusion.com
Thanks for the kind words!

We'll see if we can come up with something here and let you know.
Nov 5, 2024  • #2
Thomas Malloch (BFS)'s profile on WallpaperFusion.com
I've attached two scripts below that should do this. You can import them via the DisplayFusion Settings > Functions > Scripted Function > Import Scripted Function.

These scripts save and restore the window positions and z order by their handles, so the scripts won't work between restarts, or if the window gets destroyed and recreated (ie closing and reopening a program).
• Attachment: Restore Window Positions and ZOrder.dfscript [8,153 bytes]
• Attachment: Save Window Positions and Z-Order.dfscript [5,919 bytes]
Nov 15, 2024 (modified Nov 15, 2024)  • #3
User Image
HTHawks
9 discussion posts
Hey Thomas, I never was notifed of, or saw, your kind reply.
Thank you so much for the offered code!!
I will try it out in the coming week and post back how it worked.
R Twohawks
Jan 25, 2025  • #4
User Image
HTHawks
9 discussion posts
Hmmm... trying the "save" script ...cannot figure out the compile error [exception]...
"The type or namespace name 'Json' does not exist in the namespace 'System.Text' (are you missing an assembly reference?)"

Its this line:
BFS.ScriptSettings.WriteValue("WindowInfoList", System.Text.Json.JsonSerializer.Serialize(windows));


I looked into perhaps adding the assembly somehow, but I think I'm a bit out of my depth ...solutions online are old stuff.

Again, I am capped at Win7 64-bit, DF version 9.9 -

Thanks for any insight with that.
R Twohawks
Jan 26, 2025 (modified Jan 26, 2025)  • #5
Thomas Malloch (BFS)'s profile on WallpaperFusion.com
Sorry, I missed the part where you said you were on DisplayFusion 9.9. Here's the two scripts again but modified to work with that version of DisplayFusion. You can import them the same way via the DisplayFusion Settings > Functions > Scripted Function > Import Scripted Function.
Jan 27, 2025  • #6
User Image
HTHawks
9 discussion posts
Finally circling back to this. Thanks Thomas.
I tried these out but while they verify they kind of bomb out. At least now I think I have enough for effectively playing with the code and troubleshooting.

Thank you very much.

{Sure wish I could get notifications from this forum -have not been able to figure that one out since I joined up here.}
Feb 15, 2025  • #7
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(-)  Login to Vote(-)