Jump to content

» «

[.NET]SendKeys.Send Inf. Loop

1 reply to this topic
  • floof

    Ghetto Star

  • Members
  • Joined: 30 Jul 2007
  • None


Posted 09 October 2012 - 04:20 AM

So to keep it simple, I'm basically integrating a Compiler into a GUI with a button to send Text commands to CMD
Private Sub btnCPL_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCPL.Click
       SendKeys.Send(" 0x7DD1E61C ")
       SendKeys.Send(" ")
End Sub

Problem: When I run the first compile, it's flawless. But upon clicking again, it appears the
line gets stuck on my Compile button and constantly opens Command Promt (CMD.exe) over and over (non-stop)

So the question is, would there be a line to add after the {ENTER} to stop/rest the script?

  • nightwalker83

    Don't mind me

  • Members
  • Joined: 10 Oct 2004
  • None


Posted 10 October 2012 - 08:25 AM

You could probably use a Boolean and after you press the button the first time set it to true after initializing it as false then surround you code with conditional statement that checks whether the operation has been carried out. If the Boolean is true then it has.

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users