Thread: Unable to lock Dialog

  1. #1
    Registered User
    Join Date
    May 2003

    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
    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
    near a computer
    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.

    case  WM_MOVING:
    ((RECT*) lParam)->left= rScreenRect.left;
    ((RECT*) lParam)->right= rScreenRect.right;
    ((RECT*) lParam)->top=;
    ((RECT*) lParam)->bottom= rScreenRect.bottom;
    "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
    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, 02: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