mainfrm.cpp 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522
  1. #include "stdafx2.h"
  2. #include "mainfrm.h"
  3. #include "ukeytask.h"
  4. BOOL CMainFrame::PreTranslateMessage( MSG* pMsg )
  5. {
  6. return CFrameWindowImpl<CMainFrame>::PreTranslateMessage(pMsg);
  7. }
  8. BOOL CMainFrame::OnIdle()
  9. {
  10. BOOL bEnable = m_iSelectIdx != -1;
  11. UIEnable(ID_START, bEnable);
  12. UIEnable(ID_STOP, bEnable);
  13. UIEnable(ID_PAUSE, bEnable);
  14. UIEnable(ID_CONTINUE, bEnable);
  15. UIEnable(ID_KILL, bEnable);
  16. UIUpdateToolBar();
  17. return FALSE;
  18. }
  19. int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
  20. {
  21. CreateSimpleToolBar();
  22. m_hWndStatusBar = m_status.Create(m_hWnd, rcDefault, NULL, WS_VISIBLE|WS_CHILD,WS_EX_STATICEDGE);
  23. m_status.SetMinHeight(120);
  24. int _parts[] = {400,200,200,-1};
  25. m_status.SetParts(sizeof(_parts)/sizeof(_parts[0]), _parts);
  26. //static
  27. WTL::CStatic staticbar;
  28. RECT rc;
  29. m_status.GetRect(0, &rc);
  30. rc.left += 5;
  31. rc.right= rc.left+ 110;
  32. rc.top += 30;
  33. rc.bottom = rc.top + 30;
  34. staticbar.Create(m_hWndStatusBar,&rc,"UKEY密码(8位)",WS_CHILD|WS_VISIBLE | ES_AUTOHSCROLL | ES_LEFT);
  35. rc.left = rc.right-3;
  36. rc.right= rc.left+ 180;
  37. rc.top -= 5;
  38. rc.bottom = rc.top + 30;
  39. m_cmd.SetOwner(this);
  40. m_cmd.Create(m_hWndStatusBar, &rc, NULL, WS_CHILD|ES_PASSWORD|WS_VISIBLE | ES_AUTOHSCROLL | ES_LEFT, WS_EX_STATICEDGE);
  41. m_cmd.SetPasswordChar('*');
  42. rc.left = rc.left+45;
  43. rc.right= rc.left+ 80;
  44. rc.top =rc.bottom+15;
  45. rc.bottom = rc.top + 25;
  46. m_OpenKeyboard.Create(m_hWndStatusBar, &rc,_T("软键盘"),WS_CHILD | WS_VISIBLE |SS_NOTIFY ,0,IDC_BTN_SOFTBOARD);
  47. rc.left = rc.left+150;
  48. rc.right= rc.left+ 80;
  49. rc.top -=45;
  50. rc.bottom = rc.top + 30;
  51. m_PasswordOk.Create(m_hWndStatusBar, &rc,_T("确定"),WS_CHILD| WS_VISIBLE,0,IDC_BTN_OK);
  52. //打开机柜按钮
  53. m_status.GetRect(1, &rc);
  54. rc.left = rc.left+80;
  55. rc.top = rc.top+30;
  56. rc.bottom = rc.top + 50;
  57. rc.right = rc.left + 120;
  58. m_OpenDoor.Create(m_hWndStatusBar, &rc,_T("打开机柜"),WS_CHILD| WS_VISIBLE,0,IDC_BTN_OPENDOOR);
  59. rc.left = rc.right+60;
  60. rc.right = rc.left + 120;
  61. m_OpenLocalconsole.Create(m_hWndStatusBar, &rc,_T("进入本地维护"),WS_CHILD| WS_VISIBLE,0,IDC_BTN_LOCALCONSOLE);
  62. m_hWndClient = m_splitter.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN);
  63. UpdateLayout();
  64. m_verticalSplitter.Create(m_splitter, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN);
  65. //output
  66. m_output.Create(m_splitter, rcDefault, NULL,
  67. WS_CHILD|WS_VISIBLE|ES_AUTOVSCROLL|ES_LEFT|ES_MULTILINE|WS_VSCROLL, WS_EX_STATICEDGE);
  68. m_output_font.CreateFont(20,0,0,0,FALSE,FALSE,FALSE,0,DEFAULT_CHARSET,
  69. OUT_CHARACTER_PRECIS, CLIP_CHARACTER_PRECIS,DEFAULT_QUALITY, DEFAULT_PITCH,NULL);
  70. m_output.SetFont(m_output_font);
  71. CRect rect;
  72. GetClientRect(rect);
  73. m_splitter.SetSplitterPos(rect.Height()*3/5);
  74. m_splitter.SetSplitterPanes(m_verticalSplitter, m_output);
  75. m_left_list.Create(m_verticalSplitter, rcDefault, NULL,
  76. WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN |
  77. LVS_REPORT | LVS_AUTOARRANGE | LVS_SHOWSELALWAYS | LVS_SINGLESEL, 0, IDC_LIST1);
  78. m_left_list.SetExtendedListViewStyle(LVS_EX_GRIDLINES | LVS_EX_FULLROWSELECT, 0);
  79. m_right_list.Create(m_verticalSplitter, rcDefault, NULL,
  80. WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN |
  81. LVS_REPORT | LVS_AUTOARRANGE | LVS_SHOWSELALWAYS | LVS_SINGLESEL, 0, IDC_LIST2);
  82. m_right_list.SetExtendedListViewStyle(LVS_EX_GRIDLINES | LVS_EX_FULLROWSELECT, 0);
  83. m_verticalSplitter.SetSplitterPos((rect.Width()-4)/2);
  84. m_verticalSplitter.SetSplitterPanes(m_left_list, m_right_list);
  85. LVCOLUMN col = {0};
  86. col.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT;
  87. col.fmt = LVCFMT_LEFT;
  88. col.cx = 5/3*rect.Width() / 10-1;
  89. col.pszText = _T("terminalno");
  90. m_left_list.InsertColumn(0, &col);
  91. m_right_list.InsertColumn(0, &col);
  92. col.pszText = _T("warning");
  93. col.cx = 5/3*rect.Width() / 10-1;
  94. m_left_list.InsertColumn(1, &col);
  95. m_right_list.InsertColumn(1, &col);
  96. col.pszText = _T("entityname");
  97. col.cx = 5/3*rect.Width() / 10-1;
  98. m_left_list.InsertColumn(2, &col);
  99. m_right_list.InsertColumn(2, &col);
  100. col.pszText = _T("time");
  101. col.cx = 5/3*rect.Width() / 10-1;
  102. m_left_list.InsertColumn(3, &col);
  103. m_right_list.InsertColumn(3, &col);
  104. UIAddToolBar(m_hWndToolBar);
  105. CMessageLoop* pLoop = _Module.GetMessageLoop();
  106. pLoop->AddMessageFilter(this);
  107. pLoop->AddIdleHandler(this);
  108. // load all entity
  109. CAutoArray<EntityEntry> Entities;
  110. m_pConsole->GetAllEntity(Entities);
  111. for (int i = 0; i < Entities.GetCount(); ++i) {
  112. LoadEntity(i, Entities[i]);
  113. }
  114. ::AtlLoadAccelerators(MAKEINTRESOURCE(IDR_MAINFRAME));
  115. return 0;
  116. }
  117. int CMainFrame::FindEntitylistItemIndex(int entity_id)
  118. {
  119. int i;
  120. for (i = 0; i < m_left_list.GetItemCount(); ++i) {
  121. int id = (int)m_left_list.GetItemData(i);
  122. if (id == entity_id)
  123. return i*2;
  124. }
  125. for (i = 0; i < m_right_list.GetItemCount(); ++i) {
  126. int id = (int)m_right_list.GetItemData(i);
  127. if (id == entity_id)
  128. return i*2+1;
  129. }
  130. return -1;
  131. }
  132. int CMainFrame::FindEntitylistItemIndex(const char *entity_name)
  133. {
  134. int i;
  135. for (i = 0; i < m_left_list.GetItemCount(); ++i) {
  136. char str[128];
  137. m_left_list.GetItemText(i, 0, str, sizeof(str));
  138. char *p = strchr(str, ':');
  139. if (p)
  140. ++p;
  141. if (_stricmp(entity_name, p) == 0)
  142. return i*2;
  143. }
  144. for (i = 0; i < m_right_list.GetItemCount(); ++i) {
  145. char str[128];
  146. m_right_list.GetItemText(i, 0, str, sizeof(str));
  147. char *p = strchr(str, ':');
  148. if (p)
  149. ++p;
  150. if (_stricmp(entity_name, p) == 0)
  151. return i*2+1;
  152. }
  153. return -1;
  154. }
  155. void CMainFrame::SetEntityState(int entity_id, int state, int pid)
  156. {
  157. int idx = FindEntitylistItemIndex(entity_id);
  158. if (idx != -1) {
  159. char tmp[16];
  160. wsprintfA(tmp, "%d", pid);
  161. if (idx & 1) {
  162. m_right_list.SetItem((idx-1)/2, 2, LVIF_TEXT, (LPCSTR)EntityEntry::GetStateName(state), 0, 0, 0, NULL);
  163. m_right_list.SetItem((idx-1)/2, 3, LVIF_TEXT, tmp, 0, 0, 0, NULL);
  164. } else {
  165. m_left_list.SetItem(idx/2, 2, LVIF_TEXT, (LPCSTR)EntityEntry::GetStateName(state), 0, 0, 0, NULL);
  166. m_left_list.SetItem(idx/2, 3, LVIF_TEXT, tmp, 0, 0, 0, NULL);
  167. }
  168. }
  169. }
  170. void CMainFrame::SetEntityState(const char *entity_name, int state, int pid)
  171. {
  172. int idx = FindEntitylistItemIndex(entity_name);
  173. if (idx != -1) {
  174. char tmp[16];
  175. wsprintfA(tmp, "%d", pid);
  176. if (idx & 1) {
  177. m_right_list.SetItem((idx-1)/2, 2, LVIF_TEXT, (LPCSTR)EntityEntry::GetStateName(state), 0, 0, 0, NULL);
  178. m_right_list.SetItem((idx-1)/2, 3, LVIF_TEXT, tmp, 0, 0, 0, NULL);
  179. } else {
  180. m_left_list.SetItem(idx/2, 2, LVIF_TEXT, (LPCSTR)EntityEntry::GetStateName(state), 0, 0, 0, NULL);
  181. m_left_list.SetItem(idx/2, 3, LVIF_TEXT, tmp, 0, 0, 0, NULL);
  182. }
  183. }
  184. }
  185. void CMainFrame::LoadEntity( int idx, EntityEntry &e )
  186. {
  187. char tmp[16];
  188. wsprintfA(tmp, "%d", e.Pid);
  189. CSimpleStringA strName = CSimpleStringA::Format("%s:%s", (LPCSTR)e.ModuleName, (LPCSTR)e.Name);
  190. if (idx & 1) {
  191. idx = (idx-1)/2;
  192. m_right_list.InsertItem(LVIF_PARAM|LVIF_TEXT, idx, (LPCSTR)strName, 0, 0, 0, e.Id);
  193. m_right_list.AddItem(idx, 1, (LPCSTR)EntityEntry::GetTypeName(e.Type));
  194. m_right_list.AddItem(idx, 2, (LPCSTR)EntityEntry::GetStateName(e.State));
  195. m_right_list.AddItem(idx, 3, tmp);
  196. } else {
  197. idx = idx / 2;
  198. m_left_list.InsertItem(LVIF_PARAM|LVIF_TEXT, idx, (LPCSTR)strName, 0, 0, 0, e.Id);
  199. m_left_list.AddItem(idx, 1, (LPCSTR)EntityEntry::GetTypeName(e.Type));
  200. m_left_list.AddItem(idx, 2, (LPCSTR)EntityEntry::GetStateName(e.State));
  201. m_left_list.AddItem(idx, 3, tmp);
  202. }
  203. }
  204. #define PREFIX_LEN 26
  205. // [2011-02-20 16:13:23.123]
  206. void CMainFrame::output_printf(const char *fmt, ...)
  207. {
  208. int len;
  209. va_list arg;
  210. va_start(arg, fmt);
  211. len = _vscprintf(fmt, arg);
  212. if (len > 0) {
  213. SYSTEMTIME st;
  214. char *buf;
  215. GetLocalTime(&st);
  216. buf = (char*)malloc(PREFIX_LEN + len+1);
  217. sprintf(buf, "[%04d-%02d-%02d %02d:%02d:%02d.%03d] ", st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond, st.wMilliseconds);
  218. vsprintf(buf+PREFIX_LEN, fmt, arg);
  219. m_strOuput += buf;
  220. m_nLineCount++;
  221. // 检测最大长度
  222. CheckOutputMaxLen();
  223. m_output.SetWindowText(m_strOuput);
  224. m_output.SetFocus();
  225. m_output.ShowCaret();
  226. m_output.SetSel(m_strOuput.GetLength(), m_strOuput.GetLength());
  227. m_output.LineScroll(-1);
  228. free(buf);
  229. }
  230. va_end(arg);
  231. }
  232. void CMainFrame::CheckOutputMaxLen()
  233. {
  234. if (m_nLineCount > 200)
  235. {
  236. int count = 0;
  237. int index = 0;
  238. while(count < 50 && index < m_strOuput.GetLength())
  239. {
  240. index = m_strOuput.Find("\r\n", index);
  241. if (index == -1)
  242. break;
  243. index += 2;
  244. count++;
  245. }
  246. if (index >0 && index < m_strOuput.GetLength())
  247. {
  248. m_strOuput.Delete(0, index);
  249. m_nLineCount -= count;
  250. }
  251. else
  252. {
  253. m_strOuput = "";
  254. m_nLineCount = 0;
  255. }
  256. }
  257. }
  258. #undef PREFIX_LEN
  259. LRESULT CMainFrame::OnListLeftItemchanged(NMHDR* phdr)
  260. {
  261. NMLISTVIEW* pnmlv = (NMLISTVIEW*) phdr;
  262. m_iSelectIdx = m_left_list.GetSelectedIndex();
  263. if (m_iSelectIdx != -1) {
  264. m_iSelectIdx = m_iSelectIdx * 2;
  265. }
  266. return 0;
  267. }
  268. LRESULT CMainFrame::OnListRightItemchanged(NMHDR* phdr)
  269. {
  270. NMLISTVIEW* pnmlv = (NMLISTVIEW*) phdr;
  271. m_iSelectIdx = m_right_list.GetSelectedIndex();
  272. if (m_iSelectIdx != -1) {
  273. m_iSelectIdx = m_iSelectIdx * 2+1;
  274. }
  275. return 0;
  276. }
  277. //LRESULT CMainFrame::OnSoftBoard()
  278. //{
  279. // ShellExecute(NULL, _T("open"), _T("osk.exe"), NULL, NULL, SW_SHOW);
  280. // return 0;
  281. //}
  282. LRESULT CMainFrame::OnListLeftItemclicked(NMHDR* phdr)
  283. {
  284. m_iSelectIdx = m_left_list.GetSelectedIndex();
  285. if (m_iSelectIdx != -1) {
  286. m_iSelectIdx = m_iSelectIdx * 2;
  287. }
  288. return 0;
  289. }
  290. LRESULT CMainFrame::OnListRightItemclicked(NMHDR* phdr)
  291. {
  292. m_iSelectIdx = m_right_list.GetSelectedIndex();
  293. if (m_iSelectIdx != -1) {
  294. m_iSelectIdx = m_iSelectIdx * 2+1;
  295. }
  296. return 0;
  297. }
  298. void CMainFrame::OnTimer(UINT_PTR nIDEvent)
  299. {
  300. if (m_bOperationPending) {
  301. }
  302. }
  303. void CMainFrame::StartEntity(const char *entity_name, const char *cmdline)
  304. {
  305. ErrorCodeEnum Error = m_pConsole->AsyncStartEntity(entity_name, cmdline, NULL);
  306. if (Error == Error_Succeed) {
  307. output_printf("starting %s\r\n", entity_name);
  308. m_bOperationPending = TRUE;
  309. SetTimer(0, 100, NULL);
  310. } else {
  311. output_printf("start %s failed, error = 0x%08X\r\n", entity_name, Error);
  312. }
  313. }
  314. void CMainFrame::StopEntity(const char *entity_name)
  315. {
  316. ErrorCodeEnum Error = m_pConsole->AsyncStopEntity(entity_name, NULL);
  317. if (Error == Error_Succeed) {
  318. output_printf("stopping %s\r\n", entity_name);
  319. m_bOperationPending = TRUE;
  320. SetTimer(0, 100, NULL);
  321. } else {
  322. output_printf("stop %s failed, error = 0x%08X\r\n", entity_name, Error);
  323. }
  324. }
  325. void CMainFrame::OnEditEnter(const char *tmp)
  326. {
  327. char entity[128];
  328. if (_strnicmp(tmp, "start", 5) == 0) { /* start entity */
  329. const char *p = tmp+5;
  330. while (*p == ' ') p++;
  331. if (sscanf(p, "%s", entity) == 1) {
  332. const char *cmdline = p + strlen(entity);
  333. while (*cmdline == ' ') cmdline++;
  334. StartEntity(entity, cmdline);
  335. } else {
  336. output_printf("invalid input format!\r\n");
  337. }
  338. } else if (_strnicmp(tmp, "stop", 4) == 0) { /* stop entity */
  339. const char *p = tmp+4;
  340. while (*p == ' ') p++;
  341. if (sscanf(p, "%s", entity) == 1) {
  342. StopEntity(entity);
  343. } else {
  344. output_printf("invalid input format!\r\n");
  345. }
  346. } else if (_strnicmp(tmp, "pause", 5) == 0) { /* pause entity */
  347. const char *p = tmp+5;
  348. while (*p == ' ') p++;
  349. if (sscanf(p, "%s", entity) == 1) {
  350. //PauseEntity(entity);
  351. } else {
  352. output_printf("invalid input format!\r\n");
  353. }
  354. } else if (_strnicmp(tmp, "continue", 8) == 0) { /* continue entity */
  355. const char *p = tmp+8;
  356. while (*p == ' ') p++;
  357. if (sscanf(p, "%s", entity) == 1) {
  358. //ContinueEntity(entity);
  359. } else {
  360. output_printf("invalid input format!\r\n");
  361. }
  362. } else if (_strnicmp(tmp, "terminate", 9) == 0) { /* terminate entity */
  363. const char *p = tmp+9;
  364. while (*p == ' ') p++;
  365. if (sscanf(p, "%s", entity) == 1) {
  366. //TerminateEntity(entity);
  367. } else {
  368. output_printf("invalid input format!\r\n");
  369. }
  370. } else if (_stricmp(tmp, "help") == 0 || _stricmp(tmp, "?") == 0) {
  371. Usage();
  372. }
  373. m_cmd.SetWindowText(NULL);
  374. }
  375. void CMainFrame::Usage()
  376. {
  377. output_printf("help -- display help usage\r\n");
  378. output_printf("start <Entity_Name> [arg1] [arg2] ... [argn] -- start entity with args[optional] \r\n");
  379. output_printf("stop <Entity_Name> -- stop entity\r\n");
  380. output_printf("pause <Entity_Name> -- pause entity\r\n");
  381. output_printf("continue <Entity_Name> -- pause entity\r\n");
  382. output_printf("terminate <Entity_Name> -- terminate entity\r\n");
  383. }
  384. HBRUSH CMainFrame::OnCtlColorEdit( CDCHandle dc, CEdit edit )
  385. {
  386. if (m_output.m_hWnd == edit.m_hWnd) {
  387. dc.SetTextColor(RGB(0, 255, 0));
  388. dc.SetBkColor(RGB(0,0,0));
  389. return (HBRUSH)GetStockObject(BLACK_BRUSH);
  390. } else {
  391. SetMsgHandled(FALSE);
  392. return 0;
  393. }
  394. }
  395. HBRUSH CMainFrame::OnCtlColorStatic( CDCHandle dc, CStatic wndStatic )
  396. {
  397. if (m_output.m_hWnd == wndStatic.m_hWnd) {
  398. dc.SetTextColor(RGB(0, 255, 0));
  399. dc.SetBkColor(RGB(0, 0, 0));
  400. return (HBRUSH)GetStockObject(BLACK_BRUSH);
  401. } else {
  402. SetMsgHandled(FALSE);
  403. return 0;
  404. }
  405. }
  406. void CMainFrame::OnOutputChanged( UINT uNotifyCode, int nID, CWindow wndCtl )
  407. {
  408. int n = m_output.GetWindowTextLength();
  409. m_strOuput.GetBufferSetLength(n);
  410. m_output.GetWindowText(m_strOuput.GetBufferSetLength(n), n+1);
  411. }
  412. void CMainFrame::OnStartMenuRange(UINT uNotifyCode, int nID, CWindow wndCtl)
  413. {
  414. CMenuHandle menuMain = GetMenu();
  415. CMenuHandle menuStartList = menuMain.GetSubMenu(2);
  416. WTL::CString strText;
  417. menuStartList.GetMenuStringA(nID, strText, MF_BYCOMMAND);
  418. if (strText.GetLength() > 0) {
  419. int m = strText.Find("\t", 0);
  420. if (m > 0) {
  421. strText = strText.Left(m);
  422. }
  423. const char *p = strchr(strText, ' ');
  424. if (p) {
  425. char name[128];
  426. memcpy(name, strText, p-(LPCSTR)strText);
  427. name[p-(LPCSTR)strText] = 0;
  428. p++;
  429. StartEntity(name, p);
  430. }
  431. }
  432. }
  433. void CCommandEdit::OnChar( UINT nChar, UINT nRepCnt, UINT nFlags )
  434. {
  435. if (nChar == VK_RETURN) {
  436. char tmp[512];
  437. int n = GetWindowText(tmp, sizeof(tmp));
  438. if (n <= 0)
  439. return;
  440. if (m_nHistorySize) {
  441. int last = (m_nHistoryHead + m_nHistorySize-1) % MAX_HISTORY;
  442. if (strcmp(tmp, m_strHistoryList[last]) != 0) {
  443. m_nHistoryCursor = (m_nHistoryHead + m_nHistorySize) % MAX_HISTORY;
  444. m_strHistoryList[m_nHistoryCursor] = tmp;
  445. m_nHistorySize = (m_nHistorySize + 1) % MAX_HISTORY;
  446. }
  447. } else {
  448. m_nHistoryCursor = (m_nHistoryHead + m_nHistorySize) % MAX_HISTORY;
  449. m_strHistoryList[m_nHistoryCursor] = tmp;
  450. m_nHistorySize = (m_nHistorySize + 1) % MAX_HISTORY;
  451. }
  452. m_frm->OnEditEnter(tmp);
  453. SetWindowText(NULL);
  454. } else {
  455. SetMsgHandled(FALSE);
  456. }
  457. }
  458. //
  459. //void CCommandEdit::OnKeyDown( UINT nChar, UINT nRepCnt, UINT nFlags )
  460. //{
  461. // int last = m_nHistoryCursor;
  462. //
  463. // if (nChar == VK_UP) {
  464. // if (m_nHistoryCursor != m_nHistoryHead)
  465. // m_nHistoryCursor = (m_nHistoryCursor + MAX_HISTORY - 1) % MAX_HISTORY;
  466. // SetWindowText(m_strHistoryList[last]);
  467. // } else if (nChar == VK_DOWN) {
  468. // if (m_nHistorySize && (m_nHistoryCursor != (m_nHistoryHead+m_nHistorySize-1) % MAX_HISTORY))
  469. // m_nHistoryCursor = (m_nHistoryCursor + 1) % MAX_HISTORY;
  470. // SetWindowText(m_strHistoryList[last]);
  471. // } else {
  472. // SetMsgHandled(FALSE);
  473. // }
  474. //}