c语言锁屏密码程序,求一个VB锁屏程序的源文件
滿意答案
nan6718
2014.07.08
采納率:53%????等級:12
已幫助:8369人
我原來寫的一個縮屏的程序,后來沒用,當時只是為了測試透明窗體的.代碼給你參考下。功能差一個禁用任務管理器的功能
Private Declare Function GetWindowLong Lib "user32" _
Alias "GetWindowLongA" ( _
ByVal hwnd As Long, _
ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" _
Alias "SetWindowLongA" ( _
ByVal hwnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long
Private Declare Function SetLayeredWindowAttributes Lib "user32" ( _
ByVal hwnd As Long, _
ByVal crKey As Long, _
ByVal bAlpha As Byte, _
ByVal dwFlags As Long) As Long
Private Const WS_EX_LAYERED = &H80000
Private Const GWL_EXSTYLE = (-20)
Private Const LWA_ALPHA = &H2
Private Const LWA_COLORKEY = &H1
Dim GRB_Alpha As Integer
Dim rtn As Long
Private Sub Command1_Click()
GRB_Alpha = GRB_Alpha - 5
If GRB_Alpha < 5 Then
GRB_Alpha = 5
End If
Label1.Caption = "Alpha?" & GRB_Alpha
rtn = GetWindowLong(Me.hwnd, GWL_EXSTYLE)
rtn = rtn Or WS_EX_LAYERED
SetWindowLong hwnd, GWL_EXSTYLE, rtn
SetLayeredWindowAttributes hwnd, 0, GRB_Alpha, LWA_ALPHA
End Sub
Private Sub Command2_Click()
GRB_Alpha = GRB_Alpha + 5
If GRB_Alpha > 255 Then
GRB_Alpha = 255
End If
Label1.Caption = "Alpha?" & GRB_Alpha
rtn = GetWindowLong(Me.hwnd, GWL_EXSTYLE)
rtn = rtn Or WS_EX_LAYERED
SetWindowLong hwnd, GWL_EXSTYLE, rtn
SetLayeredWindowAttributes hwnd, 0, GRB_Alpha, LWA_ALPHA
End Sub
Private Sub Form_DblClick()
frmLogin.Show
End Sub
Private Sub Form_Load()
Form1.Width = Screen.Width
Form1.Height = Screen.Height
GRB_Alpha = 200
Label1.Caption = "Alpha?" & GRB_Alpha
Form1.BackColor = &H80C0FF
Label1.BackColor = &H80C0FF
rtn = GetWindowLong(Me.hwnd, GWL_EXSTYLE)
rtn = rtn Or WS_EX_LAYERED
SetWindowLong hwnd, GWL_EXSTYLE, rtn
SetLayeredWindowAttributes hwnd, 0, GRB_Alpha, LWA_ALPHA
End Sub
Private Sub Form_Unload(Cancel As Integer)
Unload Me
End Sub
登陸窗口的代碼
Option Explicit
Public LoginSucceeded As Boolean
Private Sub cmdCancel_Click()
'設置全局變量為 false
'不提示失敗的登錄
LoginSucceeded = False
Me.Hide
End Sub
Private Sub cmdOK_Click()
'檢查正確的密碼
If txtPassWord1.Text = "" Or txtPassword.Text = "" Then
Label1.Caption = "密碼不能為空"
End
End If
If txtPassWord1.Text = txtPassword.Text Then
'將代碼放在這里傳遞
'成功到 calling 函數
'設置全局變量時最容易的
Str_PassWord = txtPassWord1.Text
LoginSucceeded = True
Unload Me
Form1.Show
Else
Label1.Caption = "無效的密碼,請重試!"
txtPassWord1.SetFocus
End If
End Sub
00分享舉報
總結
以上是生活随笔為你收集整理的c语言锁屏密码程序,求一个VB锁屏程序的源文件的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 更换锁定计算机图片,电脑锁屏图片怎么设置
- 下一篇: jira使用教程pdf_jira项目管理