Solved

Property Sheets

Posted on 1997-07-10
12
415 Views
Last Modified: 2006-11-17
First of all, I'm not using the MFC. Therefore please don't answer this question with MFC info.  I need to know how to get the ?(help) off the title bar of the dialog box. I've created an array PROPSHEETPAGE psp[7] and PROPSHEETHEADER psh and used the PropertySheet function.  The flags are     psp[0].dwFlags = PSP_USETITLE;
and
psh.dwFlags = PSH_PROPSHEETPAGE;

0
Comment
Question by:msherw
12 Comments
 
LVL 1

Expert Comment

by:TKII
ID: 1164727
The ? for the context help should be removed if you are deleting the WS_EX_CONTEXTHELP from your dialog resource in the resource file (maybe you have a resource editor to do that or simply use a text editor). If you create the dialog dynamically you should  change the style before creating the dialog, i.e. filter out the WS_EX_CONTEXTHELP from the extended styles.
0
 

Author Comment

by:msherw
ID: 1164728
I'm not creating the propertypage frame(which is where the ? actually is located) dialog, the function PropertySheet is, therefore I cannot filter-out the WS_EX_CONTEXTHELP style.
I have tried SetClassLong(hDlg,GCL_STYLE, DS_SYSMODAL | DS_3DLOOK | WS_CAPTION); in the WM_INITDIALOG of the starting page but that does not work either.

0
 
LVL 4

Expert Comment

