Could it be that there is just multiple windows that have the "Eden Eternal" class (or title)?
If this is the case then maybe win.Find()
is just returning the first occurrence.
It's not that uncommon for an application (particularly games) to have more then one window.
And one or more of them might be hidden/inactive that you probably don't want too.
Something like this should work:
local hwndTarget = nil
-- Enumerate all windows
local Windows = win.List()
for _,w in ipairs(Windows) do
-- The one we are looking for?
if (string.find(w.class, "Eden Eternal", 1,true) and string.find(w.title, "Eden Eternal", 1,true)) then
hwndTarget = w.hwnd
assert(hwndTarget, "Game window not found!")
To see if there are multiple windows you can use the "Windows List.mms", or use a tool like "InqSoft Window Scanner" to list them.
And if in fact there are multiple windows you can narrow them down doing more tests for it's pattern using the window's style, ID, etc.
If this is not the case let me know so I can track down a bug(s) in MM and fix it.
Also please either post or PM me your win.Find()
line(s) so I can study it.