高手帮忙: 如何锁定系统,1 使鼠标只能在指定的范围活动
2 就是向网管软件那样。密码不对不能进行其他操作
2 就是向网管软件那样。密码不对不能进行其他操作
解决方案 »
- 如何将TXT文件的最后一行加载到TEXT里面!
- 如何接收存储过程返回值,100分以求
- MSFlexGrid另用:可不可以把MSFlexGrid一个格子里的东西很快的移到另一个格子?
- 请问用手机可以购物吗? 大家帮帮忙啊
- 想用文件影射实现只能启动一个应用实例的功能,但是失败了...高手请进去~~
- 联想同禧130多媒体键盘的功能键和手写板在win2000下没法用,如何解决?
- controls
- VB怎么调用sql2000数据存储过程
- 有愿意合作建立网站专栏的吗?
- 请问用VBA如何实现WORD表格中单元格的合并
- 关于VB中的CreateObject("Scripting.FileSystemObject") 方面
- 问一个关于 桌面数据库msde的问题
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
getclipcursor函数是限定鼠标在一定区域内,
参数LPRC 是指定的区域,
我的是:[email protected]
"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
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