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 


Process Filters

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Filipe_Br
Master Cheater
Reputation: 3

Joined: 07 Jan 2016
Posts: 272
Location: My house

PostPosted: Wed Dec 14, 2016 7:24 am    Post subject: Process Filters Reply with quote

I have already learned how to create a list of processes, as if comparing the process modules.
Now I want to know other things.
1 - How to differentiate which processes have a window being displayed, and which ones do not.
2 - Is it possible to differentiate which processes belong to an application?

_________________
...
Back to top
View user's profile Send private message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1668

PostPosted: Wed Dec 14, 2016 9:42 am    Post subject: Reply with quote

I am not trying to answer the two questions, but it's better to understand about definition of application, process and service (as show in windows task manager).

An application is a program which you interact with on the desktop. This is what you spend almost all of your time using on the computer. Cheat Engine, browsers, Notepad, etc - they are all applications.

A process is an instance of a particular executable (.exe, com, bat program file) running. A given application may have several processes running simultaneously. For example, some modern browsers such as google chrome run several processes at once, with each tab actually being a separate instance/process of the same executable. In some cases, complicated applications may have multiple processes; for example, Visual Studio runs a separate process when it compiles code from when it displays the IDE. However, most often, a given application is running from a single process; for example, no matter how many microsoft word windows you have open, only a single instance of winword.exe is running.

A service is a process which runs in the background and does not interact with the desktop. In Windows, services almost always run as an instance of the svchost.exe process, the windows service host process; however there are sometimes exceptions to this.

So, is possible to maintenance these 3 definitions as that two questions ?
Maybe able to get running process and filtering by use windows tasklist command,

Regards
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4697

PostPosted: Wed Dec 14, 2016 9:48 am    Post subject: Reply with quote

1 - Find the window handle (e.g. FindWindow, EnumWindows) and call GetWindowThreadProcessId.

2 - You could make a pretty good guess. Look at the parent of the process, process names, where the images are located, when they were started, etc. See the tool help functions for more information.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
Filipe_Br
Master Cheater
Reputation: 3

Joined: 07 Jan 2016
Posts: 272
Location: My house

PostPosted: Wed Dec 14, 2016 12:28 pm    Post subject: Reply with quote

In Lua has a function called "getWindowlist ()" which returns a list of windows.
Most are shown all windows, hidden or not. How can I differentiate between visible and hidden windows?

_________________
...
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4697

PostPosted: Wed Dec 14, 2016 5:03 pm    Post subject: Reply with quote

Call IsWindowVisible.
Code:
// 0 = false, 1 = true
executeCodeLocal('User32.IsWindowVisible',hwnd)

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
Filipe_Br
Master Cheater
Reputation: 3

Joined: 07 Jan 2016
Posts: 272
Location: My house

PostPosted: Wed Dec 14, 2016 7:00 pm    Post subject: Reply with quote

Of course I will not know how to do it.
Code:

if executeCodeLocal('User32.IsWindowVisible',0x6AF0) == 0 then
   print("OK")
end

_________________
...
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4697

PostPosted: Wed Dec 14, 2016 7:17 pm    Post subject: Reply with quote

Is 0x6AF0 the handle of a window or the identifier of a process that created a window?

If it's the PID, you should at least take a brief look at the documentation on that function (see my previous post).

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
Filipe_Br
Master Cheater
Reputation: 3

Joined: 07 Jan 2016
Posts: 272
Location: My house

PostPosted: Thu Dec 15, 2016 3:02 am    Post subject: Reply with quote

It is the PID of the process. That's why I said I do not know how. How to get the PID from the window?
_________________
...
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4697

PostPosted: Thu Dec 15, 2016 9:59 am    Post subject: Reply with quote

PID stands for process identifier. A window does not have a PID. It has a handle.

I already told you how to find a window's handle in my first post.
ParkourPenguin wrote:
1 - Find the window handle (e.g. FindWindow, EnumWindows)...

main.lua:
Quote:
findWindow(classname OPTIONAL, caption OPTIONAL): windowhandle - Finds a window with the given classname and/or windowname

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
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