StrokesPlus.net
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Gnopps  
#1 Posted : Friday, April 2, 2021 9:21:22 PM(UTC)
Gnopps

Rank: Newbie

Reputation:

Groups: Approved
Joined: 4/2/2021(UTC)
Posts: 4
Finland

Thanks: 2 times
I've been trying to setup steps or a script to show the desktop on the current monitor only, but haven't been successful. Would anyone here know if this can be accomplished?
Rob  
#2 Posted : Saturday, April 3, 2021 2:16:01 PM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 1,359
United States
Location: Tampa, FL

Thanks: 28 times
Was thanked: 419 time(s) in 356 post(s)
Give these a try.

Code:
//Minimize all windows on screen where mouse is
var allAppsList = sp.AllApplications();
var mouseScreen = Screen.FromPoint(sp.GetCurrentMousePoint());

for(var i = 0; i < allAppsList.Length; i++) 
{
    if(mouseScreen.Equals(allAppsList[i].Screen))
    {
        allAppsList[i].Minimize();
    }
}

Code:
//Restore all windows on screen where mouse is
var allAppsList = sp.AllApplications();
var mouseScreen = Screen.FromPoint(sp.GetCurrentMousePoint());

//Restores in reverse order to preserve stack
for(var i = allAppsList.Length - 1; i >= 0; i--) 
{
    if(mouseScreen.Equals(allAppsList[i].Screen))
    {
        allAppsList[i].Activate();
    }
}

Edited by user Sunday, April 4, 2021 12:35:30 AM(UTC)  | Reason: Not specified

thanks 1 user thanked Rob for this useful post.
Gnopps on 4/3/2021(UTC)
Gnopps  
#3 Posted : Saturday, April 3, 2021 4:44:53 PM(UTC)
Gnopps

Rank: Newbie

Reputation:

Groups: Approved
Joined: 4/2/2021(UTC)
Posts: 4
Finland

Thanks: 2 times
This works great, thank you for your help!
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.