gangraz (02-05-2010)
Hello. I'm making a tapper. And a multi-tool soon. I need to know the code to make a hotkey to represent a "Shell "DHCP STOP"" or any control for that matter.
-Thanks in advance.
Last edited by Dreamcast; 01-29-2010 at 05:26 PM.
gangraz (02-05-2010)
this should help you i think if not post what you really want help with. GetAsyncKeyState Function ()
That's the way to do it. Press thanks remember!!!Code: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 Dim StartHotkey As Integer StartHotkey = GetAsyncKeyState(120) If StartHotkey <> 0 Then Shell("NET STOP DHCP") End If Dim StopHotkey As Integer StopHotkey = GetAsyncKeyState(121) If StopHotkey <> 0 Then Shell("NET START DHCP") End If End Sub Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked Process.Start("https://www.mpgh.net") End Sub End Class
Thanks.
No problem. Just make sure the timer interval is about 500 and don't hold down the hotkey.
Dreamcast (01-30-2010)
then F9 = 120
F10 = 121???
??
StartHotkey = GetAsyncKeyState(120)
StopHotkey = GetAsyncKeyState(121)
Or
GetAsyncKeyState (Keys.F9)
Instead of Key Numbers.
No problemo. But it would help if you pressed the button too, then I can do more of this.