Using SetWindowLong I set the offset, and put the address of the object of my class there. But, the function stubbornly returns 0. Tell me, what is the error?
class Test { int *a; std::string test; public: Test(){} void Tests(HWND hwnd) { LONG res = SetWindowLong(hwnd, GWL_USERDATA, (LONG)this); // в res возвращается 0 return; } }; PS: I do it so that I can refer to the class from the window procedure.