Thread: Wm_moving...

  1. #1
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,227

    Question Wm_moving...

    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?

  2. #2
    S­énior Member
    Join Date
    Jan 2002
    Posts
    982
    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.

  3. #3
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,227
    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:

    Code:
    	case WM_SYSCOMMAND:
    		if(wParam == SC_MOVE)
    			break;
    		return 0;
    Last edited by -KEN-; 01-27-2002 at 05:08 PM.

  4. #4
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    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.

  5. #5
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,227
    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.

Popular pages Recent additions subscribe to a feed