如何用VB制作开机密码程序

来源:百度知道 编辑:UC知道 时间:2024/05/05 19:01:14
本人初学VB,最近用VB制作了一个电脑开机密码程序,但是放进启动项的时候,即使不用理会这个VB程序用户也能点击界面其他程序,求求各位大虾教教我怎么把VB程序放在启动项首端,就是怎么设置能让用户不通过VB程序就进不了操作界面?

这是因为你没把鼠标限制到登录窗体的缘故

Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Private Declare Function ClipCursor Lib "user32" (lpRect As Any) As Long
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
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 Long
Private Declare Function GetForegroundWindow Lib "user32" () As Long
Private Declare Function CloseWindow Lib "user32" (ByVal hwnd As Long) As Long
Private Sub Timer1_Timer()
Dim ding As RECT, hunf As Long, wh As Long
wh = GetForegroundWindow()
If wh <> Me.hwnd Then CloseWindow wh
SetWindowPos Me.hwnd, -1, 0, 0, 0, 0, 3
GetWindowRect Me.hwnd,