void CXxxxxxxxxDlg::OnButton22() 
{
// TODO: Add your control notification handler code here
HRESULT hr; CComPtr< IHTMLFramesCollection2 > spFramesCollection2;
pdz->get_frames( &spFramesCollection2 ); //取得框架frame的集合 long nFrameCount=0; //取得子框架个数
hr = spFramesCollection2->get_length( &nFrameCount );
if ( FAILED ( hr ) || 0 == nFrameCount ) return; for(long i=0; i<nFrameCount; i++)
{
CComVariant vDispWin2; //取得子框架的自动化接口
hr = spFramesCollection2->item( &CComVariant(i), &vDispWin2 );
if ( FAILED ( hr ) ) continue; CComQIPtr< IHTMLWindow2 > spWin2 = vDispWin2.pdispVal;
if( !spWin2 ) continue; //取得子框架的 IHTMLWindow2 接口 CComPtr < IHTMLDocument2 > spDoc2;
spWin2->get_document( &spDoc2 ); //取得字框架的 IHTMLDocument2 接口
if( spDoc2==NULL ) continue;
//==========================================
try
{
IPersistStream * spPSI=NULL;
HRESULT hr=spDoc2->QueryInterface(IID_IPersistStream, (void**)&spPSI);
if( SUCCEEDED(hr) && spPSI )
{
if(spPSI->IsDirty()==S_OK)::MessageBox(NULL,"yyyyyyyyyyyy。","提示",MB_OK);
else ::MessageBox(NULL,"nnnnnnnnnnn。","提示",MB_OK);
spPSI->Release();
}
}
catch(...){}
//=========================================================
}//for(long i=0; i<nFrameCount; i++)
if(spFramesCollection2)spFramesCollection2.Release();
}