AghaMohsen
چهارشنبه 18 اردیبهشت 1392, 16:22 عصر
من میخواهم وقتی برنامه hide هستش با زدن مثلا کلید های ctrl+alt+shift+k برنامه show بشه ....
این کدو قبلن نشته بودم ، یادمه که کار میکرد ، اما الان که استفاده میکنم کار نمیکنه :|
کسی راهنمایی داره برای اینجانب ؟
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Integer) As Integer
Private Sub ShowForm_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ShowForm.Tick
Dim result As Integer
Dim alt, shift, ctrl, k As Boolean
For i = 1 To 255
result = 0
result = GetAsyncKeyState(i)
If result = -32767 Then
If i = 16 Then
alt = True
ElseIf i = 17 Then
shift = True
ElseIf i = 18 Then
ctrl = True
ElseIf i = 75 Then
k = True
End If
If alt And shift And ctrl And k Then
alt = False
shift = False
ctrl = False
k = False
Me.WindowState = 0
Me.Show()
End If
End If
Next
End Sub
این کدو قبلن نشته بودم ، یادمه که کار میکرد ، اما الان که استفاده میکنم کار نمیکنه :|
کسی راهنمایی داره برای اینجانب ؟
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Integer) As Integer
Private Sub ShowForm_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ShowForm.Tick
Dim result As Integer
Dim alt, shift, ctrl, k As Boolean
For i = 1 To 255
result = 0
result = GetAsyncKeyState(i)
If result = -32767 Then
If i = 16 Then
alt = True
ElseIf i = 17 Then
shift = True
ElseIf i = 18 Then
ctrl = True
ElseIf i = 75 Then
k = True
End If
If alt And shift And ctrl And k Then
alt = False
shift = False
ctrl = False
k = False
Me.WindowState = 0
Me.Show()
End If
End If
Next
End Sub