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 


[C#] Follow Programmes
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Webtijn
How do I cheat?
Reputation: 0

Joined: 13 Jun 2007
Posts: 4

PostPosted: Wed Jun 13, 2007 6:24 am    Post subject: [C#] Follow Programmes Reply with quote

Hi,

I've got a problem. When I start FlyFF I can see it in the process bar. But when it's done with patching it dissapears in the process list! The only option is using the 'Watch' option in CE, but CE like always detected.

Does anyone know how to make a 'watch programme' option like CE has got? I'm programming in C#.NET, but any other information is also good enough.

(Sorry for my bad english)

--
Me
Back to top
View user's profile Send private message
assaf84
Expert Cheater
Reputation: 0

Joined: 03 Oct 2006
Posts: 238

PostPosted: Wed Jun 13, 2007 7:01 am    Post subject: Reply with quote

Isn't maple's window is hidden or something?
Back to top
View user's profile Send private message
Webtijn
How do I cheat?
Reputation: 0

Joined: 13 Jun 2007
Posts: 4

PostPosted: Wed Jun 13, 2007 7:25 am    Post subject: Reply with quote

x0r wrote:
FindWindow, GetWindowThreadProcessId, OpenProcess.


Thnx for the names, i've googled a bit and think i've found some usefull stuff! I just don't know if it really follows the process like I needed.. Rolling Eyes
Back to top
View user's profile Send private message
pwnedurass
How do I cheat?
Reputation: 0

Joined: 13 Jun 2007
Posts: 5

PostPosted: Wed Jun 13, 2007 12:42 pm    Post subject: Reply with quote

lol thats for like virus'es to make them open.Smile.
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Wed Jun 13, 2007 3:17 pm    Post subject: Reply with quote

You could try the managed way.

System.Diagnostics, and try the process class. One way to check for the process would be getting it's length. If it's 0, it's not there, otherwise, it's running.
Back to top
View user's profile Send private message
Webtijn
How do I cheat?
Reputation: 0

Joined: 13 Jun 2007
Posts: 4

PostPosted: Thu Jun 14, 2007 6:19 am    Post subject: Reply with quote

FindWindow and System.Process.GetProcessByName are both giving different returns, but the MSDN site says they both return a handle to the specified programme.

FindWindow:
"If the function succeeds, the return value is a handle to the window that has the specified class name and window name."

GetProcessByName:
"An array of type Process that represents the process resources running the specified application or file."

These are different returns, but MSDN says it are both handles to the programme. Why does GetProcessByName works, but FindWindow dont?


What am I doing wrong?
Back to top
View user's profile Send private message
Noz3001
I'm a spammer
Reputation: 26

Joined: 29 May 2006
Posts: 6220
Location: /dev/null

PostPosted: Thu Jun 14, 2007 6:55 am    Post subject: Reply with quote

Code:
HWND hMapleWindow = FindWindow(0, "MapleStory");


hMapleWindow is the handle to maplestory. Pass this to GetWindowThreadProcessId to get Maple's PID then use that to OpenProcess
Back to top
View user's profile Send private message MSN Messenger
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Thu Jun 14, 2007 7:37 am    Post subject: Reply with quote

you mean FindWindow("MapleStoryClass", "MapleStory"), is quicker and yields more accurate results.
Back to top
View user's profile Send private message
the_undead
Expert Cheater
Reputation: 1

Joined: 12 Nov 2006
Posts: 235
Location: Johannesburg, South Africa

PostPosted: Thu Jun 14, 2007 7:47 am    Post subject: Reply with quote

Actually concidering he's using C# He would have to use IntPtr instead of HWND.

Code:
[DllImport("USER32.DLL")]
public static extern IntPtr FindWindow(
string lpClassName,
string lpWindowName);

[DllImport("user32.dll", SetLastError = true)]
static extern uint GetWindowThreadProcessId(
IntPtr hWnd,
out uint lpdwProcessId);

[DllImport("kernel32.dll")]
public static extern IntPtr OpenProcess(
UInt32 dwDesiredAccess,
Int32 bInheritHandle,
UInt32 dwProcessId);

UInt32 ProcID;
IntPtr hMapleWindow = FindWindow("MapleStoryClass","MapleStory");
GetWindowThreadProcessId(hMapleWindow, out ProcID);
IntPtr ProcessHandle = OpenProcess(0x1F0FFF, 1, ProcID);

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Noz3001
I'm a spammer
Reputation: 26

Joined: 29 May 2006
Posts: 6220
Location: /dev/null

PostPosted: Thu Jun 14, 2007 8:18 am    Post subject: Reply with quote

appalsap wrote:
you mean FindWindow("MapleStoryClass", "MapleStory"), is quicker and yields more accurate results.


How would I know the class name?..
Back to top
View user's profile Send private message MSN Messenger
Webtijn
How do I cheat?
Reputation: 0

Joined: 13 Jun 2007
Posts: 4

PostPosted: Thu Jun 14, 2007 9:17 am    Post subject: Reply with quote

noz3001 wrote:
appalsap wrote:
you mean FindWindow("MapleStoryClass", "MapleStory"), is quicker and yields more accurate results.


How would I know the class name?..


Usually I just put null for the first argument of FindWindow. I've got no idea how to find the class of a process.


the_undead wrote:
Actually concidering he's using C# He would have to use IntPtr instead of HWND.


Thnx dude! This is really great! I think i've thought out how to make it work (Well, you did the most of it, thanks again!) Also the others, thank you so much! Your answers were so quick Smile


Last edited by Webtijn on Thu Jun 14, 2007 9:30 am; edited 2 times in total
Back to top
View user's profile Send private message
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Thu Jun 14, 2007 9:24 am    Post subject: Reply with quote

noz3001 wrote:
How would I know the class name?..



au3 spy or spy++
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Thu Jun 14, 2007 10:16 am    Post subject: Reply with quote

pinvoke.net is a great website for getting pinvoke signatures for API's. Fast and easy, saves you from having to write them yourself.
Back to top
View user's profile Send private message
the_undead
Expert Cheater
Reputation: 1

Joined: 12 Nov 2006
Posts: 235
Location: Johannesburg, South Africa

PostPosted: Thu Jun 14, 2007 10:41 am    Post subject: Reply with quote

Total waste of time. I assume youre going to be using MSDN in addition to.
MSDN tells you where to import it from and the data types. Simple. And I can garentuee its quicker.

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Thu Jun 14, 2007 11:24 am    Post subject: Reply with quote

the_undead wrote:
Total waste of time. I assume youre going to be using MSDN in addition to.
MSDN tells you where to import it from and the data types. Simple. And I can garentuee its quicker.


What could be quicker than copy/pasting? Especially if you have the nice little plugin for VS.
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  Next
Page 1 of 2

 
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