Solved

This stupid sizebox in the bottom-right

Posted on 1997-09-10
7
269 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now