StrokesPlus.net Forum
»
General Discussion
»
Scripts
»
Auto turn off the screen when a specific program runs
Rank: Advanced Member
Groups: Moderators, Approved Joined: 4/23/2020(UTC) Posts: 161 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/UnloadCode:
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);
}
`
);
|
|
|
|
StrokesPlus.net Forum
»
General Discussion
»
Scripts
»
Auto turn off the screen when a specific program runs
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.
Important Information:
The StrokesPlus.net Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close