If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Re: Auto. start function after cdialog was shown?

Hello,

the problem is not the function.
The problem is that I want to call it immediately after the dialog is shown.
But I can not call the function from OnInitDialog, because in this case, the function is called before the dialog is shown.
It is necessary, that OnInitDialog returns!

Is there a function that is called by the system when the dialog was shown?

Re: Auto. start function after cdialog was shown?

OK, there is a well known trick to implement such a behaviour: PostMessage a user defined message (from WM_APP range or a registered message) from OnInitDialog to the dialog itself.
Then in the message handler of this message call your function (or start a thread...)

Re: Auto. start function after cdialog was shown?

Hello Victor,

I have not tried it, but isn't there a problem:
WM_PAINT for the dialog will only processed when there is no other message in the message queue (says msdn).
But when I post my message, it will be processed first. WM_PAINT (drawing the dialog) will processed after my function is executed. But that behaviour is bad for my app.