Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

This stupid sizebox in the bottom-right

Posted on 1997-09-10
7
Medium Priority
?
299 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
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 course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…

704 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