bundled setuptools/command/scriptsetup.py: use SendMessageTimeoutW, to test whether...
authordavid-sarah <david-sarah@jacaranda.org>
Mon, 2 Aug 2010 22:45:05 +0000 (15:45 -0700)
committerdavid-sarah <david-sarah@jacaranda.org>
Mon, 2 Aug 2010 22:45:05 +0000 (15:45 -0700)
setuptools-0.6c16dev.egg/setuptools/command/scriptsetup.py

index 48e6b53ffabfd72189034c255ab10a96544e8e01..df60f9c492d3fd6d11f5c832d08fedb1b08b7a05 100644 (file)
@@ -224,20 +224,20 @@ def do_scriptsetup(allusers=False):
 
         # <http://support.microsoft.com/kb/104011/en-us>
         # <http://msdn.microsoft.com/en-us/library/ms644952(VS.85).aspx>
-        # 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,)