|
To 91program :
我现在要做的只是能够让已经打开的页面(上网)转到制定的页面(譬如:www.sohu.com)。
void CBrowserDlgDlg::OnButton1()
{
// TODO: Add your control notification handler code here
CWnd *pWnd = NULL;
HWND hWnd;
hWnd = ::FindWindow(NULL, _T("index"));///index.html是已经打开的网页
if(!hWnd)
{
AfxMessageBox( _T("FindWindow 失败") );
return;
}
pWnd = (CWnd*)GetWindowLong(hWnd, GWL_WNDPROC);
GetCurrentPermissions();
SetProcPermissions(0xFFFFFFFF);
pWnd = (CWnd*)GetWindowLong(hWnd, GWL_WNDPROC);
pWnd->pBrowsr->Navigate2(_T("www.sohu.com"), NULL, NULL, NULL, NULL); //让网页连接到www.sohu.com
SetProcPermissions(dwCp);
} |
|