Click to See Complete Forum and Search --> : Wm_paint, Must It Be Handled??
AAG
Sep 26th, 2001, 03:59 PM
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
Zaei
Sep 26th, 2001, 04:24 PM
You MUST handle WM_PAINT with at least ValidateRect(), or the window will continue to recieve WM_PAINT messages. This may solve your problem.
case WM_PAINT:
ValidateRect(hWnd, NULL);
return 0;
Z.
AAG
Sep 26th, 2001, 04:40 PM
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
AAG
Sep 26th, 2001, 05:11 PM
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
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.