Results 1 to 4 of 4

Thread: Wm_paint, Must It Be Handled??

  1. #1

    Thread Starter
    Hyperactive Member AAG's Avatar
    Join Date
    Aug 2000
    Location
    United States
    Posts
    411

    Wm_paint, Must It Be Handled??

    I am currently attempting to skin my main window. I have created a function that checks the mouse pos coord. and if within a certain specified region it will do the coded task.. In this case would be to bitblt. I attempted to simply bitblt the picture to the form on the wm_lbuttondown message but the picture doesn't show up. I then put the exact same code in the WM_PAINT and the pic showed fine. What do i have to do to make the pic actually show up once i've bitblt it to the form on the wm_lbuttondown message ?? do i actually have to tell WM_PAINT what picture is showing and then act accordingly ?? or is there an easier way ?? I am not using any skinning controls nor will, i am using pure API to accomplish this so please don't give me code of MFC or tell me to use MFC, MFC is evil in my opinion.

    Thanx,
    AAG
    This Business Is Binary. Your a 1 or a 0. Alive or Dead. (AntiTrust)

  2. #2
    Zaei
    Guest
    You MUST handle WM_PAINT with at least ValidateRect(), or the window will continue to recieve WM_PAINT messages. This may solve your problem.
    Code:
    case WM_PAINT:
          ValidateRect(hWnd, NULL);
          return 0;
    Z.

  3. #3

    Thread Starter
    Hyperactive Member AAG's Avatar
    Join Date
    Aug 2000
    Location
    United States
    Posts
    411

    Ok That Worked :)

    ok now on my WM_BUTTONDOWN messages i can bitblt to the client area of my window and it stays there as i move my window around but once i minimize or move my window past the edge of my screen and the edge of the screen overlaps my blitted image it erases that part of the image thats been overlapped.. I know when i would skin in visual basic 6 u would need to turn on AutoRedraw.. is there a similar function in c++ ??

    Thanx

    AAG
    This Business Is Binary. Your a 1 or a 0. Alive or Dead. (AntiTrust)

  4. #4

    Thread Starter
    Hyperactive Member AAG's Avatar
    Join Date
    Aug 2000
    Location
    United States
    Posts
    411
    hehe actually i can just repaint the whole window as it should look when u first run the program because if someone is moving the window they can't be clicking a button, LOL so thanx for your input it works great

    laterz,
    AAG
    This Business Is Binary. Your a 1 or a 0. Alive or Dead. (AntiTrust)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width