3

The documentation for user32.dll's SetParent function states that

When you change the parent of a window, you should synchronize the UISTATE of both windows. For more information, see WM_CHANGEUISTATE and WM_UPDATEUISTATE.

I've looked through those pages, and the character sequence sync doesn't appear at all. My best guess is that I'm meant to send a WM_UPDATEUISTATE message to the new parent window, but I have no idea what parameters to use.

  • If it should be a UIS_INITIALIZE then I take the second paragraph of the remarks to indicate that the message might be discarded, so I don't have any confidence that it will guarantee synchronisation of state between the parent and the child.
  • If it should be two messages, one with UIS_CLEAR and the other with UIS_SET, then I can't understand why the SetParent documentation doesn't also mention WM_QUERYUISTATE, so this option doesn't convince me either.

What is the correct interpretation of "synchronize the UISTATE"?

Peter Taylor
  • 4,918
  • 1
  • 34
  • 59

1 Answers1

-1

It doesn't matter. It's your decision how your app will work. You can clear both, or take one state and set the same for the other window, or you can query the last input method mouse/keyboard and hide if mouse, show if keyboard.

Atys
  • 109
  • 6