Do a CBT check before doing something after target A_TimeIdle has been reached

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
theimmersion
Posts: 181
Joined: 09 Jul 2016, 08:34
Location: Serbia

Do a CBT check before doing something after target A_TimeIdle has been reached

30 Jan 2018, 13:18

I made a script with some GDI anims for some tests (custom interactive screensaver) and A_TimeIdle works nice, but i found a problem that if some programs like VLC player is open, it will execute animations even thought a movie is playing or similar. I want to avoid that and read how windows knows when to start and when to skip screensaver activation. I want to try and mimic it with AHK, send msg to active window asking if it's a CBT window or not and start the screensaver. Could someone make an example of such a system?

I read about it here: https://docs.microsoft.com/en-us/window ... er-library
but have no idea how to translate this functionality into ahk code.
User avatar
theimmersion
Posts: 181
Joined: 09 Jul 2016, 08:34
Location: Serbia

Re: Do a CBT check before doing something after target A_TimeIdle has been reached

09 Sep 2018, 05:10

Nope, still didn't figure this out. :headwall:

The important part from the MSDN link:
(Using AHK's A_TimeIdle here)
Once a screen saver is chosen, Windows monitors keystrokes and mouse movements and then starts the screen saver after a period of inactivity.
However, Windows does not start the screen saver if any of the following conditions exist:

The part i have trouble with. xD
The active application is not a Windows-based application.
A computer-based training (CBT) window is present.
The active application receives the WM_SYSCOMMAND message with the wParam parameter set to the SC_SCREENSAVE value, but it does not pass the message to the DefWindowProc function.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], Lpanatt and 312 guests