suntoryDlg.cpp
上传用户:ayxnkj
上传日期:2022-06-19
资源大小:11910k
文件大小:7k
- // suntoryDlg.cpp : implementation file
- //
- #include "stdafx.h"
- #include "suntory.h"
- #include "suntoryDlg.h"
- #include "ReadIEKey.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #endif
- // CsuntoryDlg dialog
- CsuntoryDlg::CsuntoryDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CsuntoryDlg::IDD, pParent)
- {
- m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
- }
- void CsuntoryDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- DDX_Control(pDX, IDC_LIST2, m_MyList);
- DDX_Control(pDX, IDC_LIST3, m_MyList2);
- }
- BEGIN_MESSAGE_MAP(CsuntoryDlg, CDialog)
- ON_WM_PAINT()
- ON_WM_QUERYDRAGICON()
- //}}AFX_MSG_MAP
- ON_BN_CLICKED(IDOK4, &CsuntoryDlg::OnBnClickedOk4)
- ON_BN_CLICKED(IDOK3, &CsuntoryDlg::OnBnClickedOk3)
- ON_BN_CLICKED(IDOK2, &CsuntoryDlg::OnBnClickedOk2)
- ON_BN_CLICKED(IDOK, &CsuntoryDlg::OnBnClickedOk)
- END_MESSAGE_MAP()
- // CsuntoryDlg message handlers
- BOOL CsuntoryDlg::OnInitDialog()
- {
- CDialog::OnInitDialog();
- // Set the icon for this dialog. The framework does this automatically
- // when the application's main window is not a dialog
- SetIcon(m_hIcon, TRUE); // Set big icon
- SetIcon(m_hIcon, FALSE); // Set small icon
- // TODO: Add extra initialization here
- m_MyList.InsertColumn(0,L"Search Keyword",LVCFMT_LEFT,100,-1);
- m_MyList.InsertColumn(1,L"Times",LVCFMT_LEFT,100,-1);
- m_MyList.InsertColumn(2,L"Data And Time",LVCFMT_LEFT,100,-1);
- m_MyList2.InsertColumn(0,L"Start Stop",LVCFMT_LEFT,100,-1);
- m_MyList2.InsertColumn(1,L"End Stop",LVCFMT_LEFT,100,-1);
- m_MyList2.InsertColumn(2,L"Times",LVCFMT_LEFT,100,-1);
- m_MyList2.InsertColumn(3,L"Data And Time",LVCFMT_LEFT,100,-1);
- return TRUE; // return TRUE unless you set the focus to a control
- }
- // If you add a minimize button to your dialog, you will need the code below
- // to draw the icon. For MFC applications using the document/view model,
- // this is automatically done for you by the framework.
- void CsuntoryDlg::OnPaint()
- {
- if (IsIconic())
- {
- CPaintDC dc(this); // device context for painting
- SendMessage(WM_ICONERASEBKGND, reinterpret_cast<WPARAM>(dc.GetSafeHdc()), 0);
- // Center icon in client rectangle
- int cxIcon = GetSystemMetrics(SM_CXICON);
- int cyIcon = GetSystemMetrics(SM_CYICON);
- CRect rect;
- GetClientRect(&rect);
- int x = (rect.Width() - cxIcon + 1) / 2;
- int y = (rect.Height() - cyIcon + 1) / 2;
- // Draw the icon
- dc.DrawIcon(x, y, m_hIcon);
- }
- else
- {
- CDialog::OnPaint();
- }
- }
- // The system calls this function to obtain the cursor to display while the user drags
- // the minimized window.
- HCURSOR CsuntoryDlg::OnQueryDragIcon()
- {
- return static_cast<HCURSOR>(m_hIcon);
- }
- void CsuntoryDlg::OnBnClickedOk4()
- {
- // TODO: Add your control notification handler code here
- int i,Count;
- int Pos;
- char szBuf[100];
- WCHAR szTimeBuf[100];
- SYSTEMTIME st={0};
- m_MyList.ShowWindow(SW_HIDE);
- m_MyList2.ShowWindow(SW_SHOWNORMAL);
- m_MyList.DeleteAllItems();
- m_MyList2.DeleteAllItems();
- CReadIEKey readIEKey;
- readIEKey.GetMostnBus();
- memset(szBuf,0,100);
- memset(szTimeBuf,0,100);
- if(readIEKey.m_KeyNum > 6)
- Count = 6;
- else
- Count = readIEKey.m_KeyNum;
- for(i=0 ; i<Count ; i++)
- {
- sprintf(szBuf,"%d",readIEKey.m_KeyBusInfo[i].FindNum);
- FileTimeToSystemTime(&readIEKey.m_KeyBusInfo[i].VisitTime, &st);
- wsprintf(szTimeBuf, L"%d/%d/%d %d:%d:%d",
- st.wYear,st.wMonth, st.wDay,st.wHour, st.wMinute,st.wSecond);
- Pos=m_MyList2.InsertItem(i,LPCTSTR(readIEKey.m_KeyBusInfo[i].sKeyStartBus));
- m_MyList2.SetItemText(Pos,1,LPCTSTR(readIEKey.m_KeyBusInfo[i].sKeyEndBus));
- m_MyList2.SetItemText(Pos,2,LPCTSTR(szBuf));
- m_MyList2.SetItemText(Pos,3,LPCTSTR(szTimeBuf));
- }
- }
- void CsuntoryDlg::OnBnClickedOk3()
- {
- // TODO: Add your control notification handler code here
- int i,Count;
- int Pos;
- char szBuf[100];
- WCHAR szTimeBuf[100];
- SYSTEMTIME st={0};
- m_MyList.ShowWindow(SW_HIDE);
- m_MyList2.ShowWindow(SW_SHOWNORMAL);
- m_MyList.DeleteAllItems();
- m_MyList2.DeleteAllItems();
- CReadIEKey readIEKey;
- readIEKey.GetLastnBus();
- memset(szBuf,0,100);
- memset(szTimeBuf,0,100);
- if(readIEKey.m_KeyNum > 6)
- Count = 6;
- else
- Count = readIEKey.m_KeyNum;
- for(i=0 ; i<Count ; i++)
- {
- sprintf(szBuf,"%d",readIEKey.m_KeyBusInfo[i].FindNum);
- FileTimeToSystemTime(&readIEKey.m_KeyBusInfo[i].VisitTime, &st);
- wsprintf(szTimeBuf, L"%d/%d/%d %d:%d:%d",
- st.wYear,st.wMonth, st.wDay,st.wHour, st.wMinute,st.wSecond);
- Pos=m_MyList2.InsertItem(i,LPCTSTR(readIEKey.m_KeyBusInfo[i].sKeyStartBus));
- m_MyList2.SetItemText(Pos,1,LPCTSTR(readIEKey.m_KeyBusInfo[i].sKeyEndBus));
- m_MyList2.SetItemText(Pos,2,LPCTSTR(szBuf));
- m_MyList2.SetItemText(Pos,3,LPCTSTR(szTimeBuf));
- }
- }
- void CsuntoryDlg::OnBnClickedOk2()
- {
- // TODO: Add your control notification handler code here
- int i,Count;
- int Pos;
- char szBuf[100];
- WCHAR szTimeBuf[100];
- SYSTEMTIME st={0};
- CReadIEKey readIEKey;
- readIEKey.GetMostnKeyWord();
- m_MyList2.ShowWindow(SW_HIDE);
- m_MyList.ShowWindow(SW_SHOWNORMAL);
- m_MyList.DeleteAllItems();
- m_MyList2.DeleteAllItems();
- memset(szBuf,0,100);
- memset(szTimeBuf,0,100);
- if(readIEKey.m_KeyNum > 6)
- Count = 6;
- else
- Count = readIEKey.m_KeyNum;
- for(i=0 ; i<Count ; i++)
- {
- sprintf(szBuf,"%d",readIEKey.m_KeyInfo[i].FindNum);
- FileTimeToSystemTime(&readIEKey.m_KeyInfo[i].VisitTime, &st);
- wsprintf(szTimeBuf, L"%d/%d/%d %d:%d:%d",
- st.wYear,st.wMonth, st.wDay,st.wHour, st.wMinute,st.wSecond);
- Pos=m_MyList.InsertItem(i,LPCTSTR(readIEKey.m_KeyInfo[i].sKeyName));
- m_MyList.SetItemText(Pos,1,LPCTSTR(szBuf));
- m_MyList.SetItemText(Pos,2,LPCTSTR(szTimeBuf));
- }
- }
- void CsuntoryDlg::OnBnClickedOk()
- {
- // TODO: Add your control notification handler code here
- int i,Count;
- int Pos;
- char szBuf[100];
- WCHAR szTimeBuf[100];
- SYSTEMTIME st={0};
- CReadIEKey readIEKey;
- readIEKey.GetLastnKeyWord();
-
- m_MyList2.ShowWindow(SW_HIDE);
- m_MyList.ShowWindow(SW_SHOWNORMAL);
- m_MyList.DeleteAllItems();
- m_MyList2.DeleteAllItems();
- memset(szBuf,0,100);
- memset(szTimeBuf,0,100);
- if(readIEKey.m_KeyNum > 6)
- Count = 6;
- else
- Count = readIEKey.m_KeyNum;
- for(i=0 ; i<Count ; i++)
- {
- sprintf(szBuf,"%d",readIEKey.m_KeyInfo[i].FindNum);
- FileTimeToSystemTime(&readIEKey.m_KeyInfo[i].VisitTime, &st);
- wsprintf(szTimeBuf, L"%d/%d/%d %d:%d:%d",
- st.wYear,st.wMonth, st.wDay,st.wHour, st.wMinute,st.wSecond);
- Pos=m_MyList.InsertItem(i,LPCTSTR(readIEKey.m_KeyInfo[i].sKeyName));
- m_MyList.SetItemText(Pos,1,LPCTSTR(szBuf));
- m_MyList.SetItemText(Pos,2,LPCTSTR(szTimeBuf));
- }
-
- }