Hi All.

I have created a message box using Win32 API messageBox() function. Now I want to move a button on that message box a little higher. I'm trying to get that by the following code, but when executing the code only the button is moving, leaving its background in the same place (I've set the background color of the button different from the window background color):

CRect buttonRect(0,0,0,0);
button->GetWindowRect(buttonRect);
this->ScreenToClient(buttonRect);

buttonRect.OffsetRect(0, -10 );//move button up

button->MoveWindow(buttonRect);

Any ideas?
Thanks in advance.

Recommended Answers

All 3 Replies

maybe you need to force the message box to be repainted.

Dialog Boxes are easier to customize ;)

I am not sure that you can even customize messageboxes, why don't you try learning to program a "real" api program.
Here

//k0ns3rv

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.