[python-win32] gpedit reload method in python

le dahut le.dahut at laposte.net
Tue May 5 10:23:58 CEST 2009


Hi,

I tried it with "SHCNE_ALLEVENTS" as argument with no success :
  shell.SHChangeNotify(shellcon.SHCNE_ALLEVENTS, shellcon.SHCNF_IDLIST 
,None)

Any other idea ?



Tim Golden wrote :
> 
> le dahut wrote:
>> Hello,
>>
>> "gpedit.msc" can change several parameters in system for example items 
>> in start menu or hidden drives in explorer. The changes made in 
>> "gpedit" are immediately applied, if you have "My computer" opened you 
>> can see selected letters disappear.
>> I know that "gpedit" modifies 
>> HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoDrives. 
>>
>> But I don't know how "gpedit" updates the system, what sort of system 
>> call is done.
>>
>> I've already tried :
>>  win32gui.SendMessage(win32con.HWND_BROADCAST, 
>> win32con.WM_SETTINGCHANGE, 0, 'Environment')
>> and the commande :
>>  RunDll32.exe USER32.DLL,UpdatePerUserSystemParameters ,1 ,True
>> without success.
>>
>> Does someone know more about this ?
>> Are there other API calls that update the system ?
> 
> 
> You might need to call SHChangeNotify
> 
>  http://msdn.microsoft.com/en-us/library/bb762118(VS.85).aspx
> 
> TJG


More information about the python-win32 mailing list