Rob Roy
2008-06-13 02:11:01 UTC
I have a Win32 VC++ program with a MODAL DialogBox (i.e. using DialogBox()
function). I'm using VisualStudio 2005.
I cannot seem to get WM_PAINT messages in the DlgProc. I have tried to use
InvalidateRect, UpdateWindow, RedrawWindow, and nothing seems to allow the
WM_PAINT message to get to my DlgProc.
I want to change a bitmap (or even just draw a FrameRect around a bitmap) on
the dialog based on the selected value of a Radio Button. I can draw stuff
once a user clicks the Radio Button (using GetDC, etc). However, the initial
value of the radio button can be different based on a global variable. So,
the drawing needs to take place after the WM_INITDIALOG message, and before a
user clicks on a Radio Button.
If I understand correctly, I should be able to InvalidateRect at
WM_INITDIALOG time to cause WM_PAINT messages to come to the DlgProc after
the Dialog is visible so I can perform the drawing. But, this doesn't seem to
work to create the WM_PAINT message...and, I cannot get the WM_PAINT message
at ANY time no matter what I do.
Ideas?
Thanks,
Rob
function). I'm using VisualStudio 2005.
I cannot seem to get WM_PAINT messages in the DlgProc. I have tried to use
InvalidateRect, UpdateWindow, RedrawWindow, and nothing seems to allow the
WM_PAINT message to get to my DlgProc.
I want to change a bitmap (or even just draw a FrameRect around a bitmap) on
the dialog based on the selected value of a Radio Button. I can draw stuff
once a user clicks the Radio Button (using GetDC, etc). However, the initial
value of the radio button can be different based on a global variable. So,
the drawing needs to take place after the WM_INITDIALOG message, and before a
user clicks on a Radio Button.
If I understand correctly, I should be able to InvalidateRect at
WM_INITDIALOG time to cause WM_PAINT messages to come to the DlgProc after
the Dialog is visible so I can perform the drawing. But, this doesn't seem to
work to create the WM_PAINT message...and, I cannot get the WM_PAINT message
at ANY time no matter what I do.
Ideas?
Thanks,
Rob