Solved

How to stop a CWnd flickers & tramble

Posted on 1998-06-24
4
356 Views
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 ???
0
Comment
Question by:sector
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 23

Accepted Solution

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

Expert Comment

by:chensu
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.
0
 
LVL 8

Expert Comment

by:trestan
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.
0
 
LVL 23

Expert Comment

by:chensu
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.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

695 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