• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 171
  • Last Modified:

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
0
whluk
Asked:
whluk
  • 5
  • 3
1 Solution
 
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
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
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

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now