It is probably a bug if focus gained messages from the OS do not set
the selected frame, but no new Lisp hooks should be needed.
I think this helped me to realize what is happening. I am not quite sure but
I believe this is a good guess:
*** This is where the tooltip window gets created (I did not check further
to see if it where reused, but the timings suggests to me it is not):
struct frame *f;
tip_window = FRAME_W32_WINDOW (f)
= CreateWindow (EMACS_CLASS,
FRAME_W32_WINDOW (SELECTED_FRAME ()), /* owner */
*** There is a SELECTED_FRAME above. As far as I understands it
SELECTED_FRAME is set by operations that Emacs recognize.