|
PJ, I have seen this method alluded to several times, and have tried getting it to work unsucessfully as well. Most likely when I do get it working it will be one of those things where I'd go, "Is that all that had to be done!!!"
As Losehead said there have been numerous questions about this in the forum, so if you could put this matter to rest it would be great.
For me I can't see how to use the wParam and lParam at all.
Regardz
Colin J Davies
* WARNING * This could be addictive The minion's version of "Catch "
It's a real shame that people as stupid as you can work out how to use a computer. said by Christian Graus in the Soapbox
|
|
|
|
|
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)
{
return 0;
} 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)
{
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)
{
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!
|
|
|
|
|
|
Check out my latest article http://www.codeproject.com/useritems/Psm_QuerySiblings.asp[^]. It is my answer to your question in article format. Had to get my article count up some how
"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!
|
|
|
|
|
Thanks PJ, You are a top chap.
I'm sure there are plenty of other "tricks" you know like this that need documenting.
Sure some of them must seem simple to you now, however they will save a lot of other programmers a lot of time.
Regardz
Colin J Davies
* WARNING * This could be addictive The minion's version of "Catch "
It's a real shame that people as stupid as you can work out how to use a computer. said by Christian Graus in the Soapbox
|
|
|
|
|
|
hi !
One can create a profile quite easily by using MAPI. But how does he create an e-mail account inside the profile programatically , and also maybe set that account as the default one ? Any of you guys having any info on this ?
Thanks in advance
Kane
Some guys hack just to get themselves a girlfriend.what a pathetic reason , huh ?
|
|
|
|
|
Hi there,
Basically I have several modeless dialog boxes which need to have their title bars customly painted. This is due to the fact that I can't let the windows look inactive -- they must all appear to the user to be simultaneously active.
Anyway, because I couldn't find a better solution to solve this (OnNcActivate
seems to block messages from reaching the main frame window for some reason...), I was wondering if someone knows of an API method (or an example) which could allow me to draw the title bar (and perhaps the window frame if needsbe)? Something similar to DrawFrameControl , but for the window frame itself?
Thank you,
David
|
|
|
|
|
if i had to do this, i would fake the titlebar.
i would construct the dialogbox without a title and paint
the title myself.
you can construct the buttons also
then:
m_dialog1->writeMyTitel("Title 1");
m_dialog2->writeMyTitel("Title 2");
|
|
|
|
|
Hi, thanks for the reply.
GermanGeorge wrote:
i would construct the dialogbox without a title and paint
m_dialog1->writeMyTitel("Title 1");
Yeah, I understand, but is there any GDI method I could use to draw the window title? Something similar to DrawFrameControl which would make the window title look according to the user's installed Windows OS style? [I mean, under Windows '95 the windows look differently than they do in Windows XP]
Cheers,
David
|
|
|
|
|
you are right.
but, i found a solution to your problme (hopefully)
it works fine here.
in the header of the modeless dialog declare:
afx_msg BOOL OnNcActivate( BOOL bActive );
In the MassageMap of the dialog declare
ON_WM_NCACTIVATE()
add a method:
BOOL Dialog1::OnNcActivate (BOOL bActive)<br />
{<br />
return TRUE;<br />
}
that's it.
|
|
|
|
|
Do you know a good article about managing the instances of an application ?
|
|
|
|
|
|
How do i create a new window ina MFC dialog based app w/o using window wrapper class SDK way ?
|
|
|
|
|
::CreateWindow or ::CreateWindowEx .
|
|
|
|
|
Not SDK way ... with "Create" or "CreateEx" there is no way really ?
|
|
|
|
|
Now you leave me baffled. What is it that you want to do, not use SDK and not use any classes? As this is completely nonsensical, I guess you have to clarify the question a little.
|
|
|
|
|
When i close the app from where i copy image or text in my program the image or text is pasted once again .I noticed that the number returned by GetClipboardSequenceNumber is incremented by 2, but i don't understand why.Can anyone help me please?Thanks a lot.
|
|
|
|
|
hi,
i had created a project in vc++ using MFC Dialogbased Application.i want to create a setup file.plz help me.
Thank you.
|
|
|
|
|
just use ur executable file and support files to cereate ur setup
|
|
|
|
|
buddy
you can tru InstallShield or Any free Setup Creator you can find.try to find it on download.com
ok
-----------------------------
"I Think It will Work"
Formerly Known As "Alok The Programmer" at CP
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
There is an article on codeproject, i don't remember exactly the name, but you can search by install shield tutorial.
|
|
|
|
|
Thank u verymuch for ur help.
I saw that article it helped me a lot.
nevis
|
|
|
|
|
Hey.
I need a way to write a mouse program, to control a mouse curser; without going through the mouse port.
Do you know of such a program, or where to find info?
Thanks
Rusty
|
|
|
|
|
Use "Inno Setup", totally freeware program, search google for it.
|
|
|
|