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


      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.


    • Hi,

      Unfortunately, there is no such list available.

      In chapter ' 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().