Article ID: 110589
Article Last Modified on 12/9/2003
' The following Declare statement must be on one, single line:
Declare Function SendMessage Lib "User" (ByVal hWnd As Integer,
ByVal wMsg As Integer, ByVal wParam As Integer, lParam As Any) As
Long
In the following example, a command button starts the Form1 screen saver:
Sub Command1_Click ()
Dim result As Long
Const WM_SYSCOMMAND = &H112
Const SC_SCREENSAVE = &HF140
result = SendMessage(Form1.hWnd, WM_SYSCOMMAND, SC_SCREENSAVE, 0&)
End Sub
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 query words: 3.00 .SCR TOPMOST SETWINDOWPOS SCRNSAVE timer
Keywords: kbcode KB110589