![]() |
|
[VB.NET] [Source] Typing on HotKey - Printable Version +- Sinisterly (https://sinister.ly) +-- Forum: Coding (https://sinister.ly/Forum-Coding) +--- Forum: Visual Basic & .NET Framework (https://sinister.ly/Forum-Visual-Basic-NET-Framework) +--- Thread: [VB.NET] [Source] Typing on HotKey (/Thread-VB-NET-Source-Typing-on-HotKey) |
[VB.NET] [Source] Typing on HotKey - Coder-san - 01-25-2011 This source includes Text-typing when a Hotkey is pressed. It is an example for TypingText effect, and also Hotkey usage. You can modify it to do a lot of different things. Have fun. ![]() Spoiler: SourceCode: Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Integer) As Integer
Dim FnKey As Integer
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
Try
If ListBox1.Items.Count > FnKey - 2 Then SendKeys.Send(ListBox1.Items.Item(FnKey - 1))
SendKeys.Send("{Enter}")
Catch ex As Exception
MsgBox("Unknown Error occurred" & vbCrLf & vbCrLf & ex.Message.ToString, MsgBoxStyle.Critical, "Error")
Timer2.Stop()
Timer1.Stop()
End Try
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
For i As Integer = 112 To 123
If GetAsyncKeyState(i) <> 0 Then FnKey = i - 111
Next
If FnKey >= 1 And FnKey <= 11 Then Timer2.Start()
If FnKey = 12 Then Timer2.Stop()
End Sub
Private Sub cmdStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdStart.Click
Timer1.Start()
End SubRE: [VB.NET] [Source] Typing on HotKey - 1234hotmaster - 01-25-2011 nice code. just wondering what its used for o.o? RE: [VB.NET] [Source] Typing on HotKey - Coder-san - 01-25-2011 I don't really remember why I made this. xp But it's an example for both text typing, and hotkey usage. RE: [VB.NET] [Source] Typing on HotKey - 1234hotmaster - 01-25-2011 oh ok then. btw how can i get the webbrowser's text? like webbrowser1.navigate("www.google.com") textbxo1.text = webbrowser1.document.all.tostring but doesn't work... also the dim wc as new webclient wc.downloadstring("www.google.com") wc.dispose textbox1.text = wc.tostring Error: The server returned a 404 forbidden error. RE: [VB.NET] [Source] Typing on HotKey - Coder-san - 01-25-2011 (01-25-2011, 09:57 AM)1234hotmaster Wrote: oh ok then. btw how can i get the webbrowser's text? like It is offtopic, but use WebBrowser1.DocumentText.ToString in the browser DocumentCompleted event. |