Page 1 of 1

How to know which version of IE are webgadget using?

Posted: Fri May 06, 2005 2:05 am
by ricardo
Hi,

How to know which version of IE are webgadget using?

I need to know because i notice many differences in the behavior depending on the IE version/subversion SP1/2, etc. How can i get it from PB?

Thanks in advance

Posted: Fri May 06, 2005 9:35 am
by akee
I'm sure there is a better method but this works... ;)

The PB code.

Code: Select all

If OpenWindow(0,0,0,600,300,#PB_Window_SystemMenu|#PB_Window_ScreenCentered,"WebGadget") And CreateGadgetList(WindowID(0))
  WebGadget(0,10,10,580,280,"C:\PutVerInURL.htm")
  Repeat
    Version.s = GetGadgetText(0)
  Until WaitWindowEvent()=#PB_Event_CloseWindow Or (FindString(Version, "about", 1) >= 1)
  Version = Mid(Version, FindString(Version, "?", 1) + 1, Len(Version))
  Version = ReplaceString(Version, "%20", " ")
EndIf
Debug Version

C:\PutVerInURL.htm

Code: Select all

<html>
<head>
</head>
<body>
<script language="JavaScript">
  location.href = "about:blank?" + navigator.appVersion;
</script>
</body>
</html>

Posted: Fri May 06, 2005 4:58 pm
by ricardo
But i was looking some method before running webgadget, maybe some API call or something from PB.

BTW, GetGadgetText dont give the html displayed on webgadget but the URL, im right?

Posted: Fri May 06, 2005 5:44 pm
by Num3
AFAIK the webgadget uses the ATL.DLL that is in your PB directory, just place it in the same dir has your executable and you'll have no problems...

Posted: Fri May 06, 2005 9:48 pm
by ricardo
Num3 wrote:AFAIK the webgadget uses the ATL.DLL that is in your PB directory, just place it in the same dir has your executable and you'll have no problems...
Thats makes it independient of the Explorer version? I dont think so...

Posted: Fri May 06, 2005 9:57 pm
by freak
The atl.dll only provides the container for the Webbrowser object and the
helper functions to create/access it.

There should be a registry entry telling you the IE version, but i don't know which.

edit: this one might help:
http://www.vincenzo.net/isxkb/modules.p ... cle&sid=17

Re: How to know which version of IE are webgadget using?

Posted: Wed May 11, 2005 10:32 pm
by va!n
ricardo wrote:Hi,

How to know which version of IE are webgadget using?

I need to know because i notice many differences in the behavior depending on the IE version/subversion SP1/2, etc. How can i get it from PB?

Thanks in advance


hi ricardo! maybe this will help you ;)

Code: Select all

