Resizable Side Window
Is there any way to create a child window that is resizable only on the right edge and covers up a part of the left side of the parent window? Similar to th开发者_如何转开发at of Firefox's History panel.
There is no way to do that in one strike AFAIK. However, you can create a child window as usual and use GetWindowRect()
to get dimensions of the bounding rectangle (in this case, we are interested in top, bottom, and right of RECT
structure); then intercept the WM_MOUSEMOVE
message and keep monitoring the current x & y mouse coordinate from lParam
parameter;
If current mouse position is at the right side of the window box, call LoadCursor()
or LoadImage()
to set the cursor shape to IDC_SIZEWE
; then use SetCapture()
and ReleaseCapture()
to listen to drag-drop mouse event, and use SetWindowPos()
to set new size of the window.
精彩评论