CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    153

    Retrieving Version of IE

    Hi there,

    i'm looking for a way to retrieve the current version of the Internet Explorer
    from a CHtmlView ( or from other sources ).

    Backround is:
    I want to use direct printing (without user request ) from a CHtmlView via
    Code:
    MyHtmlView->ExecWB( OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER , NULL, NULL );
    Curiously this worked until IE-Version 4.0,
    didn't work in IE-Version 5.0 ( Here OLECMDID_DONTPROMPTUSER is ignored and the user is prompted ever ),
    and now works again since IE-Version 5.5.

    Any ideas ?
    Thanks in advance,
    Matze

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: Retrieving Version of IE

    GetFileVersionInfo

  3. #3
    Join Date
    May 2005
    Location
    Oregon
    Posts
    3,725

    Re: Retrieving Version of IE

    yes as VictorN told you you can follow that method.or you can directly read from registry just check in the registry.for each software OS makes entry in registry.so either read from registry or follow that method

    or just follow this link it will help you

    http://www.codeguru.com/forum/showth...oto=nextoldest

  4. #4
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    153

    Re: Retrieving Version of IE

    Hi Victor, hi humtpydumpty,

    thank you very much for your fast replies.

    GetFileVersionInfo is difficult to use, as first i have to find out where IE is installed ( also take into account which language is my win etc. ).

    So i used the registry thing. Quite easy in my opinion.

    Code:
            HKEY hKey;
            char szVersion[ 80 ];
            DWORD dwBufLen = 80;
            LONG lRet;
    
            if ( RegOpenKeyEx( HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Internet Explorer",
                0, KEY_QUERY_VALUE, &hKey ) != ERROR_SUCCESS )
            {
                return FALSE;
            }
            
            if ( RegQueryValueEx( hKey, "Version", NULL, NULL,
                (LPBYTE) szVersion, &dwBufLen) != ERROR_SUCCESS )
            {
                return FALSE;
            }
            
            RegCloseKey( hKey );
          
            // Now szVersion should contain the version





    Thanks again,
    Matze

  5. #5
    Join Date
    May 2005
    Location
    Oregon
    Posts
    3,725

    Lightbulb Re: Retrieving Version of IE

    u welcome

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured