ComboListCtrl.cpp 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605
  1. // ComboBoxListCtrl.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ComboListCtrl.h"
  5. #include <windowsx.h>
  6. #include "ylgl.h"
  7. #include "ChooseReason.h"
  8. #ifdef _DEBUG
  9. #define new DEBUG_NEW
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #endif
  13. #define IDC_ComboBox 0X01
  14. #define PROPERTY_ITEM 0x02
  15. #define PROPERTY_SUB 0x03
  16. /////////////////////////////////////////////////////////////////////////////
  17. // CComboBoxListCtrl
  18. extern CFont g_listctrlfont;
  19. CComboBoxListCtrl::CComboBoxListCtrl()
  20. {
  21. m_ComboBox.m_hWnd = NULL;
  22. m_bNeedSel=0;
  23. }
  24. CComboBoxListCtrl::~CComboBoxListCtrl()
  25. {
  26. }
  27. BEGIN_MESSAGE_MAP(CComboBoxListCtrl, CListCtrl)
  28. //{{AFX_MSG_MAP(CComboBoxListCtrl)
  29. ON_WM_LBUTTONDBLCLK()
  30. ON_WM_PARENTNOTIFY()
  31. ON_NOTIFY_REFLECT(NM_CUSTOMDRAW, OnCustomdrawList)
  32. //}}AFX_MSG_MAP
  33. ON_MESSAGE(WM_USER_ComboBox_END,OnComboBoxEnd)
  34. END_MESSAGE_MAP()
  35. void CComboBoxListCtrl::OnCustomdrawList ( NMHDR* pNMHDR, LRESULT* pResult )
  36. {
  37. NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>( pNMHDR );
  38. // Take the default processing unless we set this to something else below.
  39. *pResult = 0;
  40. // First thing - check the draw stage. If it's the control's prepaint
  41. // stage, then tell Windows we want messages for every item.
  42. if ( CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage )
  43. {
  44. *pResult = CDRF_NOTIFYITEMDRAW;
  45. }
  46. else if ( CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage )
  47. {
  48. // This is the prepaint stage for an item. Here's where we set the
  49. // item's text color. Our return value will tell Windows to draw the
  50. // item itself, but it will use the new color we set here.
  51. // We'll cycle the colors through red, green, and light blue.
  52. COLORREF crText;
  53. int pos=pLVCD->nmcd.dwItemSpec;
  54. if(pos%2)
  55. {
  56. pLVCD->clrTextBk = g_gridcol1;
  57. }
  58. else
  59. {
  60. pLVCD->clrTextBk = g_gridcol2;
  61. }
  62. // Tell Windows to paint the control itself.
  63. *pResult = CDRF_DODEFAULT;
  64. }
  65. }
  66. void CComboBoxListCtrl::OnLButtonDblClk(UINT nFlags, CPoint point)
  67. {
  68. CRect rcCtrl;
  69. LVHITTESTINFO lvhti;
  70. lvhti.pt = point;
  71. int nItem = CListCtrl::SubItemHitTest(&lvhti);
  72. if(nItem == -1)
  73. return;
  74. int nSubItem = lvhti.iSubItem;
  75. CListCtrl::GetSubItemRect(nItem,nSubItem,LVIR_LABEL,rcCtrl);
  76. rcCtrl.top -=4;
  77. rcCtrl.bottom +=200;
  78. if(nSubItem==4||nSubItem==6||nSubItem==8||nSubItem==10||nSubItem==12||nSubItem==14)
  79. ShowComboBox(TRUE,nItem,nSubItem,rcCtrl); // Jeff.这里处理下拉列表;
  80. CListCtrl::OnLButtonDblClk(nFlags, point);
  81. }
  82. void CComboBoxListCtrl::ShowComboBox(BOOL bShow,int nItem,int nIndex,CRect rcCtrl)
  83. {
  84. if(m_ComboBox.m_hWnd == NULL)
  85. {
  86. //m_ComboBox.Create(WS_VSCROLL|WS_CHILD|CBS_DROPDOWNLIST,CRect(0,0,0,0),this,IDC_ComboBox);
  87. m_ComboBox.Create(CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP,CRect(0,0,0,0),this,IDC_ComboBox);
  88. m_ComboBox.ShowWindow(SW_HIDE);
  89. }
  90. if(bShow == TRUE)
  91. {
  92. if(nIndex==6 && GetItemText(nItem,4).IsEmpty ())
  93. return;
  94. CString strItem = CListCtrl::GetItemText(nItem,nIndex);
  95. m_ComboBox.MoveWindow(rcCtrl);
  96. m_ComboBox.ShowWindow(SW_SHOW);
  97. ::SetFocus(m_ComboBox.GetSafeHwnd());
  98. m_ComboBox.ResetContent ();
  99. if(nIndex==4)
  100. {
  101. m_ComboBox.AddString ("");
  102. for(int i=0; i<g_List1array.GetSize (); i++)
  103. m_ComboBox.AddString ("已发"+g_List1array.ElementAt (i).ElementAt (1));
  104. }
  105. else if(nIndex==6)
  106. {
  107. m_ComboBox.AddString ("返工");
  108. m_ComboBox.AddString ("");
  109. m_ComboBox.AddString (strItem);
  110. m_bNeedSel=1;
  111. }
  112. else if(nIndex==8)
  113. {
  114. m_ComboBox.AddString ("OK");
  115. m_ComboBox.AddString ("未完成");
  116. }
  117. #ifdef LKAY_VERSION
  118. else if(nIndex==10)
  119. {
  120. m_ComboBox.AddString ("OK");
  121. m_ComboBox.AddString ("未组");
  122. }
  123. else if(nIndex==12)
  124. {
  125. m_ComboBox.AddString ("OK");
  126. m_ComboBox.AddString ("未转");
  127. }
  128. else if(nIndex==14)
  129. {
  130. m_ComboBox.AddString ("OK");
  131. m_ComboBox.AddString ("未取");
  132. }
  133. #else
  134. else if(nIndex==10)
  135. {
  136. m_ComboBox.AddString ("OK");
  137. m_ComboBox.AddString ("未取");
  138. }
  139. #endif
  140. m_ComboBox.SetCurSel (m_ComboBox.FindString (0, strItem));
  141. m_ComboBox.SetCtrlData(MAKEWPARAM(nIndex,nItem));
  142. }
  143. else
  144. m_ComboBox.ShowWindow(SW_HIDE);
  145. }
  146. #ifdef VC60
  147. void CComboBoxListCtrl::OnComboBoxEnd(WPARAM wParam,LPARAM lParam)
  148. {
  149. if(wParam == TRUE)
  150. {
  151. CString strText(_T(""));
  152. int pos=m_ComboBox.GetCurSel ();
  153. if(pos!=-1)
  154. {
  155. m_ComboBox.GetLBText (pos, strText);
  156. DWORD dwData = m_ComboBox.GetCtrlData();
  157. int nItem= dwData>>16;
  158. int nIndex = dwData&0x0000ffff;
  159. CListCtrl::SetItemText(nItem,nIndex,strText);
  160. //printf("Jeff:%d,%d,%s\n",nItem,nIndex,strText);
  161. strText.TrimLeft(" ");
  162. strText.TrimRight(" ");
  163. if(nIndex==4 && strText.IsEmpty())
  164. {
  165. SetItemText(nItem,6,"");
  166. SetItemText(nItem,5,""); // Jeff.add 若选择回空,则清空日期;
  167. }
  168. if(nIndex==4) // 发件;
  169. {
  170. //printf("Jeff:nIndex=4,%s\n",m_sparray->ElementAt(nItem).ElementAt(4));
  171. //if(strText!=m_sparray->ElementAt(nItem).ElementAt(4)) // Jeff.delete 4:dindansp.status1;
  172. if( strText != "")
  173. SetItemText(nItem,5,g_date+"/"+g_user.name);
  174. else
  175. SetItemText(nItem,5,""); // Jeff.add 若选择回空,则清空日期;
  176. }
  177. else if(nIndex==6)
  178. {
  179. // MessageBox(strText);
  180. if(strText.Find("返工")!=-1 && m_bNeedSel)
  181. {
  182. m_bNeedSel=0;
  183. //SetItemText(nItem,7,g_date+"/"+g_user.name);
  184. CChooseReason dlg;
  185. if(dlg.DoModal ()==IDOK)
  186. {
  187. SetItemText( nItem, 6,"返工/("+dlg.sRet+")");
  188. m_ComboBox.SetCurSel (-1);
  189. }
  190. SetItemText(nItem,7,g_date+"/"+g_user.name);
  191. }
  192. else if( strText == "") // Jeff.add.若选择回空,则清空日期;
  193. {
  194. SetItemText(nItem,7,"");
  195. }
  196. }
  197. else if(nIndex==8)
  198. {
  199. //printf("Jeff:nIndex=8,%s\n",m_sparray->ElementAt(nItem).ElementAt(6));
  200. //if(strText!=m_sparray->ElementAt (nItem).ElementAt (6)) // Jeff.delete 6:dindansp.autoid;
  201. if( strText == "OK")
  202. SetItemText(nItem,9,g_date+"/"+g_user.name);
  203. else// Jeff.add.若选择回空,则清空日期;
  204. SetItemText(nItem,9,"");
  205. }
  206. #ifdef LKAY_VERSION
  207. else if(nIndex==10)
  208. {
  209. if(strText!=m_sparray->ElementAt (nItem).ElementAt (23))
  210. SetItemText(nItem,11,g_date+"/"+g_user.name);
  211. else // Jeff.add.若选择回空,则清空日期;
  212. SetItemText(nItem,11,"");
  213. }
  214. else if(nIndex==12)
  215. {
  216. if(strText!=m_sparray->ElementAt (nItem).ElementAt (24))
  217. SetItemText(nItem,13,g_date+"/"+g_user.name);
  218. else // Jeff.add.若选择回空,则清空日期;
  219. SetItemText(nItem,13,"");
  220. }
  221. else if(nIndex==14)
  222. {
  223. if(strText!=m_sparray->ElementAt (nItem).ElementAt (7))
  224. SetItemText(nItem,15,g_date+"/"+g_user.name);
  225. else // Jeff.add.若选择回空,则清空日期;
  226. SetItemText(nItem,15,"");
  227. }
  228. #else
  229. else if(nIndex==10)
  230. {
  231. //printf("Jeff:nIndex=10,%s\n",m_sparray->ElementAt(nItem).ElementAt(7));
  232. //if(strText!=m_sparray->ElementAt(nItem).ElementAt(7)) // Jeff.delete 7:dindansp.spid;
  233. if( strText == "OK")
  234. SetItemText(nItem,11,g_date+"/"+g_user.name);
  235. else // Jeff.add.若选择回空,则清空日期;
  236. SetItemText(nItem,11,"");
  237. }
  238. #endif
  239. }
  240. }
  241. else
  242. {
  243. }
  244. if(lParam == FALSE)
  245. m_ComboBox.ShowWindow(SW_HIDE);
  246. }
  247. #else
  248. LRESULT CComboBoxListCtrl::OnComboBoxEnd(WPARAM wParam,LPARAM lParam)
  249. {
  250. if(wParam == TRUE)
  251. {
  252. CString strText(_T(""));
  253. int pos=m_ComboBox.GetCurSel ();
  254. if(pos!=-1)
  255. {
  256. m_ComboBox.GetLBText (pos, strText);
  257. DWORD dwData = m_ComboBox.GetCtrlData();
  258. int nItem= dwData>>16;
  259. int nIndex = dwData&0x0000ffff;
  260. CListCtrl::SetItemText(nItem,nIndex,strText);
  261. //printf("Jeff:%d,%d,%s\n",nItem,nIndex,strText);
  262. strText.TrimLeft(" ");
  263. strText.TrimRight(" ");
  264. if(nIndex==4 && strText.IsEmpty())
  265. {
  266. SetItemText(nItem,6,"");
  267. SetItemText(nItem,5,""); // Jeff.add 若选择回空,则清空日期;
  268. }
  269. if(nIndex==4) // 发件;
  270. {
  271. //printf("Jeff:nIndex=4,%s\n",m_sparray->ElementAt(nItem).ElementAt(4));
  272. //if(strText!=m_sparray->ElementAt(nItem).ElementAt(4)) // Jeff.delete 4:dindansp.status1;
  273. if( strText != "")
  274. SetItemText(nItem,5,g_date+"/"+g_user.name);
  275. else
  276. SetItemText(nItem,5,""); // Jeff.add 若选择回空,则清空日期;
  277. }
  278. else if(nIndex==6)
  279. {
  280. // MessageBox(strText);
  281. if(strText.Find("返工")!=-1 && m_bNeedSel)
  282. {
  283. m_bNeedSel=0;
  284. //SetItemText(nItem,7,g_date+"/"+g_user.name);
  285. CChooseReason dlg;
  286. if(dlg.DoModal ()==IDOK)
  287. {
  288. SetItemText( nItem, 6,"返工/("+dlg.sRet+")");
  289. m_ComboBox.SetCurSel (-1);
  290. }
  291. SetItemText(nItem,7,g_date+"/"+g_user.name);
  292. }
  293. else if( strText == "") // Jeff.add.若选择回空,则清空日期;
  294. {
  295. SetItemText(nItem,7,"");
  296. }
  297. }
  298. else if(nIndex==8)
  299. {
  300. //printf("Jeff:nIndex=8,%s\n",m_sparray->ElementAt(nItem).ElementAt(6));
  301. //if(strText!=m_sparray->ElementAt (nItem).ElementAt (6)) // Jeff.delete 6:dindansp.autoid;
  302. if( strText == "OK")
  303. SetItemText(nItem,9,g_date+"/"+g_user.name);
  304. else// Jeff.add.若选择回空,则清空日期;
  305. SetItemText(nItem,9,"");
  306. }
  307. #ifdef LKAY_VERSION
  308. else if(nIndex==10)
  309. {
  310. if(strText!=m_sparray->ElementAt (nItem).ElementAt (23))
  311. SetItemText(nItem,11,g_date+"/"+g_user.name);
  312. else // Jeff.add.若选择回空,则清空日期;
  313. SetItemText(nItem,11,"");
  314. }
  315. else if(nIndex==12)
  316. {
  317. if(strText!=m_sparray->ElementAt (nItem).ElementAt (24))
  318. SetItemText(nItem,13,g_date+"/"+g_user.name);
  319. else // Jeff.add.若选择回空,则清空日期;
  320. SetItemText(nItem,13,"");
  321. }
  322. else if(nIndex==14)
  323. {
  324. if(strText!=m_sparray->ElementAt (nItem).ElementAt (7))
  325. SetItemText(nItem,15,g_date+"/"+g_user.name);
  326. else // Jeff.add.若选择回空,则清空日期;
  327. SetItemText(nItem,15,"");
  328. }
  329. #else
  330. else if(nIndex==10)
  331. {
  332. //printf("Jeff:nIndex=10,%s\n",m_sparray->ElementAt(nItem).ElementAt(7));
  333. //if(strText!=m_sparray->ElementAt(nItem).ElementAt(7)) // Jeff.delete 7:dindansp.spid;
  334. if( strText == "OK")
  335. SetItemText(nItem,11,g_date+"/"+g_user.name);
  336. else // Jeff.add.若选择回空,则清空日期;
  337. SetItemText(nItem,11,"");
  338. }
  339. #endif
  340. }
  341. }
  342. else
  343. {
  344. }
  345. if(lParam == FALSE)
  346. m_ComboBox.ShowWindow(SW_HIDE);
  347. return 0;
  348. }
  349. #endif
  350. void CComboBoxListCtrl::OnParentNotify(UINT message, LPARAM lParam)
  351. {
  352. CListCtrl::OnParentNotify(message, lParam);
  353. //////////////////////////////////////////////////////////////////////////
  354. CHeaderCtrl* pHeaderCtrl = CListCtrl::GetHeaderCtrl();
  355. if(pHeaderCtrl == NULL)
  356. return;
  357. CRect rcHeader;
  358. pHeaderCtrl->GetWindowRect(rcHeader);
  359. ScreenToClient(rcHeader);
  360. //The x coordinate is in the low-order word and the y coordinate is in the high-order word.
  361. CPoint pt;
  362. pt.x = GET_X_LPARAM(lParam);
  363. pt.y = GET_Y_LPARAM(lParam);
  364. if(rcHeader.PtInRect(pt) && message == WM_LBUTTONDOWN)
  365. {
  366. if(m_ComboBox.m_hWnd != NULL)
  367. {
  368. DWORD dwStyle = m_ComboBox.GetStyle();
  369. if((dwStyle&WS_VISIBLE) == WS_VISIBLE)
  370. {
  371. m_ComboBox.ShowWindow(SW_HIDE);
  372. }
  373. }
  374. }
  375. }
  376. BOOL CComboBoxListCtrl::PreTranslateMessage(MSG* pMsg)
  377. {
  378. if(0)//pMsg->message == WM_KEYDOWN)
  379. {
  380. if(pMsg->wParam == VK_TAB && m_ComboBox.m_hWnd!= NULL)
  381. {
  382. DWORD dwStyle = m_ComboBox.GetStyle();
  383. if((dwStyle&WS_VISIBLE) == WS_VISIBLE)
  384. {
  385. OnComboBoxEnd(TRUE,TRUE);
  386. CRect rcCtrl;
  387. int nItem;
  388. int nSub;
  389. if(FALSE == Key_Ctrl(nItem,nSub))
  390. Key_Shift(nItem,nSub);
  391. CListCtrl::GetSubItemRect(nItem,nSub,LVIR_LABEL,rcCtrl);
  392. CPoint pt(rcCtrl.left+1,rcCtrl.top+1);
  393. OnLButtonDblClk(0,pt);
  394. POSITION pos = CListCtrl::GetFirstSelectedItemPosition();
  395. if (pos == NULL)
  396. {
  397. }
  398. else
  399. {
  400. while (pos)
  401. {
  402. int ntpItem = CListCtrl::GetNextSelectedItem(pos);
  403. CListCtrl::SetItemState(ntpItem,0,LVIS_SELECTED);
  404. }
  405. }
  406. CListCtrl::SetItemState(nItem, LVIS_SELECTED, LVIS_SELECTED);
  407. return TRUE;
  408. }
  409. }
  410. }
  411. return CListCtrl::PreTranslateMessage(pMsg);
  412. }
  413. BOOL CComboBoxListCtrl::Key_Shift(int& nItem,int& nSub)
  414. {
  415. int nItemCount = CListCtrl::GetItemCount();
  416. DWORD dwData = m_ComboBox.GetCtrlData();
  417. nItem= dwData>>16;
  418. nSub = dwData&0x0000ffff;
  419. CHeaderCtrl* pHeader = CListCtrl::GetHeaderCtrl();
  420. if(pHeader == NULL)
  421. return FALSE;
  422. short sRet = GetKeyState(VK_SHIFT);
  423. int nSubcCount = pHeader->GetItemCount();
  424. sRet = sRet >>15;
  425. if(sRet == 0)
  426. {
  427. nSub += 1;
  428. if(nSub >= nSubcCount)
  429. {
  430. if(nItem == nItemCount-1)
  431. {
  432. nItem = 0;
  433. nSub = 0;
  434. }
  435. else
  436. {
  437. nSub = 0;
  438. nItem += 1;
  439. }
  440. }
  441. if(nItem >= nItemCount)
  442. nItem = nItemCount-1;
  443. return FALSE;
  444. }
  445. else
  446. {
  447. nSub -= 1;
  448. if(nSub < 0)
  449. {
  450. nSub = nSubcCount -1;
  451. nItem --;
  452. }
  453. if(nItem < 0)
  454. nItem = nItemCount-1;
  455. return TRUE;
  456. }
  457. return FALSE;
  458. }
  459. BOOL CComboBoxListCtrl::Key_Ctrl(int& nItem,int &nSub)
  460. {
  461. short sRet = GetKeyState(VK_CONTROL);
  462. DWORD dwData = m_ComboBox.GetCtrlData();
  463. nItem= dwData>>16;
  464. nSub = dwData&0x0000ffff;
  465. sRet = sRet >>15;
  466. int nItemCount = CListCtrl::GetItemCount();
  467. if(sRet == 0)
  468. {
  469. }
  470. else
  471. {
  472. nItem = nItem >=nItemCount-1? 0:nItem+=1;
  473. return TRUE;
  474. }
  475. return FALSE;
  476. }
  477. //////////////////////////////////////////////////////////////////////////
  478. //////////////////////////////////////////////////////////////////////////
  479. //////////////////////////////////////////////////////////////////////////
  480. CListCtrlComboBox::CListCtrlComboBox()
  481. {
  482. }
  483. CListCtrlComboBox::~CListCtrlComboBox()
  484. {
  485. }
  486. BEGIN_MESSAGE_MAP(CListCtrlComboBox, CComboBox)
  487. //{{AFX_MSG_MAP(CListCtrlComboBox)
  488. ON_WM_KILLFOCUS()
  489. ON_WM_SETFOCUS()
  490. ON_CONTROL_REFLECT(CBN_CLOSEUP, OnCloseup)
  491. //}}AFX_MSG_MAP
  492. END_MESSAGE_MAP()
  493. /////////////////////////////////////////////////////////////////////////////
  494. // CListCtrlComboBox message handlers
  495. void CListCtrlComboBox::SetCtrlData(DWORD dwData)
  496. {
  497. m_dwData = dwData;
  498. }
  499. DWORD CListCtrlComboBox::GetCtrlData()
  500. {
  501. return m_dwData;
  502. }
  503. void CListCtrlComboBox::OnKillFocus(CWnd* pNewWnd)
  504. {
  505. CComboBox::OnKillFocus(pNewWnd);
  506. CWnd* pParent = this->GetParent();
  507. ::PostMessage(pParent->GetSafeHwnd(),WM_USER_ComboBox_END,m_bExchange,0);
  508. }
  509. BOOL CListCtrlComboBox::PreTranslateMessage(MSG* pMsg)
  510. {
  511. if(pMsg->message == WM_KEYDOWN)
  512. {
  513. if(pMsg->wParam == VK_RETURN)
  514. {
  515. CWnd* pParent = this->GetParent();
  516. m_bExchange = TRUE;
  517. ::PostMessage(pParent->GetSafeHwnd(),WM_USER_ComboBox_END,m_bExchange,0);
  518. }
  519. else if(pMsg->wParam == VK_ESCAPE)
  520. {
  521. CWnd* pParent = this->GetParent();
  522. m_bExchange = FALSE;
  523. ::PostMessage(pParent->GetSafeHwnd(),WM_USER_ComboBox_END,m_bExchange,0);
  524. }
  525. }
  526. return CComboBox::PreTranslateMessage(pMsg);
  527. }
  528. void CListCtrlComboBox::OnSetFocus(CWnd* pOldWnd)
  529. {
  530. CComboBox::OnSetFocus(pOldWnd);
  531. m_bExchange = TRUE;
  532. }
  533. void CComboBoxListCtrl::InitStyle()
  534. {
  535. SetFont (&g_listctrlfont);
  536. SetExtendedStyle(LVS_EX_FLATSB|LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES|LVS_EX_HEADERDRAGDROP);
  537. }
  538. void CListCtrlComboBox::OnCloseup()
  539. {
  540. // TODO: Add your control notification handler code here
  541. CWnd* pParent = this->GetParent();
  542. ::PostMessage(pParent->GetSafeHwnd(),WM_USER_ComboBox_END,m_bExchange,0);
  543. }
  544. #undef SubclassWindow
  545. void CComboBoxListCtrl::PreSubclassWindow()
  546. {
  547. // the list control must have the report style.
  548. CListCtrl::PreSubclassWindow();
  549. m_ctlHeader.SubclassWindow ( GetHeaderCtrl()->GetSafeHwnd());
  550. }