Solved

How to make resizable PropertySheet?

Posted on 1998-10-27
2
245 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

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

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.  …
This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
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…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

863 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

20 Experts available now in Live!

Get 1:1 Help Now