@@ -48,7 +48,7 @@ typedef void* LPVOID;
4848typedef void * LPUNKNOWN ;
4949typedef const void * REFCLSID ;
5050typedef const void * REFIID ;
51- typedef long LPARAM ;
51+ typedef intptr_t LPARAM ;
5252typedef long HRESULT ;
5353typedef unsigned long ULONG ;
5454typedef unsigned long DWORD ;
@@ -72,7 +72,7 @@ typedef struct {
7272} ITaskbarList3Vtbl;
7373struct ITaskbarList3 { ITaskbarList3Vtbl * lpVtbl ; };
7474
75- typedef int (__stdcall * WNDENUMPROC )(HWND , LPARAM );
75+ typedef BOOL (__stdcall * WNDENUMPROC )(HWND , LPARAM );
7676
7777BOOL __stdcall EnumWindows (WNDENUMPROC lpEnumFunc , LPARAM lParam );
7878int __stdcall GetWindowTextA (HWND hWnd , LPSTR lpString , int nMaxCount );
@@ -124,8 +124,9 @@ set_plugin_status("Most variables have been set", true)
124124local 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