diff src/device-msw.c @ 278:90d73dddcdc4 r21-0b37

Import from CVS: tag r21-0b37
author cvs
date Mon, 13 Aug 2007 10:31:29 +0200
parents c5d627a313b1
children 7df0dd720c89
line wrap: on
line diff
--- a/src/device-msw.c	Mon Aug 13 10:30:38 2007 +0200
+++ b/src/device-msw.c	Mon Aug 13 10:31:29 2007 +0200
@@ -45,6 +45,16 @@
 HSZ mswindows_dde_topic_system;
 HSZ mswindows_dde_item_open;
 
+#ifdef __CYGWIN32__
+typedef struct tagINITCOMMONCONTROLSEX
+{
+  DWORD dwSize;
+  DWORD dwICC;
+} INITCOMMONCONTROLSEX;
+WINAPI BOOL InitCommonControlsEx (INITCOMMONCONTROLSEX*);
+#else
+#include <commctrl.h>
+#endif
 
 /* Control conversion of upper case file names to lower case.
    nil means no, t means yes. */
@@ -63,6 +73,10 @@
   WNDCLASSEX wc;
   HWND desktop;
   HDC hdc;
+#ifdef HAVE_TOOLBARS
+  INITCOMMONCONTROLSEX iccex;
+  xzero(iccex);
+#endif
 
   DEVICE_INFD (d) = DEVICE_OUTFD (d) = -1;
   init_baud_rate (d);
@@ -104,6 +118,15 @@
   wc.hIconSm = LoadImage (GetModuleHandle (NULL), XEMACS_CLASS,
 			  IMAGE_ICON, 16, 16, 0);
   RegisterClassEx (&wc);
+#ifdef HAVE_TOOLBARS
+  iccex.dwSize = sizeof (iccex);
+  iccex.dwICC = ICC_BAR_CLASSES;
+#ifdef __CYGWIN32__
+  InitCommonControls ();
+#else
+  InitCommonControlsEx (&iccex);
+#endif
+#endif
 }
 
 static void
@@ -111,7 +134,7 @@
 {
   /* Initialise DDE management library and our related globals */
   mswindows_dde_mlid = 0;
-  DdeInitialize (&mswindows_dde_mlid, mswindows_dde_callback,
+  DdeInitialize (&mswindows_dde_mlid, (PFNCALLBACK)mswindows_dde_callback,
 		 APPCMD_FILTERINITS|CBF_FAIL_SELFCONNECTIONS|CBF_FAIL_ADVISES|
 		 CBF_FAIL_POKES|CBF_FAIL_REQUESTS|CBF_SKIP_ALLNOTIFICATIONS, 0);