int CWebWindow::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (WEB_WINDOW_PARENT::OnCreate(lpCreateStruct) == -1) return -1; // Get IE version CString str; McRegGetString(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Microsoft\\Internet Explorer"), _T("Version"), str, NULL); long nMajor=0, nMinor=0; if(!str.IsEmpty()) _stscanf((LPCTSTR)str, _T("%d.%d"), &nMajor, &nMinor); m_nIEVersion = nMajor * 100 + nMinor; if(!m_bChild) AddWindowToClose(this); // m_browser.Create(NULL, WS_VISIBLE|WS_CHILD, CRect(0,0,0,0), this, ID_DHTML_CTRL); HRESULT hr = m_pWebCustomizer.CreateInstance(CLSID_MpaWebCustomizer); if(FAILED(hr)) return -1; // LPUNKNOWN pDispatch = m_browser.GetControlUnknown(); // m_pWebCustomizer->PutRefWebBrowser((LPDISPATCH)pDispatch); m_MpaWebEvent.m_pParent = this; InitMpaWebEvent(); return 0; }
BOOL CInviteChatDlg::OnInitDialog() { CResizableDialog::OnInitDialog(); HRESULT hr = m_pWebCustomizer.CreateInstance(CLSID_MpaWebCustomizer); LPUNKNOWN pDispatch = m_edit.GetControlUnknown(); m_pWebCustomizer->PutRefWebBrowser((LPDISPATCH)pDispatch); InitMpaWebEvent(); pSession = theNet2.GetSession(); ASSERT(pSession!=NULL); SetIcon(AfxGetApp()->LoadIcon(IDR_MAINFRAME),FALSE); SetIcon(AfxGetApp()->LoadIcon(IDR_MAINFRAME),TRUE); CRect winRect; GetWindowRect(&winRect); CRect rTmp(15,70,winRect.Width()-15,winRect.Height()-50); CRect r; AddAnchor(m_Nick.GetSafeHwnd(), CSize(0,0), CSize(0,0)); AddAnchor(m_edit.GetSafeHwnd(), CSize(0,0), CSize(100,100)); AddAnchor(m_Deny.GetSafeHwnd(), CSize(100,100), CSize(100,100)); AddAnchor(m_Accept.GetSafeHwnd(), CSize(100,100), CSize(100,100)); AddAnchor(m_Details.GetSafeHwnd(), CSize(0,100), CSize(0,100)); AddAnchor(m_ChatDetails.GetSafeHwnd(), CSize(0,100), CSize(0,100)); CString strRect = GetOptionString(IDS_OFSMESSENGER, IDS_INVITE_CHAT, _T("")); if(!strRect.IsEmpty()) { CRect rWindow = StringToRect(strRect); FitRectToWindow(rWindow); SetWindowPos(NULL,rWindow.left,rWindow.top,rWindow.Width(),rWindow.Height(),SWP_NOZORDER|SWP_NOACTIVATE); } m_Nick.Invalidate(FALSE); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
BOOL CAddUserRequest::OnInitDialog() { CResizableDialog::OnInitDialog(); HRESULT hr = m_pWebCustomizer.CreateInstance(CLSID_MpaWebCustomizer); LPUNKNOWN pDispatch = m_edit.GetControlUnknown(); m_pWebCustomizer->PutRefWebBrowser((LPDISPATCH)pDispatch); InitMpaWebEvent(); pSession = theNet2.GetSession(); ASSERT(pSession!=NULL); SetIcon(AfxGetApp()->LoadIcon(IDR_MAINFRAME),FALSE); SetIcon(AfxGetApp()->LoadIcon(IDR_MAINFRAME),TRUE); // LoadSkin(); CRect winRect; GetWindowRect(&winRect); CRect rTmp(15,70,winRect.Width()-15,winRect.Height()-50); //m_edit.Create(NULL,NULL,WS_VISIBLE|WS_BORDER,rTmp,this,IDC_DHTML_EDIT); //m_edit.SetContextMenu(IDR_MESSENGER_MENU,1,this); //m_edit.SetViewMode(); // [4/29/2002] //m_edit.SetDefaultFontName(L"Arial"); //m_edit.SetDefaultFontSize(nFontSizes[GetOptionInt(IDS_OFSMESSENGER,IDS_SIZE,1)]); // [4/29/2002] // m_Nick.SetWindowPos(NULL,18,43,winRect.Width()-36,16,SWP_NOZORDER|SWP_NOACTIVATE); // m_Nick.SetTextColor(0xffffff); // m_Nick.SetTransparent(TRUE); // m_Close.SetAutoPressed(TRUE); // m_Close.SetCanStayPressed(FALSE); // m_Mini.SetAutoPressed(TRUE); // m_Mini.SetCanStayPressed(FALSE); // m_Deny.SetAutoPressed(TRUE); // m_Deny.SetCanStayPressed(FALSE); // m_AddToContact.SetAutoPressed(TRUE); // m_AddToContact.SetCanStayPressed(FALSE); // m_Accept.SetAutoPressed(TRUE); // m_Accept.SetCanStayPressed(FALSE); // m_Details.SetAutoPressed(TRUE); // m_Details.SetCanStayPressed(FALSE); // m_Deny.SetWindowPos(NULL,winRect.Width()-91,winRect.Height()-38,0,0,SWP_NOZORDER|SWP_NOSIZE|SWP_NOACTIVATE); // m_AddToContact.SetWindowPos(NULL,winRect.Width()-91,winRect.Height()-38,0,0,SWP_NOZORDER|SWP_NOSIZE|SWP_NOACTIVATE|SWP_HIDEWINDOW); // m_Accept.SetWindowPos(NULL,winRect.Width()-170,winRect.Height()-38,0,0,SWP_NOZORDER|SWP_NOSIZE|SWP_NOACTIVATE); // m_Details.SetWindowPos(NULL,15,winRect.Height()-38,0,0,SWP_NOZORDER|SWP_NOSIZE|SWP_NOACTIVATE); CRect r; //m_frameEdit.GetWindowRect(&r); //ScreenToClient(&r); //m_edit.SetWindowPos(NULL, r.left, r.top, r.Width(), r.Height(), SWP_NOZORDER); AddAnchor(m_edit.GetSafeHwnd(), CSize(0,0), CSize(100,100)); AddAnchor(m_Deny.GetSafeHwnd(), CSize(100,100), CSize(100,100)); AddAnchor(m_AddToContact.GetSafeHwnd(), CSize(100,100), CSize(100,100)); AddAnchor(m_Accept.GetSafeHwnd(), CSize(100,100), CSize(100,100)); AddAnchor(m_Details.GetSafeHwnd(), CSize(0,100), CSize(0,100)); CString strRect = GetOptionString(IDS_OFSMESSENGER, IDS_ADD_FRIENDR, _T("")); if(!strRect.IsEmpty()) { CRect rWindow = StringToRect(strRect); FitRectToWindow(rWindow); SetWindowPos(NULL,rWindow.left,rWindow.top,rWindow.Width(),rWindow.Height(),SWP_NOZORDER|SWP_NOACTIVATE); } //m_edit.Clear(); //m_edit.SetFocus(); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }