Efficient Window Client Area Painting in VC++

Everybody knows that the WM_PAINT message is passed to a window whenever it needs to be painted. Usually, we code all of our painting instruction in the handler of WM_PAINT, including the background of our painting items. What actually happens is that a WM_ERASEBKGND is also passed prior to sending WM_PAINT. The default implementation of this message erases the client area of the window with white screen. To improve the efficiency of the overall painting of your window’s client area, identify the items that never change on your screen. These items should effectively be the background of your screen. Put the painting code of these items from your WM_PAINT handler to WM_ERASEBKGND handler and return a nonzero value to indicate to the windows that no further erasing is required. Doing this will speed up the complex windows painting and remove the flickering that happens when a window is resized or constantly refreshed.

Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Overview

The Latest

microsoft careers

Top Careers at Microsoft

Microsoft has gained its position as one of the top companies in the world, and Microsoft careers are flourishing. This multinational company is efficiently developing popular software and computers with other consumer electronics. It is a dream come true for so many people to acquire a high paid, high-prestige job

your company's audio

4 Areas of Your Company Where Your Audio Really Matters

Your company probably relies on audio more than you realize. Whether you’re creating a spoken text message to a colleague or giving a speech, you want your audio to shine. Otherwise, you could cause avoidable friction points and potentially hurt your brand reputation. For example, let’s say you create a

chrome os developer mode

How to Turn on Chrome OS Developer Mode

Google’s Chrome OS is a popular operating system that is widely used on Chromebooks and other devices. While it is designed to be simple and user-friendly, there are times when users may want to access additional features and functionality. One way to do this is by turning on Chrome OS