Go Premium for a chance to win a PS4. Enter to Win


How to stop a CWnd flickers & tramble

Posted on 1998-06-24
Medium Priority
Last Modified: 2013-11-20
I have created a control with 4 buttons & with drawing some
lines in the OnPaint. when pressing one of the buttons causes other buttons to move with the CWnd::MoveWindow().
The buttons move as expected but the control flickers and
trumbles while moving the button.
why is that and how can i correct it ???
Question by:sector
  • 3
LVL 23

Accepted Solution

chensu earned 60 total points
ID: 1318370
Apply the WS_CLIPCHILDREN style to your control window (the parent window of the buttons).
LVL 23

Expert Comment

ID: 1318371
This is because when the button is moved, the parent window gets a WM_PAINT message, which causes the parent window to redraw, it clears the buttons, then the buttons are put back. Thus, you see it flicker.

Expert Comment

ID: 1318372
The window flickering because it is slow to draw graph in Windows. Windows do not have direct access to the memory cells corresponding to the onscreen pixels, it processes the drawing statement through many layers of sofware. This process takes a long time time and results in the flickering.
Microsoft release the WinG library to help developing fast graphics operations with windows. It can be realized through a WinG OLE control.
LVL 23

Expert Comment

ID: 1318373
Slow drawing does not cause flickering. Filickering is caused by drawing it, clearing it and drawing it again.

WinG is obsolete. Use DirectX if you want fast graphics operations.

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question