Solved

How to remove title bar of a window through code?

Posted on 2002-07-05
2
300 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
ID: 7131646
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
ID: 7136826
Thanks migel that solved my problem. It workd fine.
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

Suggested Solutions

Title # Comments Views Activity
substring method in java 1 98
twoTwo  challenge 35 93
matchUp  challenge 9 94
Remove Password Protection from pdf (with password) using an command line executable 5 30
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
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.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

920 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

16 Experts available now in Live!

Get 1:1 Help Now