OldSchoolHack

Registrieren / Anmelden Deutsch

[VB08] Timer Frage

icon Thema: [VB08] Timer Frage

Anmeldungsdatum: Aug 2009

Beiträge: 21

Hallo...
Hab schon einiges probiert aber ich komm nicht weiter! wie kann ich im folgendem Code ein Timer einbauen? so das er z.b. case 1 oder case 3 immer wieder sendet?

Wenn ich F1 Drücke sendet er den Text auch.. aber ich möchte F1 drücken und dann sendet er alle 30Sek. den Text aus der Textbox...

TEXT Code:
  1. Public Class Form1
  2. Private Declare Function RegisterHotKey Lib "user32" (ByVal hWnd As IntPtr, ByVal id As Integer, ByVal fsModifier As Integer, ByVal vk As Integer) As IntegerPrivate Declare Sub UnregisterHotKey Lib "user32" (ByVal hWnd As IntPtr, ByVal id As Integer)
  3. Private Const Key_NONE As Integer = &H0Private Const WM_HOTKEY As Integer = &H312
  4. Protected Overrides Sub WndProc(ByRef m As Message)
  5.  
  6. If m.Msg = WM_HOTKEY Then
  7. Case m.WParam
  8. Case 1
  9. SendKeys.SendWait(TextBox6.Text)
  10. System.Threading.Thread.Sleep(200)
  11. SendKeys.Send(TextBox1.Text)
  12. SendKeys.Send(Label13.Text)
  13. Case 2
  14. SendKeys.SendWait(TextBox6.Text)
  15. System.Threading.Thread.Sleep(200)
  16. SendKeys.Send(TextBox2.Text)
  17. SendKeys.Send(Label14.Text)
  18. Case 3
  19. SendKeys.SendWait(TextBox6.Text)
  20. System.Threading.Thread.Sleep(200)
  21. SendKeys.Send(TextBox3.Text)
  22. SendKeys.Send(Label15.Text)
  23. Case 4
  24. SendKeys.SendWait(TextBox6.Text)
  25. System.Threading.Thread.Sleep(200)
  26. SendKeys.Send(TextBox4.Text)
  27. SendKeys.Send(Label16.Text)
  28. Case 5
  29. SendKeys.SendWait(TextBox6.Text)
  30. System.Threading.Thread.Sleep(200)
  31. SendKeys.Send(TextBox5.Text)
  32. SendKeys.Send(Label17.Text)
  33. End Select
  34. End If
  35. MyBase.WndProc(m)
  36. End Sub
  37.  
  38. Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
  39. UnregisterHotKey(Me.Handle, 1)
  40. UnregisterHotKey(Me.Handle, 2)
  41. UnregisterHotKey(Me.Handle, 3)
  42. UnregisterHotKey(Me.Handle, 4)
  43. UnregisterHotKey(Me.Handle, 5)
  44. End Sub
  45. Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
  46.  
  47.  
  48.  
  49. End Sub
  50. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  51. RegisterHotKey(Me.Handle, 1, Key_NONE, Keys.F1)
  52. RegisterHotKey(Me.Handle, 2, Key_NONE, Keys.F2)
  53. RegisterHotKey(Me.Handle, 3, Key_NONE, Keys.F3)
  54. RegisterHotKey(Me.Handle, 4, Key_NONE, Keys.F4)
  55. RegisterHotKey(Me.Handle, 5, Key_NONE, Keys.F5)
  56. End Sub