Solved

This stupid sizebox in the bottom-right

Posted on 1997-09-10
7
281 Views
Last Modified: 2013-12-03
What I am doing is create a window that does not have any frame but has scrollbars.
This I can do but there is one small problem.
When both scrollbars appare there appares a resize button in the
bottom-right corner fo the window.  Now when I press this button
the program kind of stops.  ( I say kindof because it processes messages like WM_PAINT but no mouse messages.  I think this is because the button captures the mouse )
If I change my program and add the WM_THICKFRAME style when I create the window everything works fine.  But this is not what I want.

If you tell me how I can get this button to work without any frame
I will award you an A.
If you tell me how I can remove or dissable this button I will award
you B or C.

p.s. I also noticed that WS_THICKFRAME is the same as WS_SIZEBOX.
0
Comment
Question by:gvg
  • 4
  • 2
7 Comments
 
LVL 10

Expert Comment

by:RONSLOW
ID: 1406443
Can you sent me the code you have used so I can try it out please.

I am at mailto:Roger_Onslow@compsys.com.au

Thanks

0
 
LVL 1

Author Comment

by:gvg
ID: 1406444
If you have the MTMDI example that comes with MFC and change the Create function of CBouncWnd to look like the following code you will
see this problem.

BOOL            ret;
SCROLLINFO      si;

LPCTSTR lpszBounceClass =
      AfxRegisterWndClass(CS_HREDRAW | CS_VREDRAW,
      #ifdef _MAC
            LoadCursor(NULL, IDC_ARROW),
      #else
            LoadCursor(NULL, IDC_UPARROW),
      #endif
            (HBRUSH)(COLOR_WINDOW+1),
            NULL);

style |= WS_VSCROLL | WS_HSCROLL;

ret =  CWnd::Create(lpszBounceClass, szTitle, style, rect, parent,
            IDC_BOUNCE_WND);

si.fMask = SIF_ALL;
si.nMin = 0;
si.nMax = 10000;
si.nPage = 1000;
si.nPos = 0;
SetScrollInfo( SB_VERT, &si, TRUE );
SetScrollInfo( SB_HORZ, &si, TRUE );

return ret;
0
 
LVL 8

Accepted Solution

by:
gelbert earned 100 total points
ID: 1406445
You have set one of following styles and you have to get rid of it (if you using MFC in PreCreateWindow()):
                 SBS_SIZEGRIP
                 DFCS_SCROLLSIZEGRIP
                 DFCS_SCROLLSIZEGRIPRIGTH
or if you have this button on status bar then it is tyle SBARS_SIZEGRIP
0
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
LVL 1

Author Comment

by:gvg
ID: 1406446
PreCreateWindow( CREATESTRUCT& cs )
The createstruct is the only parameter here.  So where can I find
these styles in this function.

I also found out that if I create the window without WS_VSCROLL
and WS_HSCROLL I can still get scorllbars just by calling SetScrollInfo()
Isn't this odd?
0
 
LVL 1

Author Comment

by:gvg
ID: 1406447
PreCreateWindow( CREATESTRUCT& cs )
The createstruct is the only parameter here.  So where can I find
these styles in this function.

I also found out that if I create the window without WS_VSCROLL
and WS_HSCROLL I can still get scorllbars just by calling SetScrollInfo()
Isn't this odd?
0
 
LVL 8

Expert Comment

by:gelbert
ID: 1406448
You need to modify "style" member. check help for details

typedef struct tagCREATESTRUCT { // cs
    LPVOID    lpCreateParams;
    HINSTANCE hInstance;
    HMENU     hMenu;
    HWND      hwndParent;
    int       cy;
    int       cx;
    int       y;
    int       x;
    LONG      style;
    LPCTSTR   lpszName;
    LPCTSTR   lpszClass;
    DWORD     dwExStyle;
} CREATESTRUCT;
0
 
LVL 1

Author Comment

by:gvg
ID: 1406449
I found a diffrent solution to this problem so I will not be needing another.
I give you a C for the effort.

0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question