
Dialog Based App Question
Hello,
To send a button click message, use this in the CDialog class
SendMessage(WM_COMMAND, MAKEWPARAM(IDC_BUTTON1, BN_CLICKED), (LPARAM)
GetDlgItem(IDC_BUTTON1)->GetSafeHwnd());
Hope this helps.
Regards,
Max
==========================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
|Newsgroups: microsoft.public.vc.mfc
|Subject: Re: Dialog Based App Question
|Thanks Douglas,
|
|But where do I get that message to post?
|
|I went looking for something in the Class Wizard and nothing looked
|familiar.
|
|Do you mean something like ON_BN_CICKED(id,memfxn) ?
|
|
|
|> In your OnInitDialog() function post the BN_CLICK message and let the
|> standard CDialog paint the dialog box, when it is done, you will get the
|> click message and all should work fine.
|>
|> > I have created the simplest Dialog Based App with Wizard.
|> >
|> > It has one control , a simple Button1 with it set to default. I would
|> like
|> > to have the screen painted as normal and start executing code in the
|> > OnButton1() function.
|> >
|> > Everything I try, executes the OnButton1 code, but does not draw my
main
|> > dialog screen first.
|> >
|> > Hummmmm, I'm sure there will be other questions but for now, I'm
|stumped.
|> >
|> > Thanks,
|> >
|> > --
|> > Fritz Switzer
|> >
|> >
|>
|>
|
|
|