Vizible’s Blog

C# – How to start new thread

Posted in Programming by wearetherock on July 27, 2009
private void ClickMe(){
    //do any background work
    System.Threading.Thread.Sleep(5000);
    int x = this.Location.X + 5;
    int y = this.Location.Y + 5;
    SetCursorPos(x,y);
    mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, x ,y ,0,0);
}

~
Thread thread = new Thread(new ThreadStart(ClickMe));
thread.Start();
~
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: