Click here to Skip to main content
16,011,374 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to parse an HTML-like file?? Pin
Paolo Ponzano17-Jul-04 2:37
Paolo Ponzano17-Jul-04 2:37 
AnswerRe: How to parse an HTML-like file?? Pin
Johan Rosengren17-Jul-04 2:49
Johan Rosengren17-Jul-04 2:49 
AnswerRe: How to parse an HTML-like file?? Pin
Ravi Bhavnani17-Jul-04 5:19
professionalRavi Bhavnani17-Jul-04 5:19 
AnswerRe: How to parse an HTML-like file?? Pin
Jörgen Sigvardsson17-Jul-04 13:27
Jörgen Sigvardsson17-Jul-04 13:27 
GeneralSibling Property Pages: passing a variables value between Pin
Loosehead Len17-Jul-04 0:04
Loosehead Len17-Jul-04 0:04 
GeneralRe: Sibling Property Pages: passing a variables value between Pin
PJ Arends17-Jul-04 8:56
professionalPJ Arends17-Jul-04 8:56 
GeneralRe: Sibling Property Pages: passing a variables value between Pin
ColinDavies17-Jul-04 11:45
ColinDavies17-Jul-04 11:45 
GeneralRe: Sibling Property Pages: passing a variables value between Pin
PJ Arends17-Jul-04 14:56
professionalPJ Arends17-Jul-04 14:56 
It's not all that difficult really. I figured it out by stepping through the MFC source code.

The first step is to look at the CPropertyPage::QuerySiblings function
LRESULT CPropertyPage::QuerySiblings(WPARAM wParam, LPARAM lParam)
{
    ASSERT(::IsWindow(m_hWnd));
    ASSERT(GetParent() != NULL);
 
    return GetParent()->SendMessage(PSM_QUERYSIBLINGS, wParam, lParam);
}
You will see all it does is sends a PSM_QUERYSIBLINGS message to the parent CPropertySheet. The property sheet's default behaviour is to relay the PSM_QUERYSIBLINGS message to all of it's child pages. So for each page you would set up a message map entry to catch the PSM_QUERYSIBLINGS message, and add the function to handle it.
BEGIN_MESSAGE_MAP(CMyPropertyPage, CPropertyPage)
    ON_MESSAGE(PSM_QUERYSIBLINGS, OnQuerySiblings)
END_MESSAGE_MAP()

...

LRESULT CMyPropertyPage::OnQuerySiblings(WPARAM wParam, LPARAM lParam)
{
    // Do whatever you want done here. The wParam and lParam
    // parameters will have the values you specified in the
    // call to CPropertyPage::QuerySiblings()
 
    return 0; // returning anything but 0 stops the PSM_QUERYSIBLINGS message
              // from being sent to any more pages.
}
If you want the property sheet to handle the message, you would set up the sheet's message map to also catch the PSM_QUERYSIBLINGS message. Just be sure to call Default() so that the default handler gets called.
LRESULT CMyPropertySheet::OnQuerySiblings(WPARAM wParam, LPARAM lParam)
{
    // Do what ever you want on the property sheet when the PSM_QUERYSIBLINGS
    // message is being handled. The wParam and lParam parameters will have
    // the values you specified in the call to CPropertyPage::QuerySiblings()
 
    return Default();
}
If you want to change the wParam and lParam values when your sheet handles the message, and pass the changed values onto the property pages, you will have to send the PSM_QUERYSIBLINGS message to each window yourself.
LRESULT CMyPropertySheet::OnQuerySiblings(WPARAM wParam, LPARAM lParam)
{
    // change the wParam and/or lParam values
 
    int nPages = GetPageCount();
    LRESULT result = 0;
    for (int page = 0; page < nPages, result == 0; ++page)
        result = GetPage(page)->SendMessage(PSM_QUERYSIBLINGS, wParam, lParam);
 
    return result;
}









"You're obviously a superstar." - Christian Graus about me - 12 Feb '03

"Obviously ???  You're definitely a superstar!!!" mYkel - 21 Jun '04

Within you lies the power for good - Use it!
GeneralRe: Sibling Property Pages: passing a variables value between Pin
ColinDavies17-Jul-04 15:30
ColinDavies17-Jul-04 15:30 
GeneralRe: Sibling Property Pages: passing a variables value between Pin
PJ Arends17-Jul-04 19:52
professionalPJ Arends17-Jul-04 19:52 
GeneralRe: Sibling Property Pages: passing a variables value between Pin
ColinDavies17-Jul-04 20:40
ColinDavies17-Jul-04 20:40 
GeneralRe: Sibling Property Pages: passing a variables value between Pin
ColinDavies17-Jul-04 20:19
ColinDavies17-Jul-04 20:19 
Generalcreating accounts using MAPI Pin
kanetheterrible116-Jul-04 22:35
kanetheterrible116-Jul-04 22:35 
GeneralDrawing a Window Frame Pin
0v3rloader16-Jul-04 22:17
0v3rloader16-Jul-04 22:17 
GeneralRe: Drawing a Window Frame Pin
GermanGeorge19-Jul-04 21:51
GermanGeorge19-Jul-04 21:51 
GeneralRe: Drawing a Window Frame Pin
0v3rloader19-Jul-04 22:43
0v3rloader19-Jul-04 22:43 
GeneralRe: Drawing a Window Frame Pin
GermanGeorge19-Jul-04 23:35
GermanGeorge19-Jul-04 23:35 
GeneralInstances Pin
smack_2k216-Jul-04 21:50
smack_2k216-Jul-04 21:50 
GeneralRe: Instances Pin
Ravi Bhavnani17-Jul-04 4:12
professionalRavi Bhavnani17-Jul-04 4:12 
GeneralMultiple windows Pin
smack_2k216-Jul-04 21:10
smack_2k216-Jul-04 21:10 
GeneralRe: Multiple windows Pin
Johan Rosengren16-Jul-04 22:43
Johan Rosengren16-Jul-04 22:43 
GeneralRe: Multiple windows Pin
smack_2k217-Jul-04 2:12
smack_2k217-Jul-04 2:12 
GeneralRe: Multiple windows Pin
Johan Rosengren17-Jul-04 2:44
Johan Rosengren17-Jul-04 2:44 
GeneralI need help Pin
Filomela16-Jul-04 21:08
Filomela16-Jul-04 21:08 
Questionhow can i create setup in vc++ Pin
mvnevis16-Jul-04 20:04
mvnevis16-Jul-04 20:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.