I was creating the window in the class itself
void MyClass::MyClass(void){
CString wnd_class_name = ::AfxRegisterWndClass(NULL);
this->CreateEx(0,wnd_class_name, "TEST_THREAD_WINDOW",0 ,0 ,0 ,0 ,0 ,HWND_MESSAGE,0);
TRACE("WINDOW READY\n");
}
I did what you suggested and the result was the same, as I said, I can find the window, the FindWindowEx(..) returns HWND, so the window is there, but the message is simply not captured by it. I have double checked the registers message and so on and everything is ok, but no result in the function for the received message.
Edit: I mean FindWindowEx, not FindWindow of course.