Fwd: Foobar2000 audio player Regression

Nick Hornback vidar268 at yahoo.com
Mon Jan 10 17:20:02 CST 2005


> I took a quick look at it, but I came up against a
> number of problems:
> 1. The application seems to be half open-source, but
> the user interface 
> doesn't seem to in the half that is opened.
> 2. I assume patch linked to above is correct, but
> the app isn't calling 
> BeginPaint, which it should.
> 3. The app uses MFC and BeginPaint should probably
> be called by one of 
> the MFC base classes, but tracing code paths through
> MFC takes ages.
> 
> If you can get the programmer who wrote the
> application to reduce the 
> problem down to a simple test case with source, I
> might have some more 
> luck. Otherwise, I don't have the time to
> investigate it.
> 
> Rob
> 

I just mentioned the problem on foobars irc channel,
and someone posted some sample WM_PAINT code that I
believe is what you might have been looking for
(BeginPaint isn't used anywhere). According to the
foobar devs, and I've heard this from previous threads
in the foobar forums when wine had issues with
repainting the playlist, is that BeginPaint is not
nessesary, and that seems to be a recuring problem
with wine.

Attached is the code that was posted in the irc
channel. I'm not enough of a dev to make sense of it,
but hopefully it'll help.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-------------- next part --------------
   case WM_PAINT:
    {
     struct
     {
      RECT rcPaint;
      HDC hdc;
     } ps;
     if (!GetUpdateRect(wnd,&ps.rcPaint,0))
      GetClientRect(wnd,&ps.rcPaint);
     ps.hdc = GetDC(wnd);
     
     int min,max;
     min = display_offset + (ps.rcPaint.top/item_height);
     max = display_offset + (ps.rcPaint.bottom/item_height) + 2;
     int n;
     if (max>get_count()) max = get_count();
     for(n=min;n<max;n++) repaint(n,ps.hdc,&ps.rcPaint);
     
     int blank_top = (get_count() - display_offset) * item_height;
     if (blank_top < ps.rcPaint.bottom)
     {
      RECT temp = ps.rcPaint;
      temp.top = blank_top;
      HBRUSH br = CreateSolidBrush(cfg_playlist_background);
      FillRect(ps.hdc,&temp,br);
      DeleteObject(br);
     }
     ReleaseDC(wnd,ps.hdc);
     ValidateRect(wnd,&ps.rcPaint);


More information about the wine-devel mailing list