Featured post
visual c++ - Problems with refreshing a draggable MFC window -
greetings.
i have make draggable mfc dialog window, has background - used that: http://www.codeproject.com/kb/graphics/picturewindow.aspx - , has several picturebox controls. have tried 2 approaches, , while work, have problems.
first approach "manual" - on lbuttondown message check if it;s on clean area of window, , set flag variable. on mousemove, flag checked , if it's set, movewindow function called, , then, invalidate(1). on lbuttonup, flag unset. approach works correctly , redraws needed, somehow slow - if i'm moving cursor fast, window falls behing , isn't dragged, cursor's not on window anymore.
the second approach "automatic" - call
defwindowproc(wm_syscommand, sc_move+2,makelparam(point.x,point.y));
on lbuttondown, , handles rest, it's quick , never fall behind, when drag on screen's edge ( part of window gets invisible), when drag back, controls invisible , not refreshed, background okay. suppose that's because invalidate() isn't called during movement way, call after calling defwindowproc() , so, refreshed when depress button.
what should improve either of solutions? need both fast , correct. may have not provided required information, i'll add need arise.
thanks in advance.
solved problem, modifying second way. added total redraw onpaint(), , rid of flicker, redraw durng dragging, using flag variable.
- Get link
- X
- Other Apps
Comments
Post a Comment