在2000中一个API就可以锁定。。LockWorkStation
如:
Private Declare Function LockWorkStation Lib "user32.dll" () As Long
Private Sub Form_Load()
LockWorkStation
End Sub
在其实的操作系统中可以像用SystemParametersInfo这个API。可以使热键失效至于你要让其实的窗口不能用。。可以这样。将应用程序的窗口最大化。用setwindowpos使其在最前端
如:
Private Declare Function LockWorkStation Lib "user32.dll" () As Long
Private Sub Form_Load()
LockWorkStation
End Sub
在其实的操作系统中可以像用SystemParametersInfo这个API。可以使热键失效至于你要让其实的窗口不能用。。可以这样。将应用程序的窗口最大化。用setwindowpos使其在最前端
Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal x
As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal
hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long)
As Long
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
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
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long,
ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As
Long, ByVal cy As Long, ByVal wFlags As Long) As LongDim nPreviousState As Long '保存系统环境状态'给屏幕加锁的函数
Public Sub LockScreen(ByVal szMsg As String)
Me.Move 0, 0, Screen.Width, Screen.Height
SetWindowPos Me.hwnd, -1, 0, 0, 0, 0, 1 Or 2
BitBlt Me.hDC, 0, 0, Screen.Width, Screen.Height, GetDC(0), 0, 0,
vbSrcCopy
Me.ForeColor = vbYellow
Print szMsg
Me.ForeColor = vbBlue
Print szMsg
Me.ForeColor = vbRed
Print szMsg
Me.Show
SystemParametersInfo 97, True, nPreviousState, 0
End Sub'给屏幕解锁的函数
Public Sub UnlockScreen()
SystemParametersInfo 97, False, nPreviousState, 0
Me.Hide
End Sub'这个函数仅在调试程序时使用
Private Sub Command1_Click()
UnlockScreen
End Sub