In a prior blog entry I describe how a couple lines of code can start the currently registered screen saver instantly and how to disable the screen saver.
Screen savers are funny animals. They are simply executable programs that typically will terminate whenever a mouse or keyboard event occurs. However, you can write a screen saver that reacts in other ways to user input.
(See Handling Screen Savers on MSDN for more info)
Run the code below, which creates a VFP Win32 executable and copies it to test.scr.
When explorer comes up, right click on test.scr and choose Install, which will install test.scr as a screen saver.
When the screen saver starts (see prior blog entry to see how to start the screen saver instantly) it presents a single textbox into which you can type VFP commands to execute.
For example, you can type “?4+5” and you have a screen saver calculator.
More interestingly, you can type these 3 lines:
Try hitting Alt-Tab and you can switch between your application and IE, but none of your other desktop applications (if you’re running with “On Resume Password Protect”)
One of my computers is easily visible in our home. Its screen saver is a VFP program that cycles randomly through my database of 16,000 family photos every 6 seconds. I can interactively query or search the picture data while still in screen saver mode.
*test.prg: screen saver
TEXT TO myvar TEXTMERGE noshow
IF parm1=”/p” &&”preview mode in the config dlog box not supported
ON KEY LABEL f4 clear events
DEFINE CLASS myform as Form
showwindow=2 && in desktop
ADD OBJECT txtCmd as textbox WITH ;
CATCH TO oErr
MODIFY PROJECT test nowait
BUILD EXE test FROM test
COPY FILE test.exe TO test.scr
*MODIFY COMMAND startssave nowait
!start . && start Explorer in the curdir