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
    struct WM_MESSAGE {
      int MsgId;        	/* type of message */
      WM_HWIN hWin;     	/* Destination window */
      WM_HWIN hWinSrc;  	/* Source window  */
      union {
    	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 */
    	int v;
    	GUI_COLOR Color;
      } Data;
    };


    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: https://www.segger.com/ticket/

    Or you can contact us via e-mail.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!