Message for a window in which the destination is another window

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Message for a window in which the destination is another window

      I would need an explanation about the destination of the messages.
      The WM_MESSAGE structure has the hWin field described as "Destination window":

      C Source Code

      1. struct WM_MESSAGE {
      2. int MsgId; /* type of message */
      3. WM_HWIN hWin; /* Destination window */
      4. WM_HWIN hWinSrc; /* Source window */
      5. union {
      6. const void * p; /* Some messages need more info ... Pointer is declared "const" because some systems (M16C) have 4 byte const, byte 2 byte default ptrs */
      7. int v;
      8. GUI_COLOR Color;
      9. } Data;
      10. };

      Also, the functions for sending messages (e. g. WM_SendMessage) have the hWin parameter used to indicate the target window (or at least that's what I understood).

      Could you give me an example in which the hWin field of the structure and the hWin parameter of the functions are populated differently? When can such a case be useful or indispensable?

      best regards
      Max
    • Hi,

      The field hWin gets populated with the parameter hWin passed along with WM_SendMessage().

      Basically it is just required to fill in an ID in the field MsgId. The other fields are just optional.

      Regards
      Sven
      Please read the forum rules before posting.

      Keep in mind, this is *not* a support forum.
      Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
      Should you be entitled to support you can contact us via our support system: segger.com/ticket/

      Or you can contact us via e-mail.