Solved

This stupid sizebox in the bottom-right

Posted on 1997-09-10
7
273 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
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…
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …

914 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

19 Experts available now in Live!

Get 1:1 Help Now