by:md041797
ID: 1164729
If none of your pages have PSP_HASHELP in the PROPSHEETPAGE, the help button is invisible.  (If you don't set PSH_HASHELP in your PROPSHEETHEADER that is.)
0
 

Author Comment

by:msherw
ID: 1164730
PSH_HASHELP is not anywhere in my definition of my propertysheet  pages the only flag defined is psp[0].dwFlags = PSP_USETITLE;
and for the header  psh.dwFlags = PSH_PROPSHEETPAGE; but the ? is still there. I know, I can't figure it out either!!!!!!

0
 
LVL 1

Expert Comment

by:TKII
ID: 1164731
Check the flags in the debugger and send a little piece of code to us.
0
 

Author Comment

by:msherw
ID: 1164732
Here's the code that defines and creates the property sheet

int CreatePropertySheet(HWND hwndOwner)
{
    PROPSHEETPAGE psp[7];
    PROPSHEETHEADER psh;

    psp[0].dwSize = sizeof(PROPSHEETPAGE);
    psp[0].dwFlags = PSP_USETITLE;
    psp[0].hInstance = pShared->hInst;
    psp[0].pszTemplate = MAKEINTRESOURCE(IDD_VIPOPT);
    psp[0].pszIcon = NULL;
    psp[0].pfnDlgProc = (DLGPROC) VipOptions;
    psp[0].pszTitle = "Vip";
    psp[0].lParam = 0;

    psp[1].dwSize = sizeof(PROPSHEETPAGE);
    psp[1].dwFlags = PSP_USETITLE;
    psp[1].hInstance = pShared->hInst;
    psp[1].pszTemplate = MAKEINTRESOURCE(IDD_VIP_FONTS);
    psp[1].pszIcon = NULL;
    psp[1].pfnDlgProc = (DLGPROC) VipFontOptions;
    psp[1].pszTitle = "Menu and Help Fonts";
    psp[1].lParam = 0;
   
    psp[2].dwSize = sizeof(PROPSHEETPAGE);
    psp[2].dwFlags = PSP_USETITLE;
    psp[2].hInstance = pShared->hInst;
    psp[2].pszTemplate = MAKEINTRESOURCE(IDD_VIEW_COLORS);
    psp[2].pszIcon = NULL;
    psp[2].pfnDlgProc = (DLGPROC) VipViewOptions;
    psp[2].pszTitle = "View Font and Colors";
    psp[2].lParam = 0;

    psp[3].dwSize = sizeof(PROPSHEETPAGE);
    psp[3].dwFlags = PSP_USETITLE;
    psp[3].hInstance = pShared->hInst;
    psp[3].pszTemplate = MAKEINTRESOURCE(IDD_GENOPT);
    psp[3].pszIcon = NULL;
    psp[3].pfnDlgProc = (DLGPROC) GeneralOptions;
    psp[3].pszTitle = "General";
    psp[3].lParam = 0;

    psp[4].dwSize = sizeof(PROPSHEETPAGE);
    psp[4].dwFlags = PSP_USETITLE;
    psp[4].hInstance = pShared->hInst;
    psp[4].pszTemplate = MAKEINTRESOURCE(IDD_WSNMGR);
    psp[4].pszIcon = NULL;
    psp[4].pfnDlgProc = (DLGPROC) WSNMgrOptions;
    psp[4].pszTitle = "WorkStation Manager";
    psp[4].lParam = 0;

    psp[5].dwSize = sizeof(PROPSHEETPAGE);
    psp[5].dwFlags = PSP_USETITLE;
    psp[5].hInstance = pShared->hInst;
    psp[5].pszTemplate = MAKEINTRESOURCE(IDD_VEROPT);
    psp[5].pszIcon = NULL;
    psp[5].pfnDlgProc = (DLGPROC) VersionOptions;
    psp[5].pszTitle = "Version Manager";
    psp[5].lParam = 0;

    psp[6].dwSize = sizeof(PROPSHEETPAGE);
    psp[6].dwFlags = PSP_USETITLE;
    psp[6].hInstance = pShared->hInst;
    psp[6].pszTemplate = MAKEINTRESOURCE(IDD_TBREDOPT);
    psp[6].pszIcon = NULL;
    psp[6].pfnDlgProc = (DLGPROC) TBredOptions;
    psp[6].pszTitle = "TBredcom";
    psp[6].lParam = 0;

    psh.dwSize = sizeof(PROPSHEETHEADER);
    psh.dwFlags = PSH_PROPSHEETPAGE;
    psh.hwndParent = hwndOwner;
    psh.nStartPage = 0;
      psh.hInstance = pShared->hInst;
    psh.pszIcon = NULL;
      psh.pszCaption = NULL;
    psh.pszCaption = (LPSTR) "Thoroughbred Workstation Options";
    psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
    psh.ppsp = (LPCPROPSHEETPAGE) &psp;

    return (PropertySheet(&psh));
}


int DoOptionsTab(void)
{
      HWND hwndOptions;
    if (pShared->hwndMGR != NULL)
      {
            hwndOptions = FindWindow(NULL,"ThoroughBred Workstation Options");
        if (hwndOptions == NULL)
            {
            pShared->pCOptions = new COptions(pShared);
            pShared->pCOptions->DefWeb = pShared->pCOptions->OldDefWeb = -1;
            pShared->pCOptions->DefDsk = pShared->pCOptions->OldDefDsk = -1;
        pShared->pCOptions->GetVipOptions();
        pShared->pCOptions->GetVipFontOptions();
        pShared->pCOptions->GetVipViewOptions();
        pShared->pCOptions->GetWsnMgrOptions();
            pShared->pCOptions->GetVerOptions();
            pShared->pCOptions->GetTBredOptions();
            CreatePropertySheet(pShared->hwndMGR);
            };
      }
return (TRUE);
}

0
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.

 
LVL 1

Expert Comment

by:TKII
ID: 1164733
Check the 'more styles' page in the resource editor and disable the context help check box. If this isn't it I have no idea.
0
 

Author Comment

by:msherw
ID: 1164734
the parent dialog which is the property page frame is not defined in the resource editor, Sorry you could not help but it was a nice try.

0
 
LVL 1

Expert Comment

by:TKII
ID: 1164735
I meant the dialog resources for the tabpages.
0
 

Author Comment

by:msherw
ID: 1164736
I've already done everything possible to those pages. Context_help is not checked.
0
 
LVL 1

Accepted Solution

by:
kraken earned 50 total points
ID: 1164737
Without MFC, it's a little rough, but here goes.

You need to have the window created by PropertySheet (your property sheet frame) catch the WM_NCCREATE message.  This message is sent to windows that are about to be created, and gives you a chance to modify their styles AND EXTENDED styles.

The reason you couldn't affect it with SetClassLong() is that WM_EX_CONTEXTHELP is an extended style and SetClassLong() only deals with standard styles.

Your message handler will receive a pointer to a CREATESTRUCT structure in the lParam.  In this structure is a member called dwExStyle.  Remove the WM_EX_CONTEXTHELP style from this member using a bitwise AND, and make sure you return TRUE.  If you return FALSE, it will not create the window at all.

An example code snippet would be:

LRESULT NcCreateHandler( WPARAM wParam, LPARAM lParam )
{
   LPCREATESTRUCT lpcs = ( LPCREATESTRUCT )lParam;
   lpcs->dwExStyle &= ~WS_EX_CONTEXTHELP;
   return TRUE;
}

0
 

Author Comment

by:msherw
ID: 1164738
It seems the WM_NCCREATE message was not being sent. I was getting a WM_DESTROY, then A WM_CREATE. So I trapped the WM_CREATE and did a SETWINDOWLONG changing the EX style of the window and the ? went away Thanks kraken.

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

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

25 Experts available now in Live!

Get 1:1 Help Now