调用屏幕保护

类别:.NET开发 点击:0 评论:0 推荐:

   
    想要调用系统屏幕保护,主要是发送一个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

本文地址:http://com.8s8s.com/it/it45960.htm