How to know which version of IE are webgadget using?

Everything else that doesn't fall into one of the other PB categories.
ricardo
Addict
Addict
Posts: 2438
Joined: Fri Apr 25, 2003 7:06 pm
Location: Argentina

How to know which version of IE are webgadget using?

Post 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
ARGENTINA WORLD CHAMPION
akee
Enthusiast
Enthusiast
Posts: 499
Joined: Wed Aug 18, 2004 9:52 am
Location: Penang, Malaysia

Post 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>
ricardo
Addict
Addict
Posts: 2438
Joined: Fri Apr 25, 2003 7:06 pm
Location: Argentina

Post 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?
ARGENTINA WORLD CHAMPION
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post 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...
ricardo
Addict
Addict
Posts: 2438
Joined: Fri Apr 25, 2003 7:06 pm
Location: Argentina

Post 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...
ARGENTINA WORLD CHAMPION
freak
PureBasic Team
PureBasic Team
Posts: 5948
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post 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
quidquid Latine dictum sit altum videtur
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

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

Post 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
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

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

Post 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


Post Reply