WM_GetId of WINDOW-object is always 0

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

    • WM_GetId of WINDOW-object is always 0

      Hello.

      If create a window by WINDOW_CreateEx with some non-zero id for this window, so WM_GetId returns always 0.

      C Source Code

      1. WM_HWIN hWin = WINDOW_CreateEx(0, 0, 100, 100, WM_HBKWIN, WM_CF_SHOW, 0, 1234, 0);
      2. int id = WM_GetId(hWin);
      Is it bug?
      For other widgets, including FRAMEWIN-widget it returns correct value.


      Why you use type int for Id as parameter in all functions, although in fact the real Id-data is only I16 (short)?

      C Source Code

      1. typedef struct {
      2. WM_Obj Win;
      3. const WIDGET_EFFECT* pEffect;
      4. I16 Id;
      5. U16 State;
      6. } WIDGET;
      It's very pity that full 32-bit int is not used for Id.
      Best regards,
      Volodymyr.
    • Hi,

      Per default the WINDOW widget and the simple WM-window do not manage IDs.

      Add the following to your window callback:

      C Source Code

      1. case WM_GET_ID:
      2. WIDGET_HandleActive(pMsg->hWin, pMsg);
      3. break;
      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.