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 


getWindowlist() returns titles only, no PIDs or handles

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
xxhehe
Expert Cheater
Reputation: 0

Joined: 11 Mar 2015
Posts: 165

PostPosted: Sun Jul 26, 2026 6:25 am    Post subject: getWindowlist() returns titles only, no PIDs or handles Reply with quote

The celua.txt documentation says getWindowlist() returns a table formatted as {pid, {id, caption}}. But my actual output is a list of window titles, without process IDs or handles. Is this a bug?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 475

Joined: 09 May 2003
Posts: 25974
Location: The netherlands

PostPosted: Sun Jul 26, 2026 7:03 am    Post subject: This post has 1 review(s) Reply with quote

it returns a list of PID's and each pid contains an indexed list of windowtitles.

no handles no, just a pid and an id you can use to traverse the list

e.g: pid 22656 has a list of 8 windownames, pid 25220 has a list of 25 windownames, etc...

this may make it more clear:
Code:

for pid,list in pairs(getWindowList()) do
  printf("processid %x has the following windows:", pid)
  for i=1,#list do
    printf("  %d = %s", i, list[i])
  end
  print("")
end

_________________
Tools give you results. Knowledge gives you control.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
xxhehe
Expert Cheater
Reputation: 0

Joined: 11 Mar 2015
Posts: 165

PostPosted: Sun Jul 26, 2026 11:22 pm    Post subject: Reply with quote

Dark Byte wrote:
it returns a list of PID's and each pid contains an indexed list of windowtitles.

no handles no, just a pid and an id you can use to traverse the list

e.g: pid 22656 has a list of 8 windownames, pid 25220 has a list of 25 windownames, etc...

this may make it more clear:
Code:

for pid,list in pairs(getWindowList()) do
  printf("processid %x has the following windows:", pid)
  for i=1,#list do
    printf("  %d = %s", i, list[i])
  end
  print("")
end


The celua.txt documentation says getWindowlist() returns a table in the format { PID, { ID, Caption } }. But my actual output is a dictionary keyed by PID, with each value being an array of window title strings.

Test this with:

for pid, list in pairs(getWindowList()) do
printf("processid %x has the following windows:", pid)
for i = 1, #list do
printf(" %d = %s", i, list[i])
end
print("")
end

The result shows only title strings. No ID field is present.

Three questions:

Is this a doc bug, or did the API change?

What does the spec's "id" actually refer to—index position, window handle (HWND), or something else? If it's an index, is it stable across CE versions, and can I use it to retrieve the handle or other properties?

Since I currently can't get handles, class names, or visibility from this API, I maintain a blacklist in my script to filter out irrelevant windows (IME, tray icons, etc.):


local blacklist = {
"Default IME", "MSCTFIME UI", "GDI+ Window", "DDE Window", "MCI","MSCTFIME",
"__wglDummyWindowFodder", "wglDummy", "DummyWindow",
"CTrayNotifyIcon Helper Window",
"TrayNotifyIcon",
"BluetoothNotificationAreaIconWindowClass",
"NvContainerWindowClass",
".NET-BroadcastEventWindow","MediaContextNotificationWindow",
"SystemResourceNotifyWindow","AppBarDetectFullScreen",
"TRAYAGENTWINDOW",
"UDiskVirtualWindow", "Window_tsvulfw_man_window_0","BroadcastListenerWindow","UxdService",
"CalcMsgPumpWnd",
"MS_WebcheckMonitor","DDE Server Window",
"NVOGLDC invisible",
"CiceroUIWndFrame",
"QTrayIconMessageWindow",
"WinEventWindow",
"_WINDOWTOP_INTERNAL_UI_",
"BroadcastListenerWindow",
"com.pot-app.desktop-siw",
"ms_sqlce_se_notify_wndproc",
"次级窗口","Secondary Window",
}



This works, but it's fragile. I have to maintain the blacklist manually and can't distinguish windows with identical titles.

Will you consider extending getWindowlist() to return {title, hwnd} per entry, or adding a separate API like getWindowInfo() for fuller window data?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 475

Joined: 09 May 2003
Posts: 25974
Location: The netherlands

PostPosted: Mon Jul 27, 2026 6:09 am    Post subject: Reply with quote

It's according to document. It returns a table containing pid's and each pid entry contains a. indexed list of titles. The id is the index

Use getWindow to enumerate all windows

_________________
Tools give you results. Knowledge gives you control.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
AylinCE
Grandmaster Cheater Supreme
Reputation: 39

Joined: 16 Feb 2017
Posts: 1582

PostPosted: Mon Jul 27, 2026 7:44 am    Post subject: Reply with quote

I think you can find what you're looking for in the module code linked below:

https://forum.cheatengine.org/viewtopic.php?t=623937

Examine it and test it by adding "print()" inside some for loops to see what it does.

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine 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