Results 1 to 7 of 7

Thread: Program Crash on Startup

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2009
    Posts
    4

    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

  2. #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.

  3. #3

    Thread Starter
    New Member
    Join Date
    May 2009
    Posts
    4

    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.

  4. #4
    PowerPoster keystone_paul's Avatar
    Join Date
    Nov 2008
    Location
    UK
    Posts
    3,327

    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".

  5. #5

    Thread Starter
    New Member
    Join Date
    May 2009
    Posts
    4

    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

  6. #6
    PowerPoster keystone_paul's Avatar
    Join Date
    Nov 2008
    Location
    UK
    Posts
    3,327

    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.

  7. #7

    Thread Starter
    New Member
    Join Date
    May 2009
    Posts
    4

    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
  •  



Click Here to Expand Forum to Full Width