For the first time I'm trying to make a control that a user can resize by dragging the corners.
Problem is that if I have 2 of the controls on my dialog.
If I drag one of the corners to resize one control and have it supposedly cover part of the other control sometimes the resized control appears on top and sometimes it appears underneath the other.
I know, I didn't post any code.
Is there, again, some nudge you can give me to tell me where to look?
In my handler I have: case WM_ERASEBKGND
return 0
case WM_SETFOCUS
TLMSendWM_NOTIFY(hWnd, NM_SETFOCUS)
return 0
case WM_KILLFOCUS
TLMSendWM_NOTIFY(hWnd, NM_KILLFOCUS)
return 0
besides the CREATE, PAINT, and DESTROY sections.
Larry
Tried creating controls with WS_CLIPCHILDREN and WS_CLIPSIBLINGS but no change.
This is how the control is registered: WNDCLASSEX wc
wc.cbSize = len(WNDCLASSEX)
wc.style = CS_GLOBALCLASS | CS_HREDRAW | CS_VREDRAW
wc.lpfnWndProc = &Graph1Proc_LM
wc.cbClsExtra = 0
wc.cbWndExtra = 0
wc.hInstance = _hinstance
wc.hIcon = NULL
wc.hCursor = LoadCursor(NULL, IDC_ARROW)
wc.hbrBackground = NULL
wc.lpszMenuName = NULL
wc.lpszClassName = "LM_Graph1_Class"
wc.hIconSm = NULL
Larry
Discovered that if I put cursor on the corner of either control and double left click while sizing arror is showing that it will make proper control appear on top. And that action is rock solid repeatable.
Larry
Windows controls are not meant to overlap. Many of them don't respect sibling controls (controls with the same parent). The only time you can really overlap a control is if it is a child of another control.
However if you are referring to your own home brewed controls then you'll need some more API knowledge. BringWindowToTop is one to study which will force a window (control) on top of all other windows (controls) at the same level. Meaning the same parent.
The default Z order, or default overlapping of windows, is determined by the order of creation. You can change the Z order with a few functions, like BringWindowToTop and SetWindowPos
Unlike a normal child window the clicking on a control doesn't meant it will come to the top of the Z order. You have to process the WM_LBUTTONDOWN message yourself and bring the control to the top of the Z order. Clicking on a non client area (like a title bar or border) will change the z order if your control has either.
And one final note. All of this knowledge is useless with stock Windows edit controls, which always draw their text canvas on top of everything with no respect for Z orders, children or siblings. ;)
Paul.
BringWindowToTop works like a champ!
QuoteAll of this knowledge is useless with stock Windows edit controls,
Since I'm creating my on custom control that isn't an issue for me; right?
Thanks for the help as always.
Larry