WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Web UDFs

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Refresh Active Internet Explorer Session

 Keywords:  Refresh IE Active Internet Explorer Session SendMessageTimeout InternetSetOptionA HWND_BROADCAST WM_SETTINGCHANGE INTERNET_OPTION_SETTINGS_CHANGED INTERNET_OPTION_REFRESH

;***************************************************************************
;**
;**     Refresh Active Internet Explorer Session
;**
;**    REFERENCE: http://www.codeproject.com/KB/IP/Change_IE7_Proxy_Setting.aspx
;**
;***************************************************************************
#DefineFunction RefreshActiveIE()
   SETTINGS_CHANGED =    39   ;INTERNET_OPTION_SETTINGS_CHANGED
   REFRESH =             37   ;INTERNET_OPTION_REFRESH
   HWND_BROADCAST =       65535
   WM_SETTINGCHANGE =    26
   SMTO_NORMAL =          0
   SMTO_BLOCK =          1
   SMTO_ABORTIFHUNG =    2
   SMTO_NOTIMEOUTIFNOTHUNG = 8

   ;Notify_SettingChange
   ;SendMessageTimeout(HWND_BROADCAST, (uint)WM_SETTINGCHANGE, UIntPtr.Zero, UIntPtr.Zero, SendMessageTimeoutFlags.SMTO_NORMAL, 1000, out result);
   user32 = DllLoad(StrCat(DirWindows(1),'USER32.DLL'))
   lpdwResult = BinaryAlloc(4)
   BinaryEodSet(lpdwResult,0)
   ret = DllCall( user32, long:'SendMessageTimeoutA', long:HWND_BROADCAST, long:WM_SETTINGCHANGE, long:0, long:0, long:SMTO_NORMAL,long:1000, lpbinary:lpdwResult)
   BinaryFree(lpdwResult)

   ;Notify_OptionSettingChanges
   wininet=DllLoad(StrCat(DirWindows(1),'WININET.DLL'))
   DllCall(wininet,long:'InternetSetOptionA',long:0,long:SETTINGS_CHANGED,long:0,long:0)
   DllCall(wininet,long:'InternetSetOptionA',long:0,long:REFRESH,long:0,long:0)

   DllFree(user32)
   DllFree(wininet)
   Return 1
#EndFunction



RefreshActiveIE()


Exit

Article ID:   W18412
Filename:   Refresh Active Internet Explorer Session.txt
File Created: 2009:01:30:12:40:28
Last Updated: 2009:01:30:12:40:28