在javascript中,有以下方法
window.screen.height
window.screen.width
window.screen.availHeight
window.screen.availWidth
window.screen.colorDepth
date.getTimezoneOffset();
navigator.javaEnabled();分别是用来获取屏幕的某些属性和时区及浏览器是否支持java等系统信息的方法。如何用VC实现同样的功能?

解决方案 »

  1.   

    IHTMLScreen::height 
    IHTMLScreen::width
    IHTMLScreen::availHeight
    IHTMLScreen::availWidth
    IHTMLScreen::colorDepth
      

  2.   

    msdn.microsoft.com/workshop/browser/ mshtml/reference/ifaces/screen/screen.asp
      

  3.   

    使用 Visual Studio .NET 中创建 MFC 应用程序,选择基于对话框,把对话框的基类选择为 CDHtmlDialog。
    在对话框上新增按钮,处理按钮单击事件,添加代码:
    CComPtr<IHTMLDocument2> pDocument;
    CComPtr<IHTMLWindow2> pWindow;
    CComPtr<IHTMLScreen> pScreen;
    HRESULT hr = S_OK; hr = GetDHtmlDocument( &pDocument );
    if ( S_OK != hr )
    return; hr = pDocument -> get_parentWindow( &pWindow );
    if ( S_OK != hr )
    return; hr = pWindow -> get_screen( &pScreen );
    if ( S_OK != hr )
    return; long colorDepth = 0;
    hr = pScreen -> get_colorDepth( &colorDepth );
    if ( S_OK != hr )
    return; CString str;
    str.Format( "colorDepth:%ld", colorDepth );
    AfxMessageBox( str );