Hi!

1) I'd like to achieve an effect know from resource editor: you click LMB, drag (rectangle is displaying) and you release LMB - new control appears. The problem is with refreshing rectangle while moving mouse - I use InvalidateRect at WM_MOUSEMOVE but rectangle is almost invisible (blinking too fast). How to erase previous rectangle to avoid this problem?

2) Where is the best place to handle child messages: in the parent (owner) window procedure or in the subclassed child procedure? I create dynamically some controls (buttons, editboxes etc.) and I want to select them, move, change size etc.

Thanks for any help!
Posted on 2004-04-12 18:19:42 by Deli
1) use the DrawFocusRect function. It uses an XOR pen to draw so if you draw once on a window it will draw the rect, if you draw the same rect a second time it will erase it.

2) It depepnds on what you want to do. Generally it is faster and easier to handle them in the parent procedure but some things (depending on the control) have to be done in a subclass.

Note: that you can just give the control a WS_THICKFRAME style to have them resizable.
Posted on 2004-04-12 19:24:20 by donkey