Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simulating click on OpenFile Dialog's Details view Header

Status
Not open for further replies.

senkyoshi

Programmer
Jul 27, 2004
3
US
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;
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top