我试图用找PROCESS的方法但是没实现,已知IE的程序名就是iexplorer.exe

解决方案 »

  1.   

    // This disables all of the windows in the system if called
    // after the application window is created and enables them
    // when the application window is destroyed.
    BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam)
    { //根据 hwnd取得Class名字IEFrame
    return TRUE;
    }   EnumWindows(EnumWindowsProc , 0);} 或者FindWindow查Class名字为IEFrame的窗口
        CWnd *pWndPrev;
     
        // Determine if another window with your class name exists...
        if (pWndPrev = CWnd::FindWindow(_T("IEFrame"),NULL))
        {
            // Bring previous instance to the foreground
    //找到IE
    pWndPrev->SetForegroundWindow();
    return FALSE;
        }
      

  2.   

    对啊,我怎么忘了FINDWINDOW了,谢谢老兄接分。
      

  3.   

    Q176792
    HOWTO: Connect to a Running Instance of Internet Explorer