Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > .NET Languages
You last visited: Today at 05:12

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



MultiThread to read Game infomation and remote

Discussion on MultiThread to read Game infomation and remote within the .NET Languages forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Nov 2015
Posts: 7
Received Thanks: 0
MultiThread to read Game infomation and remote

Hi everyboy I have some problem with Multi Thread and ListView Update:
I want to list running process by name in a Listview, and removing when this process close. But my code just adding a new process and dont remove when the process close. I am a beginner user in C#. Thank you.
*** I dont want to use listview.Clear() cause Im going to make a bot with multi client

Here's my code:
Code:
bool status = true;
int[] PID = new int[10];
Memory Mem = new Memory();
private void startChecking()
        {

            while (status)
            {
                try
                {
                    int count = 0;
                    Process[] processes = Process.GetProcessesByName("notepad");
                    if (processes.Length > 0)
                    {
                        if (listAccount.Items.Count < processes.Length)
                        {
                            foreach (Process process in processes)
                            {
                                if (listAccount.Items.Count < processes.Length && PID[count] != process.Id)
                                {
                                    Mem.SetTitle(process.MainWindowHandle, "New process - " + count.ToString());
                                    AddItemNew(process.MainWindowTitle);
                                    PID[count] = process.Id;
                                }
                                count++;
                            }
                        }
                        else if (listAccount.Items.Count < processes.Length)
                        {

                        }
                    }
                    Thread.Sleep(1000);
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Somethine went wrong : " + ex.ToString());
                }
            }
        }
Here is my AddItemNew / RemoveItem methods:

Code:
private delegate void dlgAddItemNew(string i);
        private void AddItemNew(string i)
        {
            if (this.listAccount.InvokeRequired)
            {
                this.Invoke(new dlgAddItemNew(AddItemNew), i);
            }
            else
            {
                ListViewItem accountAdd = new ListViewItem(i);
                accountAdd.SubItems.Add("0");
                accountAdd.SubItems.Add("0");
                accountAdd.SubItems.Add("0");
                accountAdd.SubItems.Add("0");
                this.listAccount.Items.Add(accountAdd);
            }
        }
        private delegate void dlgRemoveItem(int i);
        private void RemoveItem(int i)
        {
            if (this.listAccount.InvokeRequired)
            {
                this.Invoke(new dlgRemoveItem(RemoveItem), i);
            }
            else
            {
                this.listAccount.Items[i].Remove();
            }
        }


P/S : Sorry If my Enlish is not good....
thfire is offline  
Reply


Similar Threads Similar Threads
can not remote the server and login the game
11/05/2014 - SRO Private Server - 1 Replies
please help me, my server was hacked resulting in lost the network and can not remote the server and login the game. Please guide me how to fix
BabelOnline Cap 130 Pvp-Pve+More Infomation Join
03/11/2013 - SRO PServer Advertising - 1 Replies
---removed---
Neue Auzura Infomation
10/21/2010 - Last Chaos - 3 Replies
Übersetzer tex vom GM: Technische Schwierigkeiten: Azura Server Der Azura Server erfährt technische Schwierigkeiten in dieser Zeit. Wir dont haben eine voraussichtliche Ankunftszeit noch, aber wenn wir tun, werden wir diesen Faden aktualisieren. Das Problem wird verbreitet, um vom Händler Roy verursacht zu werden, der sich mit kritischen Server-Teilen heimlich davonmacht.
[Guild]Infomation?
03/18/2009 - Silkroad Online - 7 Replies
Hello All, Long time since i made and run my own guild and im thinking of making one. Ive looked around for some guides on how much GP you need to level up and what you get at every guild level. If someone can post some information that would be great. :D:D:D:D:D:D:D
I need Infomation, thanks.
01/09/2009 - Dekaron - 7 Replies
hey, i havent hacked in about 1 year and im confused with the new stuff that has come out, could u tell me these questions, thanks! :) what is CRC what is gameguardkiller in order to do vac,wall,speed,autopot,shop hacks, what do you have to do? cuz before u just downgraded client and skipped gg and put in USA folder, could some one explain the new way to hack to me please!



All times are GMT +1. The time now is 05:13.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.