Is there a function called after the OnInitDialog function in MFC?

I want to create a stream after creating a dialog box in MFC. Is there any function that Windows has provided and is called automatically after OnInitDialog so that I can create a thread in it?

+7
source share
3 answers

You can simply create your stream in the OnInitDialog function. There is no reason for an excessive compromise by going over and looking for another function or dividing the initialization code in two. (There is also no such function, because there is no corresponding Windows message that is sent.)

If you want to get your dialog box on screen before creating the stream, you can simply show it manually using the ShowWindow function . For example:

 ShowWindow(SW_SHOW); RedrawWindow(); 

Also see this post by Raymond Chen: Waiting for a dialog box to appear before doing something.

+16
source

OnInitDialog() - the main function that is called during initialization (in response to WM_CREATE ).

Why can't you create your stream there?

0
source

I changed the priority of the thread below normal, and when the thread is executed for the first time, I set the thread to normal mode. It works great. Thanks for your reply.

0
source

All Articles