diff options
author | Jason Rumney <jasonr@gnu.org> | 2007-07-11 14:43:07 +0000 |
---|---|---|
committer | Jason Rumney <jasonr@gnu.org> | 2007-07-11 14:43:07 +0000 |
commit | d5781bb682510e348cf86ba0073cffa75c50a073 (patch) | |
tree | 68c17d157eeadf4872fad57a34ff8cf892ea8617 /src | |
parent | c1c5c06dc3dec634ff0dbda889f357f9e5b582e7 (diff) | |
download | emacs-d5781bb682510e348cf86ba0073cffa75c50a073.tar.gz |
(w32_msg_pump) <WM_EMACS_CREATEWINDOW>: Initialize COM.
(w32_msg_pump) <WM_DESTROY>: Uninitialize COM.
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 7 | ||||
-rw-r--r-- | src/w32fns.c | 12 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 190d6fb0e36..d112f7297bf 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2007-07-11 Jason Rumney <jasonr@gnu.org> + + * makefile.w32-in (LIBS): Include OLE32. + + * w32fns.c (w32_msg_pump) <WM_EMACS_CREATEWINDOW>: Initialize COM. + (w32_msg_pump) <WM_DESTROY>: Uninitialize COM. + 2007-06-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> * macterm.c [USE_MAC_TSM] (mac_handle_text_input_event): diff --git a/src/w32fns.c b/src/w32fns.c index fd8df29affa..47ca9157623 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -52,6 +52,7 @@ Boston, MA 02110-1301, USA. */ #include <shellapi.h> #include <ctype.h> #include <winspool.h> +#include <objbase.h> #include <dlgs.h> #define FILE_NAME_TEXT_FIELD edt1 @@ -2514,6 +2515,13 @@ w32_msg_pump (deferred_msg * msg_buf) /* Produced by complete_deferred_msg; just ignore. */ break; case WM_EMACS_CREATEWINDOW: + /* Initialize COM for this window. Even though we don't use it, + some third party shell extensions can cause it to be used in + system dialogs, which causes a crash if it is not initialized. + This is a known bug in Windows, which was fixed long ago, but + the patch for XP is not publically available until XP SP3, + and older versions will never be patched. */ + CoInitialize (NULL); w32_createwindow ((struct frame *) msg.wParam); if (!PostThreadMessage (dwMainThreadId, WM_EMACS_DONE, 0, 0)) abort (); @@ -3660,6 +3668,10 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) my_post_msg (&wmsg, hwnd, msg, wParam, lParam); goto dflt; + case WM_DESTROY: + CoUninitialize (); + return 0; + case WM_CLOSE: wmsg.dwModifiers = w32_get_modifiers (); my_post_msg (&wmsg, hwnd, msg, wParam, lParam); |