CSDN博客

img 40Star

调用屏幕保护

发表于2002/8/27 9:19:00  1096人阅读

分类: Visual Basic .net

   
    想要调用系统屏幕保护,主要是发送一个WM_SYSCOMMAND消息即可。

    Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Int32, ByVal wMsg As Int32, ByVal wParam

As Int32, ByVal lParam As Int32) As Int32
    Private Const HWND_BROADCAST = &HFFFF&
    Private Const WM_SYSCOMMAND = &H112
    Private Const SC_SCREENSAVE = &HF140&

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_SCREENSAVE, 0)
    End Sub

0 0

相关博文

我的热门文章

img
取 消
img