Invoke WM_NCPAINT
-
Hi, I have a List control and I have to change the border color of it dynamically such as, on mouse hover, on focus etc. So I handled the WM_NCPAINT and draw the border with my own color. But when I have to change the color, how will I invoke the WM_NCPAINT. Can I send that message directly? Or is there any other functions that invokes this message indireclty? N.B - I need to paint only the non client area. Thanks Naveen [OpenedFileFinder]
-
Hi, I have a List control and I have to change the border color of it dynamically such as, on mouse hover, on focus etc. So I handled the WM_NCPAINT and draw the border with my own color. But when I have to change the color, how will I invoke the WM_NCPAINT. Can I send that message directly? Or is there any other functions that invokes this message indireclty? N.B - I need to paint only the non client area. Thanks Naveen [OpenedFileFinder]
If you're using MFC try something like this:
m_ctl.RedrawWindow(NULL, NULL, RDW_ERASE|RDW_FRAME|RDW_INVALIDATE|RDW_UPDATENOW);
For raw Win32:
RedrawWindow(m_hWnd, NULL, NULL, RDW_ERASE|RDW_FRAME|RDW_INVALIDATE|RDW_UPDATENOW);
Steve
-
Hi, I have a List control and I have to change the border color of it dynamically such as, on mouse hover, on focus etc. So I handled the WM_NCPAINT and draw the border with my own color. But when I have to change the color, how will I invoke the WM_NCPAINT. Can I send that message directly? Or is there any other functions that invokes this message indireclty? N.B - I need to paint only the non client area. Thanks Naveen [OpenedFileFinder]
Naveen.R wrote:
Can I send that message directly? Or is there any other functions that invokes this message indireclty?
Call
SetWindowPos
withSWP_DRAWFRAME
.
Nibu thomas A Developer Code must be written to be read, not by the compiler, but by another human being. http:\\nibuthomas.wordpress.com
-
If you're using MFC try something like this:
m_ctl.RedrawWindow(NULL, NULL, RDW_ERASE|RDW_FRAME|RDW_INVALIDATE|RDW_UPDATENOW);
For raw Win32:
RedrawWindow(m_hWnd, NULL, NULL, RDW_ERASE|RDW_FRAME|RDW_INVALIDATE|RDW_UPDATENOW);
Steve
But in this case paint message is also generated. I want to invoke only the WM_NCPAINT message.
nave [OpenedFileFinder]
-
Naveen.R wrote:
Can I send that message directly? Or is there any other functions that invokes this message indireclty?
Call
SetWindowPos
withSWP_DRAWFRAME
.
Nibu thomas A Developer Code must be written to be read, not by the compiler, but by another human being. http:\\nibuthomas.wordpress.com
Thanks Nibu. It worked.
nave [OpenedFileFinder]