How to synchronize execution control with a dataset that loads in a dialog box in Visual C ++

I am trying to add execution control to my dialogs, which will step on each iteration of the loop until completion. I’ve never played with progress control before, so I don’t know where I should start. I added a progress control resource view to my dialog, but it just displays as an empty progress control. I would like the dynamic progress to be displayed / updated when, after clicking the button, the image from the downloaded stars. I am trying to add progress control in a dialog box in a Visual C ++ environment.

After adding this tool to main.cpp, the following code was added:

void CPanoramicsampleDlg::OnNMCustomdrawProgress1(NMHDR *pNMHDR, LRESULT *pResult){
}

I can show the loading procedure in a text control as follows:

sprintf_s(pack1,"Data%d%%",Event);
::SetWindowText(GetDlgItem(IDC_Static)->m_hWnd,pack1);

Thus, I can see the boot process as% d in the text box, but I don’t know how to show the boot procedure using progress control, and how and where to determine the range or even the progress bar knob for this progress control on. finally, I would like to know if there is any function to control progress, for example:

::EnableWindow(GetDlgItem(IDC_Progress1)->m_hWnd);
+4
source share
2 answers

, " ...". CProgressCtrl, , . OnNMCustomdrawProgress1, .

.

m_progressCtrl.EnableWindow(TRUE);
m_progressCtrl.SetRange(0, 100);
m_progressCtrl.SetPos(75);

, , eventParam1, , - SetPos .


:

SetRange() OnInitDialog(). OnInitDialog, , , . VS 2008, MFC: OnInitDialog - ?

, SetPos(): , , eventParam1. , , SetPos() .

+3

Source: https://habr.com/ru/post/1589387/


All Articles