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
Solved

Property Sheets

Posted on 1997-07-10
12
417 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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

828 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