| 156 | // CMatchToolDlg 訊息處理常式 |
| 157 | |
| 158 | BOOL CMatchToolDlg::OnInitDialog() |
| 159 | { |
| 160 | CDialogEx::OnInitDialog(); |
| 161 | // 設定此對話方塊的圖示。當應用程式的主視窗不是對話方塊時, |
| 162 | // 框架會自動從事此作業 |
| 163 | SetIcon(m_hIcon, TRUE); // 設定大圖示 |
| 164 | SetIcon(m_hIcon, FALSE); // 設定小圖示 |
| 165 | // TODO: 在此加入額外的初始設定 |
| 166 | |
| 167 | namedWindow ("SrcView", WINDOW_AUTOSIZE); |
| 168 | HWND hWnd = (HWND)cvGetWindowHandle ("SrcView"); |
| 169 | HWND hParent = (HWND)FindWindow (NULL, L"SrcView"); |
| 170 | HWND hOrgParent = ::SetParent (hWnd, GetDlgItem (IDC_STATIC_SRC_VIEW)->m_hWnd); |
| 171 | ::ShowWindow (hOrgParent, SW_HIDE); |
| 172 | |
| 173 | |
| 174 | |
| 175 | namedWindow ("DstView", WINDOW_AUTOSIZE); |
| 176 | hWnd = (HWND)cvGetWindowHandle ("DstView"); |
| 177 | hParent = (HWND)FindWindow (NULL, L"DstView"); |
| 178 | hOrgParent = ::SetParent (hWnd, GetDlgItem (IDC_STATIC_DST_VIEW)->m_hWnd); |
| 179 | ::ShowWindow (hOrgParent, SW_HIDE); |
| 180 | |
| 181 | //菜單 |
| 182 | m_Menu.LoadMenuW (IDR_MENU_FILE); |
| 183 | SetMenu (NULL); |
| 184 | SetMenu (&m_Menu); |
| 185 | |
| 186 | |
| 187 | //拖曳檔案 |
| 188 | DragAcceptFiles (); |
| 189 | //訊息 |
| 190 | m_listMsg.InsertColumn (0, m_strLanIndex, LVCFMT_CENTER, 50); |
| 191 | m_listMsg.InsertColumn (1, m_strLanScore, LVCFMT_CENTER, 70); |
| 192 | m_listMsg.InsertColumn (2, m_strLanAngle, LVCFMT_CENTER, 100); |
| 193 | m_listMsg.InsertColumn (3, m_strLanPosX, LVCFMT_CENTER, 110); |
| 194 | m_listMsg.InsertColumn (4, m_strLanPosY, LVCFMT_CENTER, 110); |
| 195 | |
| 196 | m_listMsg.SetExtendedStyle (LVS_EX_FULLROWSELECT | LVS_EX_INFOTIP | LVS_EX_GRIDLINES); |
| 197 | m_iMessageCount = 0; |
| 198 | //狀態欄 |
| 199 | CRect rect, rectState; |
| 200 | GetClientRect (rect); |
| 201 | static UINT indicators[] = { |
| 202 | IDS_STRING_EXCUTE_TIME, |
| 203 | IDS_STRING_SRC_SIZE, |
| 204 | IDS_STRING_DST_SIZE, |
| 205 | IDS_STRING_POS |
| 206 | }; |
| 207 | |
| 208 | if (!m_statusBar.Create (this) || !m_statusBar.SetIndicators (indicators, sizeof (indicators) / sizeof (UINT))) |
| 209 | { |
| 210 | TRACE0 ("Can't create status bar\n"); |
| 211 | return false; |
| 212 | } |
| 213 | m_statusBar.SetPaneInfo (0, indicators[0], SBPS_NOBORDERS, 150);//设置状态栏的宽度 |
| 214 | m_statusBar.SetPaneInfo (1, indicators[1], SBPS_STRETCH, 200); |
| 215 | m_statusBar.SetPaneInfo (2, indicators[2], SBPS_STRETCH, 200); |