Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

This stupid sizebox in the bottom-right

Posted on 1997-09-10
7
Medium Priority
?
307 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 200 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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
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…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

971 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