;-------- Get DLL Version --------

   Structure DllVersionInfo 
      cbSize.l 
      dwMajorVersion.l 
      dwMinorVersion.l 
      dwBuildNumber.l 
      dwPlatformID.l 
    EndStructure 
    
    dwVersion.DllVersionInfo 
    dwVersion\cbSize=20 
    
    #shdocvw = 1 
    
    DLLName$ = "shdocvw.dll"
    
    If OpenLibrary(#shdocvw,DLLName$)    
      FunctionPointer=IsFunction(#shdocvw,"DllGetVersion") 
      If FunctionPointer 
        Result=CallFunctionFast(FunctionPointer, dwVersion) 
        res1 =  dwVersion\dwMajorVersion 
        res2 =  dwVersion\dwMinorVersion 
        res3 = dwVersion\dwBuildNumber 
        DLLVersion$ = Str(res1) + "." + Str(res2) + "." + Str(res3)
        CloseLibrary(#shdocvw)  
      EndIf 
    EndIf
 
    
;-------- Display DLL Version --------
    
    MessageRequester("",DLLVersion$,0)
    End
    
Full listing of Shdocvw.dll versions

Version Product
4.70.1155 Internet Explorer 3.0
4.70.1158 Internet Explorer 3.0 (OSR2)
4.70.1215 Internet Explorer 3.01
4.70.1300 Internet Explorer 3.02 and 3.02a
4.71.1008.3 Internet Explorer 4.0 PP2
4.71.1712.5 Internet Explorer 4.0
4.72.2106.7 Internet Explorer 4.01
4.72.3110.3 Internet Explorer 4.01 Service Pack 1
4.72.3612.1707 Internet Explorer 4.01 SP2
4.72.3711.2900 Internet Explorer 4.x with Update for "Server-side Page Reference Redirect" Issue installed.
5.00.0518.5 Internet Explorer 5 Developer Preview (Beta 1)
5.00.0910.1308 Internet Explorer 5 Beta (Beta 2)
5.00.2014.213 Internet Explorer 5
5.00.2314.1000 Internet Explorer 5 (Office 2000)
5.00.2516.1900 Internet Explorer 5.01 (Windows 2000 Beta 3, build 5.00.2031)
5.00.2614.3500 Internet Explorer 5 (Windows 98 Second Edition)
5.00.2717.2000 Internet Explorer 5 with Update for "Malformed Favorites Icon" Security Issue installed.
5.00.2721.1400 Internet Explorer 5 with Update for "ImportExport Favorites()" Security Issue installed.
5.00.2723.2900 Internet Explorer 5.0 with Update for "Server-side Page Reference Redirect" Issue installed.
5.00.2919.800 Internet Explorer 5.01 (Windows 2000 RC1, build 5.00.2072)
5.00.2919.3800 Internet Explorer 5.01 (Windows 2000 RC2, build 5.00.2128)
5.00.2919.6307 Internet Explorer 5.01 (Also included with Office 2000 SR-1, but not installed by default)
5.00.2919.6400 Internet Explorer 5.01 with Update for "Server-side Page Reference Redirect" Issue installed.
5.00.2920.0000 Internet Explorer 5.01 (Windows 2000, build 5.00.2195)
5.00.3103.1000 Internet Explorer 5.01 SP1 (Windows 2000)
5.00.3105.0106 Internet Explorer 5.01 SP1 (Windows 95/98 and Windows NT 4.0)
5.00.3314.2100 Internet Explorer 5.01 SP2 (Windows 95/98 and Windows NT 4.0)
5.00.3315.2879 Internet Explorer 5.01 SP2 (Windows 2000)
5.50.3825.1300 Internet Explorer 5.5 Developer Preview (Beta)
5.50.4030.2400 Internet Explorer 5.5 & Internet Tools Beta
5.50.4134.0100 Windows Me (4.90.3000)
5.50.4134.0600 Internet Explorer 5.5
5.50.4308.2900 Internet Explorer 5.5 Advanced Security Privacy Beta
5.50.4522.1800 Internet Explorer 5.5 Service Pack 1
5.50.4807.2300 Internet Explorer 5.5 Service Pack 2
6.00.2462.0000 Internet Explorer 6 Public Preview (Beta)
6.00.2479.0006 Internet Explorer 6 Public Preview (Beta) Refresh
6.00.2600.0000 Internet Explorer 6

Re: How to know which version of IE are webgadget using?

Posted: Wed May 11, 2005 10:55 pm
by va!n
ricardo wrote:Hi,

How to know which version of IE are webgadget using?

I need to know because i notice many differences in the behavior depending on the IE version/subversion SP1/2, etc. How can i get it from PB?

Thanks in advance

Ok, here is another way to get the version of Internet Explorer by checking the registry...

Code: Select all

;-------- Read Registry value by Manne in 2003 --------

Procedure.l GetValue(topKey, sKeyName.s, sValueName.s, ComputerName.s) 
  GetHandle.l 
  hKey.l 
  lpData.s 
  lpDataDWORD.l 
  lpcbData.l 
  lType.l 
  lReturnCode.l 
  lhRemoteRegistry.l 
  Shared GetValue.s 
  
  If Left(sKeyName, 1) = "" 
    sKeyName = Right(sKeyName, Len(sKeyName) - 1) 
  EndIf 
  
  If ComputerName = "" 
    GetHandle = RegOpenKeyEx_(topKey, sKeyName, 0, #KEY_ALL_ACCESS, @hKey) 
  Else 
    lReturnCode = RegConnectRegistry_(ComputerName, topKey, @lhRemoteRegistry) 
    GetHandle = RegOpenKeyEx_(lhRemoteRegistry, sKeyName, 0, #KEY_ALL_ACCESS, @hKey) 
  EndIf 
  
  If GetHandle = #ERROR_SUCCESS 
    lpcbData = 255 
    lpData = Space(255) 
    
    GetHandle = RegQueryValueEx_(hKey, sValueName, 0, @lType, @lpData, @lpcbData) 
    
    If GetHandle = #ERROR_SUCCESS 
      Select lType 
        Case #REG_SZ 
          GetHandle = RegQueryValueEx_(hKey, sValueName, 0, @lType, @lpData, @lpcbData) 
          
          If GetHandle = 0 
            GetValue = Left(lpData, lpcbData - 1) 
          Else 
            GetValue = "" 
          EndIf 
          
        Case #REG_DWORD 
          GetHandle = RegQueryValueEx_(hKey, sValueName, 0, @lpType, @lpDataDWORD, @lpcbData) 
          
          If GetHandle = 0 
            GetValue = Str(lpDataDWORD) 
          Else 
            GetValue = "0" 
          EndIf 
           
      EndSelect 
    EndIf 
  EndIf 
  RegCloseKey_(hKey) 
  ProcedureReturn GetHandle
EndProcedure 

;-------- Add this to check registry for IE version --------

sKeyName.s = "SOFTWARE\Microsoft\Internet Explorer" 
sTopKey.l = #HKEY_LOCAL_MACHINE 

GetValue(sTopKey.l,sKeyName.s,"Version","")
Debug GetValue