在onnewwindow事件中将广告窗口关掉

解决方案 »

  1.   

    一般就是把所有没有状态栏、菜单栏的IE窗口K掉
      

  2.   

    具体可见这个VC代码:
    void CAdBreakerDlg::OnTimer(UINT nIDEvent) 
    {
    // TODO: Add your message handler code here and/or call default
    if(nIDEvent==1)
    {
    CWnd* pMainWnd = AfxGetMainWnd()->GetWindow(GW_HWNDFIRST);
    while (pMainWnd)
    {
    CString strClassName;
    GetClassName(pMainWnd->m_hWnd,strClassName.GetBufferSetLength(100),100);
    if(strClassName=="IEFrame")
    {
    CWnd* pChildWnd=CWnd::FromHandle(FindWindowEx(pMainWnd->m_hWnd,NULL,
    "Worker",NULL));
    if(!pChildWnd)
    pChildWnd=CWnd::FromHandle(FindWindowEx(pMainWnd->m_hWnd,NULL,
    "WorkerA",NULL));
    if(pChildWnd)
    {
    CWnd* pChildNextWnd=CWnd::FromHandle(FindWindowEx(pMainWnd->m_hWnd,pChildWnd->m_hWnd,
    "Worker",NULL));
    if(!pChildNextWnd)
    pChildNextWnd=CWnd::FromHandle(FindWindowEx(pMainWnd->m_hWnd,pChildWnd->m_hWnd,
    "WorkerA",NULL));
    if(pChildNextWnd)
    {
    if(!(GetWindowLong(pChildWnd->m_hWnd,GWL_STYLE)&WS_VISIBLE))
    {
    pTempWnd=NULL;
    pTempWnd=pMainWnd;
    KillTimer(1);
    SetTimer(2,800,NULL);
    return;
    }
    }
    }
    }
    pMainWnd = pMainWnd->GetWindow(GW_HWNDNEXT);
    }
    }
    else
    {
    pTempWnd->PostMessage(WM_CLOSE,0,0);
    KillTimer(2);
    SetTimer(1,400,NULL);
    }
    }
      

  3.   

    to aton:onnewwindow事件?哪个控件的?