1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
CMyDialog::OnInitDialog()
{
...
m_Liste = new CListCtrl;
m_idListe = IDI_LIST;// Ici, au lieu d'utiliser une constante, tu peux la générer.
VERIFY (m_Liste->Create (WS_VISIBLE | WS_CHILD | LVS_REPORT | LVS_EDITLABELS, CRect (10, 10, 300, 300), this, m_idListe));
...
}
BOOL CMyDialog::OnNotify( WPARAM wParam,
LPARAM lParam,
LRESULT* pResult
)
{
NMHDR *p_notification = (NMHDR *)lParam;
if(p_notification){
switch(p_notification->idFrom)
{
case m_idListe:
return TraiterMaListe(p_notification);
}
}
return CDialog::OnNotify(wParam,lParam,pResult);
}
BOOL TraiterMaListe(NMHDR *_Notification)
{
switch(_Notification->code)
{
case NM_CLICK:
OnClickListe(_Notification);
return TRUE;
break;
.....
}
return FALSE;
} |
Partager