Unable to lock Dialog

This is a discussion on Unable to lock Dialog within the Windows Programming forums, part of the Platform Specific Boards category; What would the best way to be to lock the dialog and or move it back to its original location ...

  1. #1
    Registered User
    Join Date
    May 2003
    Posts
    26

    Unable to lock Dialog

    What would the best way to be to lock the dialog and or move it back to its original location after it has been relocated with the mouse? Thanks

  2. #2
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,831
    When a user is actually moving a window, the OS sends your processing loop WM_MOVING messages and when the move is complete, a WM_MOVE message. You can process these yourself to do whatever you like.

    You can use MoveWindow() to move a window around.

    Users tend to move windows because they want to. Windows is designed like that. By changing the behaviour of your windows, your app will not feel like a proper Windows app. People don't like that. You should be really sure you need to do this before trying.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  3. #3
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,856
    I do some thing like this,

    When the Dlg is created I get the screen coods in a RECT (CRect ect)

    Then I stop the user being able to start to move it. By changing the move msg as it passes in the callback.

    Code:
    case  WM_MOVING:
    ((RECT*) lParam)->left= rScreenRect.left;
    ((RECT*) lParam)->right= rScreenRect.right;
    ((RECT*) lParam)->top= rScreenRect.top;
    ((RECT*) lParam)->bottom= rScreenRect.bottom;
    break;
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  4. #4
    Registered User
    Join Date
    May 2003
    Posts
    26
    I appreciate the feedback.

    Let me see what I can do with it. Thanks

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Atomic Operations
    By Elysia in forum Windows Programming
    Replies: 27
    Last Post: 03-27-2008, 02:38 AM
  2. Replies: 9
    Last Post: 02-13-2008, 01:59 PM
  3. make Child Dialog not Popup?
    By Zeusbwr in forum Windows Programming
    Replies: 5
    Last Post: 04-08-2005, 02:42 PM
  4. Getting the position of a dialog without parent on the screen
    By stormbringer in forum Windows Programming
    Replies: 1
    Last Post: 08-27-2003, 02:59 AM
  5. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21