In case hooking is too much (it gets all the messages from the system, not only from the window you need) The more proper technique (since the time of the first Petzold!) is subclassing
just write something like:
LRESULT CALLBACK yourproc(HWND h, UINT u, WPARAM w, LPARAM l)
and setup the subclassing as
oldproc = (WNDPROC)SetWindowLongPtr(yourHwnd, GWL_WNDPROC, (LONG_PTR)yourproc);
and from there,
will start receiving th messages of your window.