Search the web
Sign In
New User? Sign Up
fdb · FDB's "Advanced Programming" list
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
How to Start a Visual Basic Screen Saver Using SendMessage API   Message List  
Reply | Forward Message #35 of 103 |
DOCUMENT:Q141024 06-SEP-1996 [vbwin]
TITLE :How to Start a Visual Basic Screen Saver Using SendMessage API
PRODUCT :Microsoft Visual Basic for Windows
PROD/VER:4.00
OPER/SYS:WINDOWS
KEYWORDS:kbprg kbcode

------------------------------------------------------------------------
The information in this article applies to:

- Standard, Professional, and Enterprise Editions of Microsoft Visual
Basic, 16 and 32 bit, for Windows, version 4.0
------------------------------------------------------------------------

SUMMARY
=======

The sample code below shows how to start a Visual Basic screen saver
by sending a Windows message to the Control-menu box on a form.

MORE INFORMATION
================

Microsoft Windows starts screen savers through the System-menu box on
a form. The System-menu box is also known as the Control-menu box in
Visual Basic. You can send Windows messages to the Control-menu box
by using the SendMessage Windows API (application programming
interface) function.

[general declarations]

#If Win32 Then
Private Declare Function SendMessage Lib "user32" Alias _
"SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, _ ByVal wParam
As Long, ByVal lParam As Long) As Long

Const WM_SYSCOMMAND = &H112&
Const SC_SCREENSAVE = &HF140&
#Else
Private Declare Function SendMessage Lib "User" (ByVal _ hWnd
As Integer, ByVal wMsg As Integer, ByVal wParam As _ Integer,
lParam As Any) As Long

Const WM_SYSCOMMAND = &H112
Const SC_SCREENSAVE = &HF140&
#End If

Private Sub Command1_Click()
Dim result As Long
result = SendMessage(Form1.hWnd, WM_SYSCOMMAND, _
SC_SCREENSAVE, 0&)
End Sub

REFERENCES
==========

You can find two sample programs and a complete explanation showing how to
write your own screen savers in Visual Basic in the following book:

"Visual Basic Workshop 3.0" by John C. Craig, published by Microsoft Press.

Additional reference words: 3.00 4.00 vb4win vb4all .SCR TOPMOST
SETWINDOWPOS SCRNSAVE timer
KBCategory: kbprg kbcode
KBSubcategory: PrgCtrlsStd

============================================================================
=

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS
PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS
ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO
EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR
ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL,
CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF
MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION
OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES
SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1996.





Mon Jun 18, 2001 4:35 pm

ferialb@...
Send Email Send Email

Forward
Message #35 of 103 |
Expand Messages Author Sort by Date

DOCUMENT:Q141024 06-SEP-1996 [vbwin] TITLE :How to Start a Visual Basic Screen Saver Using SendMessage API PRODUCT :Microsoft Visual Basic for Windows ...
FDB & HRB
ferialb@...
Send Email
Jun 19, 2001
6:55 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help