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 


picking up new processes
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
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Wed May 14, 2008 7:13 pm    Post subject: picking up new processes Reply with quote

I have a question. How do you pick up new processes. Like in task manager. If you have it open and then open up notepad it will update and show notepad.exe in the process list. How do you do that. Like detect that a new process got opened.
_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Overload
Master Cheater
Reputation: 0

Joined: 08 Feb 2008
Posts: 293

PostPosted: Wed May 14, 2008 7:20 pm    Post subject: Reply with quote

just keep looping checking for the processes. Instead of calling all the processes once, put that into a loop.
Back to top
View user's profile Send private message MSN Messenger
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Wed May 14, 2008 7:26 pm    Post subject: Reply with quote

Notice the taskmanager flicker? It's because it recalls everything
_________________
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Wed May 14, 2008 7:27 pm    Post subject: Reply with quote

Excuse me but may I ask how. I mean, if I already listed the processes. I could just loop the listprocess() function, but then I would keep adding and i'd have like a bajillion list strings for the same process. And I can't really delete each one at the end of the loop. Isn't there a way to like loop and take a snapshot of all the processes, and then compare it to the other snapshot, and then if they're different figure out which process it is that has been added?
_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Wed May 14, 2008 7:42 pm    Post subject: Reply with quote

Send The Message LB_RESETCONTENT before you print out the new items.
_________________
Back to top
View user's profile Send private message
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Wed May 14, 2008 8:12 pm    Post subject: Reply with quote

If you decide that you want to view the source i added a timer and added LB_ERASECONTENT in ListProcess

You can fix the scrolling problem

Every 3 seconds, on timer, it will erase and go to top



The Extension 'rar' was deactivated by an board admin, therefore this Attachment is not displayed.


_________________
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Wed May 14, 2008 8:30 pm    Post subject: Reply with quote

blankrider wrote:
If you decide that you want to view the source i added a timer and added LB_ERASECONTENT in ListProcess

You can fix the scrolling problem

Every 3 seconds, on timer, it will erase and go to top


LB_ERASECONTENT does not exist. And how would I fix the scrolling problem. For those of you that don't know, the scrolling problem is it that it resets the scroll bar to the top so if your browsing through the processes your reset to the top every 3 seconds. Oh yes, and hwo do I not have it flicker every 3 seconds. Like task manager only flickers when you open a new process not every "x" seconds.

_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Wed May 14, 2008 8:34 pm    Post subject: Reply with quote

It doesn't use LB_CONTENTERASE or w/e

I don't think so

I know it refreshes on a timer and not when new processes open because you can customize the time

_________________
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Wed May 14, 2008 8:40 pm    Post subject: Reply with quote

blankrider wrote:
It doesn't use LB_CONTENTERASE or w/e

I don't think so

I know it refreshes on a timer and not when new processes open because you can customize the time


I know,but can't I make it so it refreshed when a process opens. or at least refresh without resetting the scrollbar.

_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Wed May 14, 2008 8:40 pm    Post subject: Reply with quote

1. LB_RESETCONTENT
2. Get the current index, then get the string at that index using LB_GETCURSEL and LB_GETTEXT then use LB_FINDSTRING and LB_SETCURSEL to put it back to that string, you can have it make a check for -1 index returned by FINDSTRING (incase process is gone) and then set it back to the index returned by LB_GETCURSEL in the beggining.

will look like this:
Code:
int index = SendMessage( hList, LB_GETCURSEL, 0, 0 );
TCHAR tszText[260];
SendMessage( hList, LB_GETTEXT, index, (LPARAM)tszText );
//do your reset and fill list again
int newindex = SendMessage( hList, LB_FINDSTRING, -1, (LPARAM)tszText );
if ( newindex != CB_ERR )
    SendMessage( hList, LB_SETCURSEL, newindex, 0 );
else
    SendMessage( hList, LB_SETCURSEL, index, 0 );


Else make the list box bigger?

_________________
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8588
Location: 127.0.0.1

PostPosted: Thu May 15, 2008 1:12 am    Post subject: Reply with quote

Look at the example I uploaded in your other topic Obi, I have a function to refresh the list.
_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Zand
Master Cheater
Reputation: 0

Joined: 21 Jul 2006
Posts: 424

PostPosted: Thu May 15, 2008 5:29 am    Post subject: Reply with quote

Um, get the number of processes running, keep looping it and if old number < new number then refresh it or something?
Back to top
View user's profile Send private message
Estx
Expert Cheater
Reputation: 0

Joined: 04 Mar 2008
Posts: 172

PostPosted: Thu May 15, 2008 6:59 am    Post subject: Reply with quote

Take x0r's advice, saves processing time and memory space - good coding practice as well. You can also compare the memory of the previous result and the current with this method without having to worry about all the extra information that changes with other indirect API calls.

And obviously don't update the display every-time you refresh unless data has changed that you need displayed (CPU usage, Memory usage, Open Threads etcetera).

Quote:
Um, get the number of processes running, keep looping it and if old number < new number then refresh it or something?

If one process terminated and another started between the interval that the processes are being enumerated at, then there would be no update to what's refreshed.
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8588
Location: 127.0.0.1

PostPosted: Thu May 15, 2008 7:33 am    Post subject: Reply with quote

Or instead of including psapi (if you don't want to) you can call ZwQuerySystemInformation yourself with SystemProcessesAndThreadsInformation ( 5 ) to get the same result.

CreateToolhelp32Snapshot also calls ZwQuerySystemInformation as does EnumProcess, so you get the same results basically either way. One function offers more results then the other.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Thu May 15, 2008 8:27 am    Post subject: Reply with quote

Wiccaan wrote:
Look at the example I uploaded in your other topic Obi, I have a function to refresh the list.


You added a refresh button. I want an automatic update xD.

@xor

Looking up EnumProcesses right now.

Code:

DWORD epProcesses[1024], epByteRet, epNumProcesses;
EnumProcesses(epProcesses, sizeof(epProcesses), epByteRet);
epNumProcesses = epByteRet / sizeof(DWORD);
for(int i = 0; i<epNumProcess; i++) {
   SendMessage(hList, LB_ADDSTRING, NULL, (LPARAM)epProcesses[i]);
}


Is that right? Btw, if I made a for loop that had the original from startup, and then enumerated the processes. Saw if epNumProcesses had decreased/increased, it could relist all the processes. But where would I put the for loop? Btw, how do I fix the scrollbar problem?

_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
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