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?
Save up to 50% on our desktop apps during our Year End Sale!Save up to 50% on our desktop apps during our Year End Sale, including DisplayFusion, ClipboardFusion, FileSeek, LogFusion, TrayStatus, and VoiceBot!Save up to 50% on our desktop apps during our Year End Sale!

User Image
HTHawks
3 discussion posts
I am looking for some pointers/tips for BFS (C# script) commands to explore for determining the right and bottom edges of a monitor when executing some "cascade windows" commands.

Without getting into too many details, essentially I may wish to resize and then cascade "too many" windows at a time ...running out of room, they will just "keep going" off screen.

The gist: I target a specified application set of windows, for instance Mozilla Firefox, on a specified monitor, iterate and set size and location for each one in turn.
Currently I set a limit on the number of windows so it doesn't get out of hand.

---
I am wondering if someone can recommend some BFS commands to explore that will help indicate the Right and Bottom Screen Edges of a targetted monitor ...specifically when a left or right window edge touches or overlaps that screen edge after moving a window, so I can then set some other action.

Any help would be appreciated.
I am running Windows 7 with DF Version 9.9 ...so I do have some code limitations. That said, any pointers you may have, regardless of newer platform, would be helpful.

Thank you.
Twohawks
20 days ago  • #1
Thomas Malloch (BFS)'s profile on WallpaperFusion.com
Here's some code that will check if a window is overlapping a monitor edge. Since you're already setting the position of the windows and know what monitor you want to have them on, you can probably skip getting the window bounds and monitor bounds and use the values that you're already using in your script.

Code

// Get the position and size of a window
Rectangle windowBounds = BFS.Window.GetBounds(windowHandle);

// Get the position and size of the current monitor
Rectangle monitorBounds = BFS.Monitor.GetMonitorBoundsByWindow(windowHandle);

// Check the window's position
if(monitorBounds.Left >= windowBounds.Left) 
{
    // The left side of the window is touching or overlapping the monitor's left edge
}

if(monitorBounds.Right <= windowBounds.Right) 
{            
    // The right side of the window is touching or overlapping the monitor's right edge    
}

if(monitorBounds.Top >= windowBounds.Top)
{
    // The top of the window is touching or overlapping the monitor's top edge
}

if(monitorBounds.Bottom <= windowBounds.Bottom)
{            
    // The bottom of the window is touching of overlapping the monitor's bottom edge    
}
I hope this helps!
15 days ago  • #2
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(-)  Login to Vote(-)