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

Notification

Icon
Error

Options
Go to last post Go to first unread
soooulp  
#1 Posted : Saturday, May 8, 2021 12:03:36 PM(UTC)
soooulp

Rank: Advanced Member

Reputation:

Groups: Moderators, Approved
Joined: 4/23/2020(UTC)
Posts: 161
China

Thanks: 46 times
Was thanked: 23 time(s) in 17 post(s)
I set to auto turn off the screen in built-in when the remote control program named SunloginClient.exe connects, and the screen driver will break down as well as the brightness adjust will be invalid.

I find there is a new program named 'user' my UserID of this service to run when I connect to the computer from the APP. So I turn to use the following code in S+net to auto turn off the screen and auto turn on the screen when I disconnect.

Put this code into Global Actions-Load/Unload

Code:

sp.CreateTimer("RemoteControl", 
               0, 
               250, 
                `var wnd = sp.WindowsFromTitlePartial("user");

                if(wnd.Count() === 0) {
                    if(sp.GetStoredBool("SunloginUnConnect")) {
                        ScreenBrightness.Adjust("100%");
                        sp.StoreBool("SunloginUnConnect", false);
                    }
                } else {
                    ScreenBrightness.Adjust("0%");
                    sp.StoreBool("SunloginUnConnect", true);
                }
               `
);
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.