If the problem is that one file has the variable and another doesn't an easy fix is to put
MYHANDLES lumpi[10]
in one file and
extern MYHANDLES lumpi[10]
in the other(s).
As for passing the handle via an
LPARAM
the problem is that
lumpi[0]
is the first element in
lumpi
, not a pointer to
lumpi
hence the error. Also
&lumpi[0]
is the address of the first element and is the same as
lumpi
so
(LPARAM)lumpi
should work fine;
For reference I use this code in one of my programs and it works quite well.
vector<hwnd> hWndVector;
...
EnumThreadWindows(Thread.th32ThreadID, (WNDENUMPROC)EnumThreadWndProc, (LPARAM)&hWndVector);
...
BOOL CALLBACK EnumThreadWndProc(HWND hwnd, LPARAM lParam)
{
vector<HWND>* phWndVector = (vector<HWND>*)lParam;
phWndVector->push_back(hwnd);
return TRUE;
}</hwnd>