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

DllCall Information

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

Refresh Everything By Telling Windows an Association has Changed


You could tell windows that something has changed and it needs to refresh: Reference: http://msdn.microsoft.com/en-us/library/bb762118(VS.85).aspx
#DefineFunction SH_Refresh ()
   ;Refresh everything by telling Windows an association has changed
   SHCNE_ASSOCCHANGED=134217728
   SHCNF_IDLIST = 0
   RetVal = 1
   dllfile = StrCat(DirWindows(1),"Shell32.dll")
   If FileExist( dllfile )
      DllCall(dllfile,long:"SHChangeNotify",long:SHCNE_ASSOCCHANGED,long:SHCNF_IDLIST,lpnull,lpnull)
   Else
      Pause("Notice", "Unable to locate Shell32 .dll")
      RetVal = 0
   EndIf
   Return (RetVal)
#EndFunction

Test = SH_Refresh ()
If Test
   Message ("Result:","Refresh Successful")
Else
   Message ("Result:","Refresh Unsuccessful")
EndIf
Exit

Article ID:   W15934
File Created: 2010:03:19:08:15:08
Last Updated: 2010:03:19:08:15:08