Skip to content

Commit 9e7276a

Browse files
committed
Another attempted fix
1 parent 8458697 commit 9e7276a

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

backend/main.lua

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ typedef void* LPVOID;
4848
typedef void* LPUNKNOWN;
4949
typedef const void* REFCLSID;
5050
typedef const void* REFIID;
51-
typedef long LPARAM;
51+
typedef intptr_t LPARAM;
5252
typedef long HRESULT;
5353
typedef unsigned long ULONG;
5454
typedef unsigned long DWORD;
@@ -72,7 +72,7 @@ typedef struct {
7272
} ITaskbarList3Vtbl;
7373
struct ITaskbarList3 { ITaskbarList3Vtbl* lpVtbl; };
7474

75-
typedef int (__stdcall *WNDENUMPROC)(HWND, LPARAM);
75+
typedef BOOL (__stdcall *WNDENUMPROC)(HWND, LPARAM);
7676

7777
BOOL __stdcall EnumWindows(WNDENUMPROC lpEnumFunc, LPARAM lParam);
7878
int __stdcall GetWindowTextA(HWND hWnd, LPSTR lpString, int nMaxCount);
@@ -124,8 +124,9 @@ set_plugin_status("Most variables have been set", true)
124124
local window_enum_callback = ffi.cast("WNDENUMPROC", function(hwnd, lParam)
125125
if user32.IsWindowVisible(hwnd) == 0 then return 1 end
126126

127-
if user32.GetWindowTextA(hwnd, title, 16) == 5 then
128-
if ffi.string(title):lower() == "steam" then
127+
local len = user32.GetWindowTextA(hwnd, title, 16)
128+
if len == 5 then
129+
if ffi.string(title, len) == "Steam" then
129130
steam_hwnd = hwnd
130131
return 0
131132
end

0 commit comments

Comments
 (0)