Solved

How to make resizable PropertySheet?

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

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

617 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