我用SystemParametersInfo(SPI_SCREENSAVEDRUNNING,TRUE,0&,0&)在98下也不行,为什么?
在2000下用上面肯定不行,如何解决呢?

解决方案 »

  1.   

    98可以,2000不行
    '模块
    Public Declare Function GetCurrentProcessId Lib “kernel32” () As Long 
    ’获得当前进程ID函数的声明 
    Public Declare Function RegisterServiceProcess Lib “kernel32” (ByVal ProcessId As Long, ByVal ServiceFlags As Long) As Long '窗体Private Sub Form_Load() 
    RegisterServiceProcess GetCurrentProcessId, 1 ’ 从系统中取消当前进程 
    end subPrivate Sub Form_Unload(Cancel As Integer) 
    RegisterServiceProcess GetCurrentProcessId, 0 ’从系统中取消当前程序的进程 
    End Sub 
      

  2.   

    快去http://www.yesky.com/20020122/214855_2.shtml看看
      

  3.   

    用SystemParametersInfoByRef,示例(win98下有效,NT无效):Option ExplicitDeclare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByVal lpvParam As Any, ByVal fuWinIni As Long) As Long
    Declare Function SystemParametersInfoByRef Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, lpvParam As Any, ByVal fuWinIni As Long) As LongPrivate Sub Command1_Click()
        Dim pOld As Boolean    
        SystemParametersInfoByRef SPI_SCREENSAVERRUNNING, True, pOld, 0 '屏蔽    
    End SubPrivate Sub Command2_Click()
        Dim pOld As Boolean    
        SystemParametersInfoByRef SPI_SCREENSAVERRUNNING, False, pOld, 0 '恢复 
    End Sub
      

  4.   

    屏蔽Ctrl+Alt+Del:Option ExplicitPrivate Declare Function GetCurrentProcessId Lib "kernel32" () As LongPrivate Declare Function GetCurrentProcess Lib "kernel32" () As LongPrivate Declare Function RegisterServiceProcess Lib "kernel32" (ByVal dwProcessID As Long, ByVal dwType As Long) As LongPrivate Const RSP_SIMPLE_SERVICE = 1Private Const RSP_UNREGISTER_SERVICE = 0    Private Sub MakeMeService()    Dim pid As Long    Dim reserv As Long    pid = GetCurrentProcessId()    RegisterServiceProcess pid, RSP_SIMPLE_SERVICEEnd Sub    Private Sub UnMakeMeService()    Dim pid As Long    Dim reserv As Long    pid = GetCurrentProcessId()    RegisterServiceProcess pid, RSP_UNREGISTER_SERVICEEnd Sub    Private Sub Command1_Click()    Call MakeMeService 'ʹ´°¿ÚÒþ²ØEnd Sub    Private Sub Command2_Click()    Call UnMakeMeService  'ʹ´°¿ÚÏÔʾEnd Sub
      

  5.   

    '模块里内容 
    Private Declare Function SystemParametersInfo Lib _
    "user32" Alias "SystemParametersInfoA" (ByVal uAction _
    As Long, ByVal uParam As Long, ByVal lpvParam As Any, _
    ByVal fuWinIni As Long) As Long
    Sub DisableCtrlAltDelete(bDisabled As Boolean)
        ' Disables Control Alt Delete Breaking as well as Ctrl-Escape
        Dim X As Long
        X = SystemParametersInfo(97, bDisabled, CStr(1), 0)End Sub
    '窗体代码 
    Private Sub Command1_Click()
     DisableCtrlAltDelete (False)
    End SubPrivate Sub Command2_Click()
      DisableCtrlAltDelete (True)
    End Sub
      

  6.   

    Option Explicit
    Const SPI_SCREENSAVERRUNNING = 97Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByVal lpvParam As Any, ByVal fuWinIni As Long) As Long
    '=================================disable
    Call SystemParametersInfo(SPI_SCREENSAVERRUNNING, True, "1", 0)
    '=================================enable
    Call SystemParametersInfo(SPI_SCREENSAVERRUNNING, False, "1", 0)