Home > Software engineering >  For help, MFC modal dialog box a flash animation program
For help, MFC modal dialog box a flash animation program

Time:10-07

Click on the button on the function of the program is the modal dialog box, now run as a result, flash modal dialog box is hide behind the main dialog box, the main dialog also what all points not like feign death
 void CTraction: : OnBnClickedBtnCalc () 
{
//TODO: Add your the control notification handler code here
CCompensationChain DLG.
DLG. DoModal ();
}

Tried to put objects in the class definition, and in OnInitDialog () to add: : SetWindowPos (this - & gt; M_hWnd, HWND_TOPMOST, 1, 1, 1, 1, SWP_NOMOVE | SWP_NOSIZE); Function to use, a great god ~

CodePudding user response:

CCompensationChain onInitxxx function in this dialog box class, try to set the dialog to the top window.

CodePudding user response:

reference 1st floor xiaohuh421 response:
CCompensationChain onInitxxx function in this dialog box class, try to set the dialog to the top window.

Is still the same, run into this appearance,,

CodePudding user response:

You this is similar to TabCtrl function, the dialog style set to child, use the Create Create dialog box, not DoModal

CodePudding user response:

Positive solution 3 buildings, the Tab Control is simple to use
http://www.cnblogs.com/duzouzhe/archive/2010/03/14/1685346.html

CodePudding user response:

Feign death, it is message loop was taken over by the modal dialog.

Your problem is the modal dialog box is the main dialog hides, right.

In general the main modal dialog box will be in the top of the pop-up.
CCompensationChain window type in this dialog class resources must be dialog

Estimation is you made a mistake in some places.

CodePudding user response:

Modal dialog box I generally use new thread creation, because it can intercept the message, until the program will then run after close the dialog.
Not necessary, a new pointer, create a modal dialog box

CodePudding user response:


refer to 6th floor qq_29700255 response:
modal dialog box I generally use new thread creation, because it can intercept the message, until the program will then run after close the dialog.
Not necessary, a new pointer, create a modal dialog box


Tried non-modal or not,,
  • Related