Dobrý den,mám takovýho kód: Public Class Form1
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
SendKeys.Send(TextBox2.Text)
SendKeys.Send(TextBox1.Text)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Enabled = True
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Timer1.Enabled = False
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
If RadioButton4.Checked = True Then
Timer2.Enabled = True
End If
If RadioButton3.Checked = True Then
Timer5.Enabled = True
End If
If RadioButton2.Checked = True Then
Timer4.Enabled = True
End If
If RadioButton1.Checked = True Then
Timer3.Enabled = True
End If
If RadioButton1.Checked = False And RadioButton2.Checked = False And RadioButton3.Checked = False And RadioButton4.Checked = False Then
MsgBox("Please Check some RadioButton")
End If
End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
SendKeys.Send(TextBox3.Text)
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Timer2.Enabled = False
End Sub
Private Sub Timer6_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer6.Tick
SendKeys.Send("{J}")
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
Timer6.Enabled = True
End Sub
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
Timer6.Enabled = False
End Sub
Private Sub Timer7_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer7.Tick
Dim hotkey As Boolean
hotkey = GetAsyncKeyState(Keys.F6)
If hotkey = True Then Timer1.Start()
Dim hotkey1 As Boolean
hotkey1 = GetAsyncKeyState(Keys.F7)
If hotkey1 = True Then Timer1.Stop()
End Sub
Private Sub Timer8_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer8.Tick
Dim hotkey As Boolean
hotkey = GetAsyncKeyState(Keys.F8)
If hotkey = True Then Timer2.Start()
Dim hotkey1 As Boolean
hotkey1 = GetAsyncKeyState(Keys.F9)
If hotkey1 = True Then Timer2.Stop()
End Sub
Private Sub Timer9_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer9.Tick
Dim Hotkeyss As Boolean
Hotkeyss = GetAsyncKeyState(Keys.F10)
If Hotkeyss = True Then
Timer6.Enabled = True
End If
Dim Hotkeyss1 As Boolean
Hotkeyss1 = GetAsyncKeyState(Keys.F11)
If Hotkeyss1 = True Then
Timer6.Enabled = False
End If
End Sub
End Class Dole ty poslední 3 timery jsou na Hotkeye které jsem chtěl udělat podle jednoho návodu ale oni nefungujou... Nastavím si např. Timer9: Timer1.interval = 10, timer1.enabled = true - to dám pravo v tom boxu a pak do kodu napíšu tam to nahoře ale když dám F5 tak mi to napíše nějakou chybu:A call to PInvoke function 'rsbchanger!RSBchanger.Form1::GetAsyncKeyState' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature. Nevím jak tuto chybu vyřešit... Pomohl by mi někdo? :)
|