Solved

How to remove title bar of a window through code?

Posted on 2002-07-05
2
298 Views
Last Modified: 2013-11-20
I am developing an MDI application in Visual C++ 6.0 and I want to remove the title bar of the child windows. I am using CFormView as my View class. I have inserted a chart on the form and when I double click the form I want to hide the title of the window. Similarly when I double click the chart second time I want to show the title bar again.

I have tried ModifyStyle function but it doesnt work. Please help me out.
0
Comment
Question by:UsmanQ
2 Comments
 
LVL 12

Accepted Solution

by:
migel earned 100 total points
Comment Utility
Hi!
IMHO you try change style on the wrong window
here is example how to switch caption mode for MDI child window from the view:


void CMfcieView::OnHideCaption()
{
     // TODO: Add your command handler code here
     CFrameWnd* pFrame = GetParentFrame();
     if (pFrame)
          {
          DWORD dwStyle = pFrame->GetStyle();
          if (dwStyle & WS_CAPTION)
               pFrame->ModifyStyle(WS_CAPTION, 0, SWP_DRAWFRAME);
          else
               pFrame->ModifyStyle(0, WS_CAPTION, SWP_DRAWFRAME);
          }
}
0
 

Author Comment

by:UsmanQ
Comment Utility
Thanks migel that solved my problem. It workd fine.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

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

18 Experts available now in Live!

Get 1:1 Help Now