BOOL CVideoPane::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here // 获取参数 CRect rect; GetClientRect(rect); CString strOcxPath = eLTE_Tool::GetOcxPath(); // 设置图标 Gdiplus::Bitmap* pBitmap = Gdiplus::Bitmap::FromFile(strOcxPath + _T("Skin\\Icon.ico")); if (NULL != pBitmap && Gdiplus::Ok == pBitmap->GetLastStatus()) { HICON hIcon = NULL; pBitmap->GetHICON(&hIcon); if (NULL != hIcon) { SetIcon(hIcon, FALSE); // Set small icon SetIcon(hIcon, TRUE); // Set big icon } } // 显示边框 ModifyStyle(0, WS_BORDER); SetWindowPos(NULL, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_DRAWFRAME); // 创建标题栏 CreateCaption(rect, strOcxPath); // 创建视频窗口 CreateVideoStatic(rect, strOcxPath); // 创建工具栏 CreateToolBar(rect, strOcxPath); // 禁用按钮 EnableImageButton(FALSE); // 工具栏隐藏 if (!m_bShowToolBar) { m_SnapshotBtn.ShowWindow(SW_HIDE); m_ReversePlayBtn.ShowWindow(SW_HIDE); m_FullScreenBtn.ShowWindow(SW_HIDE); m_AudioBtn.ShowWindow(SW_HIDE); } return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
BOOL CMainDlg::OnInitDialog() { CDialog::OnInitDialog(); m_BitmapBk.LoadBitmap(IDB_MAIN); ::SetWindowLong(m_hWnd, GWL_STYLE, WS_POPUP | WS_SYSMENU | WS_MINIMIZEBOX); CRect rect; GetClientRect(&rect); rect.bottom -= 3; rect.right -= 2; MoveWindow(&rect); CenterWindow(); SetMoveParent(FALSE); SetIcon(AfxGetApp()->LoadIcon(IDR_MAINFRAME), TRUE); SetWindowText(WINDOW_CAPTION); CreateCaption(WINDOW_CAPTION); SetButton(&m_Button[BUTTON_MONITOR], IDC_MONITOR); SetButton(&m_Button[BUTTON_LOG], IDC_LOG); SetButton(&m_Button[BUTTON_ACL], IDC_ACL); SetButton(&m_Button[BUTTON_SYSTEMSET], IDC_SYSTEMSET); SetButton(&m_Button[BUTTON_ONLINE], IDC_ONLINE); SetButton(&m_Button[BUTTON_HELP], IDHELP); SetButton(&m_Button[BUTTON_ABOUT], IDC_ABOUT); SetButton(&m_Button[BUTTON_PARAMETER], IDC_PARAMETER); m_ButtonClose.SubclassDlgItem(IDC_CLOSE, this); m_ButtonClose.SetBitmaps(IDB_CLOSE); m_ButtonClose.SetToolTipText(BUTTON_CAPTION_HIDE); m_ButtonMin.SubclassDlgItem(IDC_MIN, this); m_ButtonMin.SetBitmaps(IDB_MIN); m_ButtonMin.SetToolTipText(BUTTON_CAPTION_MIN); m_ButtonTopMost.SubclassDlgItem(IDC_TOPMOST, this); m_ButtonTopMost.SetBitmaps(IDB_TOPMOST_NORMAL); m_ButtonTopMost.SetToolTipText(BUTTON_CAPTION_TOPMOST); m_ButtonPasseck.SubclassDlgItem(IDC_PASSECK, this); m_ButtonPasseck.SetBitmaps(IDB_PASSECK_FOCUS, IDB_PASSECK_NORMAL); m_ButtonPasseck.DrawBorder(FALSE); m_ButtonPasseck.SetBtnCursor(IDC_HAND); m_ButtonLamp[WORKMODE_PASSALL].SetLamp(IDC_GREEN, IDB_GREEN_FOCUS, IDB_GREEN_NORMAL, IDB_GREEN_SELECT, BUTTON_CAPTION_GREEN, this); m_ButtonLamp[WORKMODE_FILTER].SetLamp(IDC_YELLOW, IDB_YELLOW_FOCUS, IDB_YELLOW_NORMAL, IDB_YELLOW_SELECT, BUTTON_CAPTION_YELLOW, this); m_ButtonLamp[WORKMODE_DENYALL].SetLamp(IDC_RED, IDB_RED_FOCUS, IDB_RED_NORMAL, IDB_RED_SELECT, BUTTON_CAPTION_RED, this); SetLampSelect(theApp.m_AclFile.GetHeader()->bWorkMode); m_SubParent.SubclassDlgItem(IDC_SUB_PARENT, this); m_ParameterSub.Create(IDD_PARAMETER_SUB, &m_SubParent); m_AclSub.Create(IDD_ACL_SUB, &m_SubParent); m_MonitorSub.Create(IDD_MONITOR_SUB, &m_SubParent); m_LogSub.Create(IDD_LOG_SUB, &m_SubParent); m_SystemSet.Create(IDD_SYSTEM_SET, &m_SubParent); m_OnLine.Create(IDD_ONLINE, &m_SubParent); m_About.Create(IDD_ABOUT, &m_SubParent); OnParameter(); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }