- 12 Agosto 2013
- 4
- 0
- Miglior risposta
- 0
Salve, C'è qualcuno di buona volontà che mi spiega come fare un flooder a stringhe oppure che corregga questo codice che ho provato (nel caso vada bene):
Imports System.Runtime.InteropServices
Public Class Form1
Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Declare Function SystemParamsLong Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByVal lpvParam As Long, ByVal fuWinIni As Long) As Long
Const SPI_GETKEYBOARDSPEED = 10
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Enabled = True
Timer1.Interval = 100
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Timer1.Enabled = False
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If GetAsyncKeyState(Keys.F1) Then
SendKeys.Send(TextBox1.Text)
End If
End Sub
End Class (Se non va bene non criticate è la prima volta che ci provo).
Però quando eseguo il debug mi da un errore:
Una chiamata alla funzione PInvoke 'WindowsApplication1!WindowsApplication1.Form1::Ge tAsyncKeyState' ha sbilanciato lo stack. Questo problema può verificarsi quando la firma PInvoke gestita non corrisponde alla firma di destinazione non gestita. Verificare che la convenzione di chiamata e i parametri della firma PInvoke corrispondano alla firma di destinazione non gestita.
e mi segna in verde: If GetAsyncKeyState(Keys.F1) Then
Aiutatemi! Per Cortesia!
Imports System.Runtime.InteropServices
Public Class Form1
Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Declare Function SystemParamsLong Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByVal lpvParam As Long, ByVal fuWinIni As Long) As Long
Const SPI_GETKEYBOARDSPEED = 10
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Enabled = True
Timer1.Interval = 100
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Timer1.Enabled = False
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If GetAsyncKeyState(Keys.F1) Then
SendKeys.Send(TextBox1.Text)
End If
End Sub
End Class (Se non va bene non criticate è la prima volta che ci provo).
Però quando eseguo il debug mi da un errore:
Una chiamata alla funzione PInvoke 'WindowsApplication1!WindowsApplication1.Form1::Ge tAsyncKeyState' ha sbilanciato lo stack. Questo problema può verificarsi quando la firma PInvoke gestita non corrisponde alla firma di destinazione non gestita. Verificare che la convenzione di chiamata e i parametri della firma PInvoke corrispondano alla firma di destinazione non gestita.
e mi segna in verde: If GetAsyncKeyState(Keys.F1) Then
Aiutatemi! Per Cortesia!