Thread: wM_SIZING

  1. #1
    the Great ElastoManiac's Avatar
    Join Date
    Nov 2005
    Location
    Republika Srpska - Balkan
    Posts
    377

    Question wM_SIZING

    WM_SIZING isn't working for me. For some reason i don't recive it while
    the window is being resized. I recive it after the drag is released, just like WM_SIZE.
    I really have no idea, why this is happening.

    I need to use this in order to limit how much can a user resize my window,
    other solutions would be welcome too.

    Quote Originally Posted by MSDN
    The WM_SIZING message is sent to a window that the user is resizing. By processing this message, an application
    can monitor the size and position of the drag rectangle and, if needed, change its size or position.

    A window receives this message through its WindowProc function.


    WM_SIZING

    WPARAM wParam
    LPARAM lParam;
    wParam
    Specifies which edge of the window is being sized. This parameter can be one of the following values.
    WMSZ_BOTTOM - Bottom edge
    WMSZ_BOTTOMLEFT - Bottom-left corner
    WMSZ_BOTTOMRIGHT - Bottom-right corner
    WMSZ_LEFT - Left edge
    WMSZ_RIGHT - Right edge
    WMSZ_TOP - Top edge
    WMSZ_TOPLEFT - Top-left corner
    WMSZ_TOPRIGHT - Top-right corner
    lParam
    Pointer to a RECT structure with the screen coordinates of the drag rectangle. To change the size or position of
    the drag rectangle, an application must change the members of this structure.
    lu lu lu I've got some apples lu lu lu You've got some too lu lu lu Let's make some applesauce Take off our clothes and lu lu lu

  2. #2
    Registered User mrafcho001's Avatar
    Join Date
    Jan 2005
    Posts
    483
    WM_SIZE should be send while the window is being dragged.

    At it least it does that for me.

    WM_SIZING also works just fine.
    My Website
    010000110010101100101011
    Add Color To Your Code!

  3. #3
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    >>I need to use this in order to limit how much can a user resize my window<<

    Perhaps WM_GETMINMAXINFO would be more appropriate for this.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  4. #4
    the Great ElastoManiac's Avatar
    Join Date
    Nov 2005
    Location
    Republika Srpska - Balkan
    Posts
    377
    I don't know how to use it, can you post an example?
    There must be a normal & easy way to limit the resizing...
    lu lu lu I've got some apples lu lu lu You've got some too lu lu lu Let's make some applesauce Take off our clothes and lu lu lu

  5. #5
    Registered User r1ck0r's Avatar
    Join Date
    Apr 2005
    Location
    UK
    Posts
    30
    I just whipped this up in the reply field, untested.
    Code:
    WM_GETMINMAXINFO:
    {
    	MINMAXINFO * mmiStruct = (MINMAXINFO*)lParam;
    
    	POINT ptPoint;
    
    	ptPoint.x = 300;	//Minimum width of the window.
    	ptPoint.y = 300;	//Minimum height of the window.
    	mmiStruct->ptMinTrackSize = ptPoint;
    
    	ptPoint.x = GetSystemMetrics(SM_CXMAXIMIZED);	//Maximum width of the window.
    	ptPoint.y = GetSystemMetrics(SM_CYMAXIMIZED);	//Maximum height of the window.
    	mmiStruct->ptMaxTrackSize = ptPoint;
    
    	return 0;
    }

  6. #6
    Registered User xds4lx's Avatar
    Join Date
    Nov 2001
    Posts
    630
    To completly stop the user from resizing your window you can simply just use the dwStyles of WS_OVERLAPPED | WS_SYSMENU in the call to CreateWindowEx
    "only two things are infinite, the universe and human stupidity, and im not sure about the former." - albert einstein

  7. #7
    the Great ElastoManiac's Avatar
    Join Date
    Nov 2005
    Location
    Republika Srpska - Balkan
    Posts
    377
    Quote Originally Posted by r1ck0r
    I just whipped this up in the reply field, untested.
    Code:
    WM_GETMINMAXINFO:
    {
    	MINMAXINFO * mmiStruct = (MINMAXINFO*)lParam;
    
    	POINT ptPoint;
    
    	ptPoint.x = 300;	//Minimum width of the window.
    	ptPoint.y = 300;	//Minimum height of the window.
    	mmiStruct->ptMinTrackSize = ptPoint;
    
    	ptPoint.x = GetSystemMetrics(SM_CXMAXIMIZED);	//Maximum width of the window.
    	ptPoint.y = GetSystemMetrics(SM_CYMAXIMIZED);	//Maximum height of the window.
    	mmiStruct->ptMaxTrackSize = ptPoint;
    
    	return 0;
    }
    It Works, Thanks!!!!!!
    lu lu lu I've got some apples lu lu lu You've got some too lu lu lu Let's make some applesauce Take off our clothes and lu lu lu

Popular pages Recent additions subscribe to a feed