Disable resize events and window moves

This is a discussion on Disable resize events and window moves within the Windows Programming forums, part of the Platform Specific Boards category; How does one write an application so the user can not move the window (it is always centered in the ...

  1. #1
    Registered User
    Join Date
    Aug 2001
    Posts
    403

    Disable resize events and window moves

    How does one write an application so the user can not move the window (it is always centered in the screen, and it is not possible to resize the window)?

    I have my window being created in the correct position, but it is still possible to resize it, something which I would rather disallow.

  2. #2
    Registered User
    Join Date
    Jun 2002
    Posts
    14
    Create your Window with WS_OVERLAPPED to disallow it from being resized. As for disallowing your Window to be moved, you'd have to capture the WM_MOVE event and then use a function like SetWindowPos() to center the Window.
    Last edited by polo; 06-24-2002 at 10:08 AM.

  3. #3
    Registered User
    Join Date
    Aug 2001
    Posts
    403
    by the way, currently i am registering my window like this:

    Code:
    PHP Code:
    hWnd CreateWindow("GM_WINCLASS1"WindowTitle.c_str(), WS_SYSMENU WS_VISIBLE,          GetSystemMetrics(SM_CXSCREEN)/2-SWidth/2GetSystemMetrics(SM_CYSCREEN)/2-SHeight/2,    //position         SWidthSHeight,    //size         NULLNULLhInstNULL); 

  4. #4
    Registered User
    Join Date
    Aug 2001
    Posts
    403
    the only difference I see when i use WS_OVERLAPPED|WS_VISIBLE is that there is no system menu (minimize,maximize,close) i can still resize the window

  5. #5
    Registered User
    Join Date
    Aug 2001
    Posts
    403

    nevermind, the problem has to do with Direct X

    the problem is in DirectX.. I'll post a more specific direct x question in a more appropriate place

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. get keyboard and mouse events
    By ratte in forum Linux Programming
    Replies: 10
    Last Post: 11-17-2007, 05:42 PM
  2. Windows window is object orientated
    By subdene in forum Windows Programming
    Replies: 3
    Last Post: 05-15-2005, 07:02 PM
  3. input/output
    By dogbert234 in forum Windows Programming
    Replies: 11
    Last Post: 01-26-2005, 06:57 AM
  4. no errors but still errors
    By Megatron in forum Windows Programming
    Replies: 7
    Last Post: 01-12-2003, 11:21 PM
  5. g_hWndMain = hWnd;error C2065,C2440
    By Unregistered in forum C++ Programming
    Replies: 3
    Last Post: 12-09-2001, 03:36 PM

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