I'm trying to get a child window not to move...I've tried trapping the WM_MOVING message, but just returning 0 doesn't seem to want to work. I've stopped it from moving once, but It used a messagebox each time. That's just way too retarted and sloppy for me...anyone know how to get my window not to move?
You could trap the WM_SYSCOMMAND message. The WPARAM will be SC_MOVE if something/someone is trying to move the window. You'll have to make sure you send all the other WM_SYSCOMMAND's to DefWndProc(), otherwise you'll loose alot of in-built functionality.
Well, I doubt I'll miss the built-in functionality any, seeing as I'm basically trying to get this window as static as possible. In the end it'll pretty much only be able to resize. Thanks, though.
Damn, it stops resizing...I guess I'll just have to do that manually...Unless you know a better way, right now I'm using:
if(wParam == SC_MOVE)
i'm not too sure what you are asking ie preventing a child wnd from moving (but trapping WM_SYSCOMMAND)?
But since the WM_SYSCOMMAND seems to be doing more or less what you need, then you should follow Sorensen's advice about sending all other SYSCOMMAND flags to DefWindowProc for default handling. The flag that triggers (or recognises) wnd movement is SC_MOVE, so if you want it to move then you should send at least this one to the system for default handling.
Hope that helps some.
Well actually I think handling WM_SYSCOMMAND worked perfectly (disabled things I was going to have to worry about later on) so no worries...I figured out the sizing thing anyhow. Thanks anyway.