I am trying to have a Open File Dialog open up in details view and sorted by the Modified column. The openfile Dialog opens up fine but it is not sorted by Modified column. Here is my code. Can anyone see what I am doing wrong?
...
CListCtrl*plc=(CListCtrl*)GetParent()->GetDlgItem(lst2)->GetDlgItem(1);
CHeaderCtrl *pHCtrl = plc->GetHeaderCtrl();
HWND hHeaderCtrl = pHCtrl->m_hWnd;
NMHDR nmHDR;
nmHDR.hwndFrom = hHeaderCtrl;
nmHDR.idFrom = pHCtrl->GetDlgCtrlID();
HDITEM hdi;
pHCtrl->GetItem(3, &hdi);
NMHEADER NMHeader;
NMHeader.hdr = nmHDR;
NMHeader.iItem = 3;
NMHeader.iButton = 0;
NMHeader.pitem = &hdi;
::SendMessage:GetParent(hHeaderCtrl),WM_NOTIFY, NULL, (LPARAM)&NMHeader);
return 0;
}
...
CListCtrl*plc=(CListCtrl*)GetParent()->GetDlgItem(lst2)->GetDlgItem(1);
CHeaderCtrl *pHCtrl = plc->GetHeaderCtrl();
HWND hHeaderCtrl = pHCtrl->m_hWnd;
NMHDR nmHDR;
nmHDR.hwndFrom = hHeaderCtrl;
nmHDR.idFrom = pHCtrl->GetDlgCtrlID();
HDITEM hdi;
pHCtrl->GetItem(3, &hdi);
NMHEADER NMHeader;
NMHeader.hdr = nmHDR;
NMHeader.iItem = 3;
NMHeader.iButton = 0;
NMHeader.pitem = &hdi;
::SendMessage:GetParent(hHeaderCtrl),WM_NOTIFY, NULL, (LPARAM)&NMHeader);
return 0;
}