Solved

xp-style manifest and HBITMAP 'flickering' (vc++ 6)

Posted on 2006-07-20
5
363 Views
Last Modified: 2008-01-09
hi, i'm new here. hope someone can help.

i'm using vc++ 6 for lots of projects.. mostly dialog based tools and apps.

a problem i've had for a long time is, if i add an xp-style 'manifest' sheet for my dialog controls, the app displays the new style controls ok, but my bitmaps are 'flickering' whenever i use redrawwindow(). yet if i remove the xp style again, the problem doesn't occur.

the problem is happening with applications that use HBITMAP handles that are redrawn around every 1/25th of a second with a timer.. for special effects, etc.

the flickering looks like interlaced frames.. making large parts of the bitmap 'transparent'

like i say.. there's no problem without the xp-style manifest.. so what's causing it?

regards
0
Comment
Question by:snyp
  • 4
5 Comments
 
LVL 2

Author Comment

by:snyp
ID: 17164114
i can't believe noone else has had this and/or noone can be bothered to answer =(
0
 
LVL 5

Accepted Solution

by:
mico20 earned 145 total points
ID: 17169239
try catching wm_erazebkgnd (or wm_erasebackground) message and mark it as processed - this might work
0
 
LVL 2

Author Comment

by:snyp
ID: 17173267
thanks for your suggestion mico20..

i tried to derive a class from CStatic and override the WM_ERASEBKGND message;

BOOL CAnimStatic::OnEraseBkgnd(CDC* pDC)
{
      return TRUE;
}

but it made no difference..

if it makes things any clearer.. a typical example of how the bitmaps are handled and drawn is;

--------------------------
OnInitDialog() {

HBITMAP zoomBmp = m_zoom.GetBitmap(); // m_zoom being a CStatic member of the dialog class

}

..

unsigned long zoomArrray[ZOOM_X * ZOOM_Y];

someTimerFunction(HBITMAP *hBmp) {

specialFx(zoomArray);

SetBitmapBits(*hBmp, (ZOOM_X * ZOOM_Y * 4), zoomArray);
dlg.m_zoom.RedrawWindow();
}

-----------

still stuck with the problem.. it appears to be with redrawwindow().. any help appreciated

regards
0
 
LVL 2

Author Comment

by:snyp
ID: 17173634
mico20 you can have the points.

after too much messing around i decided to redo large chunks of code with a method i wanted to avoid, because of things i was doing with my DC in other places.

my two cents is, microsoft are disgustingly lax in their documentation of visual themes and the new xp shell.

link for anyone else having the same kinds of problems.

http://www.codeguru.com/Cpp/controls/controls/article.php/c2297/
0
 
LVL 2

Author Comment

by:snyp
ID: 17178458
also http://msdn.microsoft.com/library/en-us/dngdi/html/msdn_flicker.asp?frame=true

there's no support for the uxtheme interface, even with visual studio 6's most recent service pack (which is now quite unreasonably old).
quite bad.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
This article will show, step by step, how to integrate R code into a R Sweave document
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

932 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now