Hi all

I'm going to enum all windows using EnumWindows, as I need to check some Z order between some window handles that my program has.

I know I have to make a callback function to use EnumWindows, but as I'm relatively new to pointers to functions, I'm wondering if it's possible to make the callback function a member function of the class that is calling EnumWindows.

I know pointers to functions and pointers to member functions doesn't like to be mixed, and that the size of the address can be different. So is it impossible?

To clearly specify what I want, here is some pseudo code.
Code:
class CMyClass
{
    public:
        BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam);
        void SomeFunction()
        {
            BOOL (CMyClass::*pEnumProc)(HWND hwnd, LPARAM lParam);
            pEnumProc = CMyClass::EnumWindowsProc;
            EnumWindows(pEnumProc, 0);
        }
};
Some syntax might be wrong, I just wrote it, and the editor can't compile it. But I think it shows what it is I want to archive.

So, can this be done, or is not possible?

Thanks in advance!