hmm let me think about youre code
Code:
Codes:
[Timer]
- Public Declare Function GetAsyncKeyState Lib "user 32" (ByVal vKey As Integer) As Int16
If (GetAsyncKeyState(Key.F10)) Then
"Code here" // Also F11
End if
[Connect/Disconnected]
shell("NET START DHCP")
Shell("NET STOP DHCP")
1. what the fail is that??
-
* Int16 only work for 32bit systemes

or for the most but not for all OS! better you use
this code to declare youre GetAsyncKeyState Hotkeys
Code:
Private Declare Function GetAsyncKeyState Lib "User32" (ByVal vKey As Integer) As Short
* as Short is better!!
and after that give it the Property to correct using the hotkeys
Code:
Private Property result() As Short
now we are ready to make funktions like this:
Code:
For i = 6 To 255 ' with this loop the hotkeys work on every OS!!
result = 0
result = GetAsyncKeyState(i)
If GetAsyncKeyState(Keys.F1) Then
shell("NET START DHCP")
End If
If GetAsyncKeyState(Keys.F2) Then
shell("NET STOP DHCP")
End If
Next i
sooo okay now the full code look like this:
Code:
Public Class Form1
Private Declare Function GetAsyncKeyState Lib "User32" (ByVal vKey As Integer) As Short ' Declare hotkeys
Private Property result() As Short ' Declare result of hotkeys
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
For i = 6 To 255 ' with this loop the hotkeys work on every OS!!
result = 0
result = GetAsyncKeyState(i)
If GetAsyncKeyState(Keys.F1) Then
Shell("NET START DHCP")
End If
If GetAsyncKeyState(Keys.F2) Then
Shell("NET STOP DHCP")
End If
Next i
End Sub
End Class
* i don t tryed it out but it should 100% work 