1 ///////////////////////////////////////
\r
5 #include "MyDialog.h"
\r
6 #include "resource.h"
\r
9 // Definitions for the CMyDialog class
\r
10 CMyDialog::CMyDialog(UINT nResID, CWnd* pParent)
\r
11 : CDialog(nResID, pParent)
\r
15 CMyDialog::~CMyDialog()
\r
19 BOOL CMyDialog::OnInitDialog()
\r
22 SetIconLarge(IDW_MAIN);
\r
23 SetIconSmall(IDW_MAIN);
\r
25 // Attach the dialog items to the CWnd objects
\r
26 AttachItem(IDC_PROGRESS1, m_ProgressBar);
\r
27 AttachItem(IDC_SCROLLBAR1, m_ScrollBar);
\r
28 AttachItem(IDC_SLIDER1, m_Slider);
\r
33 void CMyDialog::OnOK()
\r
35 MessageBox(_T("OK Button Pressed. Program will exit now."), _T("Button"), MB_OK);
\r
39 void CMyDialog::SetProgress(int nPos)
\r
41 m_ProgressBar.SetProgress(nPos);
\r
44 void CMyDialog::SetScroll(int nPos)
\r
46 m_ScrollBar.SetScroll(nPos);
\r
49 void CMyDialog::SetSlider(int nPos)
\r
51 m_Slider.SetPos(nPos, TRUE);
\r
54 void CMyDialog::SetStatic(BOOL IsSlider, int nPos)
\r
58 str.Format(_T("Slider Position %d"), nPos);
\r
60 str.Format(_T("Scroll Position %d"), nPos);
\r
62 // Set the text in the static control
\r
63 SetDlgItemText(IDC_STATIC2, str);
\r