Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Property Sheets

Posted on 1997-07-10
12
Medium Priority
?
423 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
[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
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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
 
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 150 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

722 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