|
-
May 1st, 2009, 01:45 PM
#1
Thread Starter
New Member
Program Crash on Startup
This program I made crashes on startup, I do not know what I am doing wrong, can anybody help me?
Here is the code-
Code:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Enabled = True
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
AppActivate("Chat Window")
Do
SendKeys.Send(TextBox1.Text)
SendKeys.Send((Chr(13)))
Loop
End Sub
End Class
-
May 1st, 2009, 01:47 PM
#2
Re: Program Crash on Startup
What is AppActivate("Chat Window") do?
Plus, what's the error message? We're not mind readers here, so we can't guess whats going on if you don't tell us the error message, or what your code does.
Edit: From the looks of that loop, you're stuck in an infinite loop. The program's always going to crash because that loop won't end.
-
May 1st, 2009, 01:52 PM
#3
Thread Starter
New Member
Re: Program Crash on Startup
AppActivate("Chat Window") selects the application it will run its code I guess that's how you explain it.
I took out the do and the loop, now whenever I click on the application it automatically switches to the Chat Window application.
-
May 1st, 2009, 01:54 PM
#4
Re: Program Crash on Startup
When you say it crashes on startup what do you mean exactly?
Do you actually mean on startup or after after you've clicked the button?
Looking at that code nothing is likely to happen until you click Button1, and then as formlesstree4 says you will be in an endless loop sending the context of textbox1 to "Chat Window".
-
May 1st, 2009, 01:58 PM
#5
Thread Starter
New Member
Re: Program Crash on Startup
Now it just sends the spaces to Chat Window without me pressing anything when I start it.
Code:
Public Class SpamBot
Private Sub Start_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Enabled = True
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
AppActivate("Chat Window")
SendKeys.Send(TextBox1.Text)
SendKeys.Send((Chr(13)))
End Sub
End Class
-
May 1st, 2009, 02:08 PM
#6
Re: Program Crash on Startup
OK I was about to give you more information but now having just noticed the title of your class - "SpamBot" - I'm afraid I'm not going to offer any help.
This forum is not the place for asking for help to write programs that perform illegal or antisocial actions.
-
May 1st, 2009, 02:13 PM
#7
Thread Starter
New Member
Re: Program Crash on Startup
No it is just so me and my friends can mess around with eachother... I wasn't going to use it for illegal activities.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|