|
-
May 16th, 2001, 06:15 AM
#1
how to start screensave & how to disable entering screensave if screensave has setuped?
-
May 16th, 2001, 07:02 AM
#2
Re: how to start screensave & how to disable entering screensave if screensave has setuped?
Start screensaver
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const WM_SYSCOMMAND = &H112
Private Const SC_SCREENSAVE = &HF140&
Private Sub Command1_Click()
SendMessage hwnd, WM_SYSCOMMAND, SC_SCREENSAVE, ByVal 0&
End Sub
Iouri Boutchkine
[email protected]
-
May 16th, 2001, 07:03 AM
#3
Re: how to start screensave & how to disable entering screensave if screensave has setuped?
Enable/disable screensaver
Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByVal lpvParam As Long, ByVal fuWinIni As Long) As Long
Private Const SPI_SETSCREENSAVEACTIVE = 17
Private Sub cmdDisabled_Click()
ToggleScreenSaverActive (False)
cmdEnabled.Enabled = True
cmdDisabled.Enabled = False
End Sub
Private Sub cmdEnabled_Click()
ToggleScreenSaverActive (True)
cmdEnabled.Enabled = False
cmdDisabled.Enabled = True
End Sub
Private Sub Form_Load()
cmdEnabled.Enabled = True
cmdEnabled.Enabled = False
End Sub
Public Function ToggleScreenSaverActive(Active As Boolean) As Boolean
Dim lActiveFlag As Long
Dim retvaL As Long
lActiveFlag = IIf(Active, 1, 0)
retvaL = SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, lActiveFlag, 0, 0)
ToggleScreenSaverActive = retvaL > 0
End Function
Iouri Boutchkine
[email protected]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|