Join Date: Aug 2009
Posts: 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: Public Class Form1 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) Private Const Key_NONE As Integer = &H0Private Const WM_HOTKEY As Integer = &H312 Protected Overrides Sub WndProc(ByRef m As Message) If m.Msg = WM_HOTKEY Then Case m.WParam Case 1 SendKeys.SendWait(TextBox6.Text) System.Threading.Thread.Sleep(200) SendKeys.Send(TextBox1.Text) SendKeys.Send(Label13.Text) Case 2 SendKeys.SendWait(TextBox6.Text) System.Threading.Thread.Sleep(200) SendKeys.Send(TextBox2.Text) SendKeys.Send(Label14.Text) Case 3 SendKeys.SendWait(TextBox6.Text) System.Threading.Thread.Sleep(200) SendKeys.Send(TextBox3.Text) SendKeys.Send(Label15.Text) Case 4 SendKeys.SendWait(TextBox6.Text) System.Threading.Thread.Sleep(200) SendKeys.Send(TextBox4.Text) SendKeys.Send(Label16.Text) Case 5 SendKeys.SendWait(TextBox6.Text) System.Threading.Thread.Sleep(200) SendKeys.Send(TextBox5.Text) SendKeys.Send(Label17.Text) End Select End If MyBase.WndProc(m) End Sub Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing UnregisterHotKey(Me.Handle, 1) UnregisterHotKey(Me.Handle, 2) UnregisterHotKey(Me.Handle, 3) UnregisterHotKey(Me.Handle, 4) UnregisterHotKey(Me.Handle, 5) End Sub Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load RegisterHotKey(Me.Handle, 1, Key_NONE, Keys.F1) RegisterHotKey(Me.Handle, 2, Key_NONE, Keys.F2) RegisterHotKey(Me.Handle, 3, Key_NONE, Keys.F3) RegisterHotKey(Me.Handle, 4, Key_NONE, Keys.F4) RegisterHotKey(Me.Handle, 5, Key_NONE, Keys.F5) End Sub
|