Using Window functions in WM_PAINT

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

    • Using Window functions in WM_PAINT

      Hello,

      Are there any limitations of using the window related functions show and hide in WM_PAINT message.
      Also can i get a list of functions which should not be called from WM_PAINT message.

      Thanks
      Regards,

      Anuj
    • Hi,

      Unfortunately, there is no such list available.

      In chapter '6.1.2.1 Rendering using callbacks' you will find a description which give an idea about what kind of functions shouldn't be called.

      In general you should simply avoid calling function which create something (windows, widgtes, memory devices, ..). Also you shouldn't set any properties within a paint event. The problem is that you can not always how often a WM_PAINT message gets send to a window. Just image you would call a BUTTON_Create(). After a few seconds you would run out of memory.

      Of course, you are allow to call functions to get properties from a window/widget or memory device, e.g. WM_GetWindowSizeX() or WM_GetClientRect().

      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.