Home > Software engineering >  C program to perform a long process to create a waiting dialog?
C program to perform a long process to create a waiting dialog?

Time:10-10

 CDialog DLG. 
DLG. Create (IDD_DIALOG_SHOW);//IDD_DIALOG_SHOW to create to the pop-up dialog
DLG. CenterWindow (this);//dialog centered
DLG. SetDlgItemText (IDC_WAIT, "Wait the begin... ");//IDC_WAIT as a static text box, do not edit
DLG. ShowWindow (SW_SHOWNOACTIVATE);

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

There is the code to deal with, how long computing time can be

Of course, you can insert the code in the code

DLG. SetDlgItemText (IDC_WAIT, "... ");

How much to tell the user processing,

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
DLG. EndDialog (0);//processing finished, close the dialog

The above is check it on the website information
He had new a dialog ID for IDD_DIALOG_SHOW (no dialog box for this new class) on the dialog box to put a static text box with ID IDC_WAIT other copy, but the dialog on how without words!

CodePudding user response:

The above code where are you calling?

CodePudding user response:

"No dialog box for this new class", that showed you how to put this dialog?
If your process is in the main thread, should take the initiative to refresh DLG, like "
In the code inserted into the code
DLG. SetDlgItemText (IDC_WAIT, "... ");
"
:
DLG. Invalidate ();
DLG. UpdateWindow ();

CodePudding user response:

I am in the main thread to run the program

CodePudding user response:

Is the button to trigger response function
  • Related