C & C++/MFC 컨트롤
[ToolTip] 정적툴팁
izen8
2011. 5. 21. 20:05
// ToolTipDlg.h
class CToolTipDlg : public CDialog
{
// Construction
public:
CToolTipDlg(CWnd* pParent = NULL); // standard constructor
CToolTipCtrl m_ctrlTT;
// Dialog Data
//{{AFX_DATA(CToolTipDlg)
enum { IDD = IDD_TOOLTIP_DIALOG };
CSliderCtrl m_ctrlSlider; // Control형 멤버 변수 연결
//..
}
// ToolTipDlg.cpp
BOOL CToolTipDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
// TODO: Add extra initialization here
m_ctrlTT.Create(this);
m_ctrlTT.AddTool(&m_ctrlSlider, _T("이것으로 보륨을 조절하세요."));
return TRUE; // return TRUE unless you set the focus to a control
}
BOOL CToolTipDlg::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
m_ctrlTT.RelayEvent(pMsg);
return CDialog::PreTranslateMessage(pMsg);
}