Preventing Screen Saver 
Author Message
 Preventing Screen Saver

Is there a simple way to prevent the windows95 screen saver from starting
for a period of time in my vb4 application?  Perhaps its possible to send
a key stroke so the screen saver "thinks" a key has been hit?  As I am
new to programing -  any help would be appreciated.  Thanks in advance.
Tom Boyd



Sun, 19 Mar 2000 03:00:00 GMT  
 Preventing Screen Saver


Quote:

>Is there a simple way to prevent the windows95 screen saver from starting
>for a period of time in my vb4 application?  Perhaps its possible to send
>a key stroke so the screen saver "thinks" a key has been hit?  As I am
>new to programing -  any help would be appreciated.  Thanks in advance.

Have a control in your VB 4 application, and periodically set the focus to
it, and use SendKeys. In context to screensavers you could also see if you
could generate an artificial MouseMove by resizing the form by a small amount.

I once wrote a screensaver, and the hardest bit was finding all the stray
events that could fire that would switch off the screensaver, and for which
the screensaver had to be desensitivised. I managed to make it so that it
only went off once every few hours... (I was doing quite a lot of screen
activity, including the use of SendKeys to scroll some text.)

       Shiva
--
"Information is Knowledge, Knowledge is Power, Power is Dangerous"
"Information Overload... I've a thousand pages on it..."
"Play with fire - burn your fingers"



Mon, 20 Mar 2000 03:00:00 GMT  
 Preventing Screen Saver

PUT

  SENDKEYS  "+"  
                                           'IT HITS THE TAB KEY AND STOPS      
                                      THE SCREEN SAVER

IN A TIMER

Quote:
>Is there a simple way to prevent the windows95 screen saver from starting
>>for a period of time in my vb4 application?  Perhaps its possible to send
>>a key stroke so the screen saver "thinks" a key has been hit?  As I am
>>new to programing -  any help would be appreciated.  Thanks in advance.

>Have a control in your VB 4 application, and periodically set the focus to
>it, and use SendKeys. In context to screensavers you could also see if you
>could generate an artificial MouseMove by resizing the form by a small
>amount.

>I once wrote a screensaver, and the hardest bit was finding all the stray
>events that could fire that would switch off the screensaver, and for which
>the screensaver had to be desensitivised. I managed to make it so that it
>only went off once every few hours... (I was doing quite a lot of screen
>activity, including the use of SendKeys to scroll some text.)

>       Shiva
>--
>"Information is Knowledge, Knowledge is Power, Power is Dangerous"
>"Information Overload... I've a thousand pages on it..."
>"Play with fire - burn your fingers"




Sat, 25 Mar 2000 03:00:00 GMT  
 Preventing Screen Saver

Another option is to use the API to inform Windows that a screensaver is
running thereby preventing it from firing off the screensaver.

To do this you need to declare the following in the general declarations of
a module
****************************************************************************
***************************

Public Declare Function SystemParametersInfo& Lib "user32" Alias _
                "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam
As Long, lpvParam _
                As Any, ByVal fuWinIni As Long)

Public Const SPI_SCREENSAVERRUNNING = 97
****************************************************************************
***************************

Type in the following code when  you need to prevent the screensaver from
starting up
****************************************************************************
***************************

    Dim lRet as long
    Dim lpvParam As Boolean

    '-- Turn ON ScreenSaver mode.
    lRet = SystemParametersInfo(SPI_SCREENSAVERRUNNING, True, lpvParam, 0)

****************************************************************************
***************************

 Type in the following code to set things back to normal
****************************************************************************
***************************

'-- Turn OFF ScreenSaver mode.
    lRet = SystemParametersInfo(SPI_SCREENSAVERRUNNING, False, lpvParam, 0)

****************************************************************************
***************************

NOTE: This method only works under Windows 95

Hope this helps


Quote:
>PUT

>  SENDKEYS  "+"
>                                           'IT HITS THE TAB KEY AND STOPS
>                                      THE SCREEN SAVER

>IN A TIMER

>>Is there a simple way to prevent the windows95 screen saver from starting
>>>for a period of time in my vb4 application?  Perhaps its possible to send
>>>a key stroke so the screen saver "thinks" a key has been hit?  As I am
>>>new to programing -  any help would be appreciated.  Thanks in advance.

>>Have a control in your VB 4 application, and periodically set the focus to
>>it, and use SendKeys. In context to screensavers you could also see if you
>>could generate an artificial MouseMove by resizing the form by a small
>>amount.

>>I once wrote a screensaver, and the hardest bit was finding all the stray
>>events that could fire that would switch off the screensaver, and for
which
>>the screensaver had to be desensitivised. I managed to make it so that it
>>only went off once every few hours... (I was doing quite a lot of screen
>>activity, including the use of SendKeys to scroll some text.)

>>       Shiva
>>--
>>"Information is Knowledge, Knowledge is Power, Power is Dangerous"
>>"Information Overload... I've a thousand pages on it..."
>>"Play with fire - burn your fingers"





Sun, 26 Mar 2000 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Preventing screen saver?

2. Preventing a user from capturing a screen saver image

3. preventing window switching (screen saver app)

4. How to prevent the screen saver from running

5. Screen Saver on top of Screen Saver problem

6. screen saver & screen 9

7. Using StretchBlt to capture screen image to screen saver preview pane

8. Shifting Screen screen saver?

9. Screen saver control

10. Timer to Close Database after Inactivity gets Overriden by Screen Saver

11. Screen Saver

12. Website with free games, screen savers and more

 

 
Powered by phpBB® Forum Software