高手帮忙: 如何锁定系统,1 使鼠标只能在指定的范围活动
                           2 就是向网管软件那样。密码不对不能进行其他操作

解决方案 »

  1.   

    Private Declare Function GetClipCursor Lib "user32" (lprc As RECT) As Long
    Private Type RECT
            Left As Long
            Top As Long
            Right As Long
            Bottom As Long
    End Type
    getclipcursor函数是限定鼠标在一定区域内,
    参数LPRC 是指定的区域,
      

  2.   

    留下EMAIL,发一个给你!
    我的是:[email protected]
      

  3.   

    应该是锁定键盘,就是说无论击哪个键电脑都没有反应,包括”Ctrl+Alt+Delete"等组合键
      

  4.   

    问问叶帆吧,他有一个OCX文件就是做这个的。
      

  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
    '-------------------------------------------' Used for ExitWindows
    Const EWX_LOGOFF = 0
    Const EWX_SHUTDOWN = 1
    Const EWX_REBOOT = 2
    Const EWX_FORCE = 4
    Private Declare Function ExitWindowsEx Lib "user32" _
    (ByVal uFlags As Long, ByVal dwReserved _
    As Long) As Long
    ' ---------------------' Used for AlwaysOnTop
    Const FLAGS = 3
    Const HWND_TOPMOST = -1
    Const HWND_NOTOPMOST = -2
    Public SetTop As Boolean
    Private Declare Function SetWindowPos Lib "user32" (ByVal h%, ByVal hb%, ByVal X%, ByVal Y%, ByVal cx%, ByVal cy%, ByVal f%) As Integer
    '-------------------------------------------Sub ExitWindows(ExitMode As String)
     Select Case ExitMode
     Case Is = "shutdown"
         t& = ExitWindowsEx(EWX_SHUTDOWN, 0)
     Case Is = "reboot"
         t& = ExitWindowsEx(EWX_REBOOT Or EXW_FORCE, 0)
     Case Else
        MsgBox ("Error in ExitWindows call")
     End Select
      
     End Sub
    Sub AlwaysOnTop(FormName As Form, bOnTop As Boolean)
        'Sets a form as always on top
    Dim Success As Integer
    If bOnTop = False Then
        Success% = SetWindowPos(FormName.hWnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS)
    Else
        Success% = SetWindowPos(FormName.hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, FLAGS)
    End If
    End Sub
    Sub Center(FormName As Form)
     ' Center Forms...
     'Move (Screen.Width - FormName.Width) \ 2, (Screen.Height - FormName.Height) \ 2
    End Sub
    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 SubSub OpenApp(File As String)
        'Shells to another application
        X = Shell(File)
    End Sub
      

  6.   

    窗体部分Option Explicit
        Dim ter As BooleanPrivate Sub Command1_Click()
        ter = False
        DisableCtrlAltDelete (False)
        Unload Form1
    End Sub
    Private Sub Form_KeyPress(KeyAscii As Integer)
        If KeyAscii = 13 Then
            Timer1.Enabled = False
            Timer2.Enabled = True
            Text1.Enabled = True
        End If
    End SubPrivate Sub Form_Load()
        DisableCtrlAltDelete (True)
        ter = True
    End Sub
    Private Sub Form_LostFocus()
        Form1.SetFocus
    End Sub
    Private Sub Form_Unload(Cancel As Integer)
        If ter = True Then
            Cancel = 5
        Else
        End If
    End Sub
    Private Sub Timer1_Timer()
        Form1.SetFocus
        Label2.Caption = 5
    End Sub
    Private Sub Timer2_Timer()
        Label2.Caption = Val(Label2.Caption) - 1 & "  秒时间用于输入密码."
        Text1.SetFocus
        If Text1.Text = "mouse" Then
            ter = False
            Timer2.Enabled = False
            Timer1.Enabled = False
            Label2.Caption = "5"
            MsgBox "密码正确,你现在可以按下面的按钮退出."
            Text1.Enabled = False
            Command1.Enabled = True
        End If
        If Val(Label2.Caption) = 0 Then
            Timer1.Enabled = True
            Timer2.Enabled = False
            Text1.Text = ""
            Text1.Enabled = False
            Command1.Enabled = False
        End If
    End Sub
    ''注意密码是mouse