summaryrefslogtreecommitdiff
path: root/src/w32fns.c
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>2007-07-15 02:05:20 +0000
committerMiles Bader <miles@gnu.org>2007-07-15 02:05:20 +0000
commit7eb1e4534e88a32fe5e549e630fdabf3e062be2b (patch)
tree34fc72789f1cfbfeb067cf507f8871c322df300a /src/w32fns.c
parent76d11d2cf9623e9f4c38e8239c4444ffc1fae485 (diff)
parent6f8a87c027ebd6f9cfdac5c0df97d651227bec62 (diff)
downloademacs-7eb1e4534e88a32fe5e549e630fdabf3e062be2b.tar.gz
Merge from emacs--devo--0
Patches applied: * emacs--devo--0 (patch 803-813) - Update from CVS - Merge from emacs--rel--22 * emacs--rel--22 (patch 51-58) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 233-236) - Merge from emacs--devo--0 - Update from CVS Revision: emacs@sv.gnu.org/emacs--multi-tty--0--patch-25
Diffstat (limited to 'src/w32fns.c')
-rw-r--r--src/w32fns.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/w32fns.c b/src/w32fns.c
index e76ca2ddc62..cacfa32c177 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
@@ -2512,6 +2513,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 ();
@@ -3658,6 +3666,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);