Screensaver: how do I know when it is running? 
Author Message
 Screensaver: how do I know when it is running?

I need my program to perform certain actions only when the system
screensaver is running (that way i know the user isn't there).  I've tried
the GetSysInfo api call but every time I call it, the response is that the
screensaver is active, but that is not true.  And, I found an example on the
net just to make sure I wasn't implementing the function incorrectly.  Well,
same problem.  Are there any other ways to find out if the screen saver is
active?

Thank you
--Matt Rogers



Sat, 28 Jun 2003 05:56:52 GMT  
 Screensaver: how do I know when it is running?
Hi Matt,

Quote:
> I need my program to perform certain actions only when the system
> screensaver is running (that way i know the user isn't there).

you have to subclass any window in your app and catch the
"SC_SCREENSAVE" wParam:

  Public Function WindowProc&(ByVal hwnd&, ByVal wMsg&, ByVal wParam&, ByVal
lParam&)
    Select Case wMsg
    Case WM_SYSCOMMAND
      If wParam = SC_SCREENSAVE Then '# Saver will start
        ' your code
      End If
    End Select
    WindowProc = CallWindowProc(OldProc, hwnd, wMsg, wParam, lParam)
  End Function

Juergen.



Sat, 28 Jun 2003 06:56:30 GMT  
 Screensaver: how do I know when it is running?


Quote:
> Hi Matt,

> > I need my program to perform certain actions only when the system
> > screensaver is running (that way i know the user isn't there).

> you have to subclass any window in your app and catch the
> "SC_SCREENSAVE" wParam:

>   Public Function WindowProc&(ByVal hwnd&, ByVal wMsg&, ByVal
wParam&, ByVal
> lParam&)
>     Select Case wMsg
>     Case WM_SYSCOMMAND
>       If wParam = SC_SCREENSAVE Then '# Saver will start
>         ' your code
>       End If
>     End Select
>     WindowProc = CallWindowProc(OldProc, hwnd, wMsg, wParam, lParam)
>   End Function

> Juergen.

Do you think you can explain what this means to a VB newbie a little
better?  Thank you.

Sent via Deja.com
http://www.deja.com/



Sun, 29 Jun 2003 13:04:04 GMT  
 Screensaver: how do I know when it is running?
Hi,

Quote:
> Do you think you can explain what this means to a VB newbie a little
> better?  Thank you.

if you didn't use Subclassing technique until now, it is recommendet
to search the internet for "Subclassing" or ask here in the NG for
related links. This theme is too complex for a general discussing
in a newsgroup.
Dan Applemans "VB Programmers guide to the WIN32 API" is
a good source for detailed informations.

Juergen.



Mon, 30 Jun 2003 16:13:12 GMT  
 Screensaver: how do I know when it is running?
Thank you for all the help!  And I allso recommend Dan Appleman's book.  It
is excellent and has more API functions than I know a use for.
Additionally, a good API reference with detailed examples is
http://www.vbapi.com/ref/
It doesn't have all the API calls, but it has terrific examples for the ones
it does have (their createprocess example saved hours for me)

--Matt Rogerse


Quote:
> Hi,

> > Do you think you can explain what this means to a VB newbie a little
> > better?  Thank you.

> if you didn't use Subclassing technique until now, it is recommendet
> to search the internet for "Subclassing" or ask here in the NG for
> related links. This theme is too complex for a general discussing
> in a newsgroup.
> Dan Applemans "VB Programmers guide to the WIN32 API" is
> a good source for detailed informations.

> Juergen.



Tue, 01 Jul 2003 09:36:25 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. I know this can be done ! ( But I am not smart enough to know how :) )

2. How I am screensavers?

3. Recordset: What am I doing wrong?

4. What am I doing wrong??

5. What am I doing wrong?

6. Help with syntax. What am I doing wrong

7. What am I doing wrong?

8. What am I doing wrong?

9. What am I doing wrong?

10. Please tell me what I am doing wrong - DAO parameter Append Query :(

11. Can this be done or am I dreaming?

12. Am I doing the OpenRecordset command correctly?

 

 
Powered by phpBB® Forum Software