Einzelnen Beitrag anzeigen

Kas Ob.

Registriert seit: 3. Sep 2023
347 Beiträge
 
#2

AW: Einzelnes StatusPanel neu zeichnen

  Alt 19. Sep 2024, 09:55
Very interesting question, and i liked it !

From what i see, you have two option either
1) WM_DRAWITEM as it sound strange but many of these are not documented or the documentation is not clear,
https://learn.microsoft.com/en-us/wi...ls/wm-drawitem
But that page doesn't mention Status Bars, with this older version documentation
https://github.com/MicrosoftDocs/win...wn-status-bars
a detail explain on how to use it, notice that SB_XXX message are not supported on older Windows, but WM_DRAWITEM will work with them all Windows versions.

2) InvalidateRect , This one is my best choice, yet i have no idea if it is still working as intended on latest Windows with Status Bars (as for other (1) it is working and will work forever),
InvalidateRect is different, as it schedule the paint of the rectangle instead forcing an immediate draw, meaning it is fast and and the draw will happen on the next WM_PAINT, so you can over-call it with much less performance consequences, as the OS will handle the intersections as it see fit, while next WM_PAINT will do the perfect job.
https://learn.microsoft.com/en-us/wi...invalidaterect
yet again, you need to understand how fast it in signaling repaint and when it will happen, so it might or might-not fit your need, also InvalidateRect is the best companion for double buffering, to reduce flickering.

These what comes to mind as i recall them working, there is other approaches though, but need a recall and tests.
Kas
  Mit Zitat antworten Zitat