Thread: Win32 PONG problem!

  1. #1
    Programming is fun, mkay?
    Join Date
    Oct 2001
    Posts
    490

    Question Win32 PONG problem!

    OK, I am doing a Windows PONG and I have a problem. I need to make 2 diff. colored buttons. When I send the WM_PAINT message, my program won't draw the ball. What do I do?


    [EDIT] = REQUESTED CODE:

    case WM_PAINT:
    HDC r;
    RECT rr;
    r = GetDC (red);
    GetClientRect(red, &rr);

    FillRect (r, &rr, CreateSolidBrush (RGB (255, 0, 0) ));

    ReleaseDC(red, r);
    break;

    [/EDIT]
    Last edited by SyntaxBubble; 03-10-2002 at 04:47 PM.
    Website(s): http://www16.brinkster.com/trifaze/

    E-mail: [email protected]

    ---------------------------------
    C++ Environment: MSVC++ 6.0; Dev-C++ 4.0/4.1
    DirectX Version: 9.0b
    DX SDK: DirectX 8.1 SDK

  2. #2
    Registered User
    Join Date
    Dec 2001
    Posts
    421
    you're just refilling the screen with red aren't you? how about you redraw the ball aswell?

    by the way, you should use BeginPaint and EndPaint when handling the WM_PAINT message.. not GetDC and ReleaseDC

    U.
    Quidquid latine dictum sit, altum sonatur.
    Whatever is said in Latin sounds profound.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 5
    Last Post: 11-07-2005, 11:34 PM
  2. searching problem
    By DaMenge in forum C Programming
    Replies: 9
    Last Post: 09-12-2005, 01:04 AM
  3. Bin packing problem....
    By 81N4RY_DR460N in forum C++ Programming
    Replies: 0
    Last Post: 08-01-2005, 05:20 AM
  4. half ADT (nested struct) problem...
    By CyC|OpS in forum C Programming
    Replies: 1
    Last Post: 10-26-2002, 08:37 AM
  5. binary tree problem - help needed
    By sanju in forum C Programming
    Replies: 4
    Last Post: 10-16-2002, 05:18 AM