Sign in to follow this  

WM_PAINT

This topic is 4196 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Quote:
Original post by derek7
class Cmydialog :public CDialog
{
OnInitDialog()
{
................
SendMessage(WM_PAINT);which will call OnPaint()
UpdateWindow();//which will call nothing; why???

//
}

};


You don't send WM_PAINT messages. Rather, what you want to do, is invalidate the rectangle of the window you want redrawn (in this case, the dialog), to force a redraw.

Share this post


Link to post
Share on other sites
Not too sure about MFC but Win32 API UpdateWindow will sent an WM_PAINT message to the window only if the window's update region is not empty so I guess if you call UpdateWindow directly after sending the window WM_PAINT, there is nothing to update so nothing happens.

[EDIT: Too slow. Nyteguard made more sense anyway]

Share this post


Link to post
Share on other sites
You want to look at InvalidateRect (That's the Win32 version, the MFC version is almost identical. And as others have said, you don't want to send WM_PAINT directly, Windows will do that for you when it needs updated.

If you just call InvalidateRect(), windows will queue up a WM_PAINT message. If you need it updated immediately, you can use UpdateWindow().

Share this post


Link to post
Share on other sites
a idea just jump out of my mind.

record the register (I remember some register push function name and function parameter before call function)and translate it to symbol(function name).

does it work?

Share this post


Link to post
Share on other sites
Quote:
Original post by derek7
a idea just jump out of my mind.

record the register (I remember some register push function name and function parameter before call function)and translate it to symbol(function name).

does it work?
For what function? You won't be able to get the address of a function and get a name for it (not easily anyway).

And why on earth would you want to though? MFC is designed so you don't have to do things like this...

Share this post


Link to post
Share on other sites
Quote:
Original post by Evil Steve
Quote:
Original post by derek7
a idea just jump out of my mind.

record the register (I remember some register push function name and function parameter before call function)and translate it to symbol(function name).

does it work?
For what function? You won't be able to get the address of a function and get a name for it (not easily anyway).

And why on earth would you want to though? MFC is designed so you don't have to do things like this...



make a mistake. should the link

Share this post


Link to post
Share on other sites

This topic is 4196 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this