Solved

How to make resizable PropertySheet?

Posted on 1998-10-27
2
243 Views
Last Modified: 2013-12-03
I'm using MFC, and trying to make a subclass of CPropertySheet that is resizable.  I've tried to override CWnd::PreCreateWindow(), but it isn't called.  I can catch WM_NCCREATE using the message map and OR in WS_THICKFRAME to the window style, but that seems to be ignored.  Does anyone know how to do this?
0
Comment
Question by:jlilley
2 Comments
 
LVL 10

Accepted Solution

by:
RONSLOW earned 300 total points
ID: 1415653
have a look at NSViews .. this is shareware.  It gives you resizable property sheets, dialogs, views etc.

Also look at www.codeguru.com

0
 

Author Comment

by:jlilley
ID: 1415654
Although I'm not using NSViews directly, their code contained the secret incantation I was looking for, which I append here for posterity.  Thanks NanoSoft!!!

int CNSFlexPropertySheet::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
   if (CPropertySheet::OnCreate(lpCreateStruct) == -1)
      return -1;

    LONG lSTYLE = GetWindowLong(m_hWnd,GWL_STYLE);
    LONG lEXSTYLE = GetWindowLong(m_hWnd,GWL_EXSTYLE);

    if ((lSTYLE & DS_MODALFRAME) == DS_MODALFRAME)
    {
        lSTYLE &= ~(LONG)DS_MODALFRAME;
        lSTYLE |= WS_THICKFRAME;
      SetWindowLong(m_hWnd,GWL_STYLE,lSTYLE);
    }

    if ((lEXSTYLE & WS_EX_DLGMODALFRAME) == WS_EX_DLGMODALFRAME)
    {
        lEXSTYLE &= ~(DWORD)WS_EX_DLGMODALFRAME;
      SetWindowLong(m_hWnd,GWL_EXSTYLE,lEXSTYLE);
    }
   else
   {
        lEXSTYLE |= (DWORD)WS_EX_CLIENTEDGE;
      SetWindowLong(m_hWnd,GWL_EXSTYLE,lEXSTYLE);
   }

   return 0;
}

0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

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…
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…
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 this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

708 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

13 Experts available now in Live!

Get 1:1 Help Now