related to last question on buttons

Hi guys,
   I have a dialog based program which displays a message in a client window. And I use Classwizard to create a new class that is used to respond to WM_LBUTTONDOWN message to a button.
But when I clicked on the button,it didn't response... Why? I had added a messagebox statement in the brand new function... why? sob...

p.s. = c++ is very hard...:~(


Thanks
Jacky
whlukAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

whlukAuthor Commented:
I need to hand it in on 20th.. so guys
i really hassle...

Jacky
0
whlukAuthor Commented:
I have a query with dialog based application... I have to have 3 dialogs displayed in turn on the screen... the first dialog (the application itself)displays a message with a button in it. After the user clicks ok in the first dialog. I want to hide it or destroy it
,Then the second dialog appears for 5 seconds, and the third one appears for another 5 seconds... is there any better ways to do it? I don't know how to create message based application, there are only mdi ,sdi and dialog based application that can be chosen.
I just want to display three dialog box
with messages in them! pls help

Thanks
Jacky Luk
0
whlukAuthor Commented:
I have a query with dialog based application... I have to have 3 dialogs displayed in turn on the screen... the first dialog (the application itself)displays a message with a button in it. After the user clicks ok in the first dialog. I want to hide it or destroy it
,Then the second dialog appears for 5 seconds, and the third one appears for another 5 seconds... is there any better ways to do it? I don't know how to create message based application, there are only mdi ,sdi and dialog based application that can be chosen.
I just want to display three dialog box
with messages in them! pls help

Thanks
Jacky Luk
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

whlukAuthor Commented:
maybe how do i hide the main dialog and the second dialog and the third.

thx
Jacky Luk
0
whlukAuthor Commented:
maybe how do i hide the main dialog and the second dialog and the third.

thx
Jacky Luk
0
ZoppoCommented:
Hi whluk,

To your first question:
The WM_LBUTTONDOWN is only called for the window on which the mouse cursor is or for the window which has captured the mouse. So, when you click on the button of a dialog, the WM_LBUTTONDOWN is sent to the button, and not to the dialog. The button itself handles the message and sends a BN_CLICKED notification message to the parent dialog if needed. So you only have to add a notification message handler for the button via ClassWizard. To do so, select your dialog's class, then select the resource ID of the button in the 'Object ID's' list and doubleclick the 'BN_CLICKED' in the 'messages' list.


Two the second question:
You can just do something like this:

in the second and third dialog's OnInitDialog set a timer like this:
SetTimer( 1, 5000, NULL );

add a WM_TIMER message handler for both dialogs and in there call EndDialog( IDOK );


// in you main function, i.e. IninInstance
....
CDialog1 dlg1;
CDialog2 dlg2;
CDialog3 dlg3;

while ( IDOK == dlg1.DoModal() )
{
 dlg2.DoModal();
 dlg3.DoModal();
}
....

hope this helps,

ZOPPO
0
ToronadoCommented:
Hi whluk and zoppo,

Shall we switch to one of the two questions?
"related to last question on buttons" and " and "display a dialog box within a dialog application" are both from whluk and are dealing with the same subject.

Regards,
 Toronado

0
ZoppoCommented:
ok, no problem, I'll not post any stuff here related to the 'display dialogs ...' question.
But this question originally was about the WM_LBUTTONDOWN message problem...

ZOPPO
0
ZoppoCommented:
See my above comment     :)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C++

From novice to tech pro — start learning today.