From 58cce54ada16c0124358c5735f56fc7085f60d9d Mon Sep 17 00:00:00 2001 From: david-sarah Date: Mon, 2 Aug 2010 15:45:05 -0700 Subject: [PATCH] bundled setuptools/command/scriptsetup.py: use SendMessageTimeoutW, to test whether that broadcasts environment changes any better. --- .../setuptools/command/scriptsetup.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/setuptools-0.6c16dev.egg/setuptools/command/scriptsetup.py b/setuptools-0.6c16dev.egg/setuptools/command/scriptsetup.py index 48e6b53f..df60f9c4 100644 --- a/setuptools-0.6c16dev.egg/setuptools/command/scriptsetup.py +++ b/setuptools-0.6c16dev.egg/setuptools/command/scriptsetup.py @@ -224,20 +224,20 @@ def do_scriptsetup(allusers=False): # # - # LRESULT WINAPI SendMessageTimeoutA(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, + # LRESULT WINAPI SendMessageTimeoutW(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, # UINT fuFlags, UINT uTimeout, PDWORD_PTR lpdwResult); try: - from ctypes import WINFUNCTYPE, POINTER, windll, addressof, c_char_p + from ctypes import WINFUNCTYPE, POINTER, windll, addressof, c_wchar_p from ctypes.wintypes import LONG, HWND, UINT, WPARAM, LPARAM, DWORD SendMessageTimeout = WINFUNCTYPE(POINTER(LONG), HWND, UINT, WPARAM, LPARAM, UINT, UINT, POINTER(POINTER(DWORD))) \ - (("SendMessageTimeoutA", windll.user32)) + (("SendMessageTimeoutW", windll.user32)) HWND_BROADCAST = 0xFFFF WM_SETTINGCHANGE = 0x001A SMTO_ABORTIFHUNG = 0x0002 SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, change_allusers and 1 or 0, - addressof(c_char_p("Environment")), SMTO_ABORTIFHUNG, 5000, None); + addressof(c_wchar_p(u"Environment")), SMTO_ABORTIFHUNG, 5000, None); except Exception, e: print "Warning: %r" % (e,) -- 2.45.2