Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[HELP C#]PID
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Henley
Grandmaster Cheater
Reputation: 0

Joined: 03 Oct 2006
Posts: 671

PostPosted: Sat Feb 09, 2008 7:05 pm    Post subject: [HELP C#]PID Reply with quote

I need help with getting the process ID for MapleStory. I know how to get when I load maple, but after gameguard is loaded, MapleStory's process becomes hidden and the process ID isn't running anymore.

I wanna know what happened the process ID, did it change?
If it did change, is there a way i could find the new process ID?
Back to top
View user's profile Send private message
Overload
Master Cheater
Reputation: 0

Joined: 08 Feb 2008
Posts: 293

PostPosted: Sat Feb 09, 2008 7:21 pm    Post subject: Reply with quote

I don't get what you are saying. You want to do what with MapleStory pID?

If you want to display it in a list, then it would be something like:

Code:
Process[] maple = Process.GetProcessByName("MapleStory");

listBox1.Items.Add(maple);


I'm pretty sure that will work Confused
Back to top
View user's profile Send private message MSN Messenger
Henley
Grandmaster Cheater
Reputation: 0

Joined: 03 Oct 2006
Posts: 671

PostPosted: Sat Feb 09, 2008 7:26 pm    Post subject: Reply with quote

I run ms and get PID.
Gameguard begins to load and the PID is no longer running.
I wanna know what happened to the PID.
Neutral
Back to top
View user's profile Send private message
Heartless
I post too much
Reputation: 0

Joined: 03 Dec 2006
Posts: 2436

PostPosted: Sat Feb 09, 2008 7:31 pm    Post subject: Reply with quote

I'm not 100% sure, but I think GameGuard hides Maple Story's PID and everything else.
_________________
What dosen't kill you, usually does the second time.
Back to top
View user's profile Send private message
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Sat Feb 09, 2008 7:50 pm    Post subject: Reply with quote

FindWindow using MapleStoryClass
using the handle get the proc ID

that's how i got the pid for one of my projects. I lost the source when i formatted so i can't post it. It's not confusing though.

_________________
Back to top
View user's profile Send private message
samuri25404
Grandmaster Cheater
Reputation: 7

Joined: 04 May 2007
Posts: 955
Location: Why do you care?

PostPosted: Sat Feb 09, 2008 8:16 pm    Post subject: Reply with quote

blankrider wrote:
FindWindow using MapleStoryClass
using the handle get the proc ID

that's how i got the pid for one of my projects. I lost the source when i formatted so i can't post it. It's not confusing though.


I had to re-read that many times to understand it.

Basically, call the FindWindow api, using the parameters

Code:

"MapleStoryClass", null


I think, then that'll return an IntPtr as a handle to Maple. Not sure why you would want the proc ID when you need a handle to do most things. Anyways, though, just call GetWindowThreadProcessID with

Code:

hWnd, out procid


Assuming that hWnd is what FindWindow returned, and procid is an int.

Here are the decls

Code:

//using System.Runtime.InteropServices;
[DllImport("user32.dll")]
public static extern IntPtr FindWindow( string classname, string windowname);

[DllImport("user32.dll")]
public static extern int GetWindowThreadProcessId(IntPtr hWnd, out int pid);

_________________
Wiccaan wrote:

Oh jeez, watchout I'm a bias person! Locked.


Auto Assembly Tuts:
In Depth Tutorial on AA
Extended
Back to top
View user's profile Send private message
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Sat Feb 09, 2008 9:34 pm    Post subject: Reply with quote

FindWindow using the MapleStoryClass, do you get that?
That returns a handle, using this handle use GetWindowThreadProcessID

I was in a rush, but i see you wrote him out a code. Make him think at least a little?

_________________
Back to top
View user's profile Send private message
samuri25404
Grandmaster Cheater
Reputation: 7

Joined: 04 May 2007
Posts: 955
Location: Why do you care?

PostPosted: Sat Feb 09, 2008 9:37 pm    Post subject: Reply with quote

blankrider wrote:
FindWindow using the MapleStoryClass, do you get that?
That returns a handle, using this handle use GetWindowThreadProcessID


Yeah, but it was hard to grasp at first. =P

blankrider wrote:
I was in a rush, but i see you wrote him out a code. Make him think at least a little?


=P

I had to Google for something pretty obscure to figure out which API to use to get the PID from the handle.

Also, Dll Imports are a huge pain in the ass. Thought I'd just throw him a bone.

_________________
Wiccaan wrote:

Oh jeez, watchout I'm a bias person! Locked.


Auto Assembly Tuts:
In Depth Tutorial on AA
Extended
Back to top
View user's profile Send private message
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Sat Feb 09, 2008 9:54 pm    Post subject: Reply with quote

oh yea, thats just a decl. I thought you gave him whole code at first.

MSDN IS MY BEST FRIEND ^_^_^_^

_________________
Back to top
View user's profile Send private message
Henley
Grandmaster Cheater
Reputation: 0

Joined: 03 Oct 2006
Posts: 671

PostPosted: Sat Feb 09, 2008 10:01 pm    Post subject: Reply with quote

D: I think theres a problem
I'm using FindWindow with MapleStoryClass,but whenever maple loads, the proc id is 0.

Here's my code:
Code:
string ClassName = "MapleStoryClass";
            //string WindowName = "MapleStory";
            IntPtr hWnd = FindWindow(ClassName, null);
            if (hWnd != IntPtr.Zero)
            {
                UInt32 ProcID;
                GetWindowThreadProcessId(hWnd, out ProcID);
                processlbl.Text = Convert.ToString(ProcID);//using a label to show pid
            }


Am i doing something wrong?
Back to top
View user's profile Send private message
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Sat Feb 09, 2008 10:09 pm    Post subject: Reply with quote

string ClassName = "MapleStoryClass";
//string WindowName = "MapleStory";
IntPtr hWnd = FindWindow(ClassName, null);
if (hWnd != IntPtr.Zero)
{
UInt32 ProcID;
GetWindowThreadProcessId(hWnd, out ProcID);
processlbl.Text = Convert.ToString(ProcID);//using a label to show pid
}
if(hWnd == IntPtr.Zero)
{
processlbl.Text = "Failed";
}



Try that and tell me if it says failed.

_________________
Back to top
View user's profile Send private message
Henley
Grandmaster Cheater
Reputation: 0

Joined: 03 Oct 2006
Posts: 671

PostPosted: Sat Feb 09, 2008 10:14 pm    Post subject: Reply with quote

Nope. 0
Back to top
View user's profile Send private message
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Sat Feb 09, 2008 10:15 pm    Post subject: Reply with quote

Try it with a process like Notepad.exe

Use Notepad as the windowname and null as a classname. See if you still get 0. If you do, then its in GG, if not then its the code. Idk why that code would be wrong though o.o

_________________
Back to top
View user's profile Send private message
Overload
Master Cheater
Reputation: 0

Joined: 08 Feb 2008
Posts: 293

PostPosted: Sat Feb 09, 2008 10:19 pm    Post subject: Reply with quote

hmm, i cant' really see anything wrong with this code. It must be GG that is screwing you over.
Back to top
View user's profile Send private message MSN Messenger
Henley
Grandmaster Cheater
Reputation: 0

Joined: 03 Oct 2006
Posts: 671

PostPosted: Sat Feb 09, 2008 10:20 pm    Post subject: Reply with quote

I think you mean Untitled - Notepad as window name. Anyways, i got a pid for notepad.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites