XEmacs 21.2.20 "Yoko".
[chise/xemacs-chise.git.1] / src / device-msw.c
index 2b8e28e..18231ba 100644 (file)
@@ -139,7 +139,9 @@ mswindows_init_device (struct device *d, Lisp_Object props)
   wc.lpfnWndProc = (WNDPROC) mswindows_wnd_proc;
   wc.cbClsExtra = 0;
   wc.cbWndExtra = MSWINDOWS_WINDOW_EXTRA_BYTES;
-  wc.hInstance = NULL; /* ? */
+  /* This must match whatever is passed to CreateWIndowEx, NULL is ok
+     for this. */
+  wc.hInstance = NULL; 
   wc.hIcon = LoadIcon (GetModuleHandle(NULL), XEMACS_CLASS);
   wc.hCursor = LoadCursor (NULL, IDC_ARROW);
   /* Background brush is only used during sizing, when XEmacs cannot
@@ -151,6 +153,17 @@ mswindows_init_device (struct device *d, Lisp_Object props)
   wc.hIconSm = LoadImage (GetModuleHandle (NULL), XEMACS_CLASS,
                          IMAGE_ICON, 16, 16, 0);
   RegisterClassEx (&wc);
+
+#ifdef HAVE_WIDGETS
+  xzero (wc);
+  /* Register the main window class */
+  wc.cbSize = sizeof (WNDCLASSEX);
+  wc.lpfnWndProc = (WNDPROC) mswindows_control_wnd_proc;
+  wc.lpszClassName = XEMACS_CONTROL_CLASS;
+  wc.hInstance = NULL;
+  RegisterClassEx (&wc);
+#endif
+
 #ifdef HAVE_TOOLBARS
   InitCommonControls ();
 #endif
@@ -159,7 +172,7 @@ mswindows_init_device (struct device *d, Lisp_Object props)
 static void
 mswindows_finish_init_device (struct device *d, Lisp_Object props)
 {
-  /* Initialise DDE management library and our related globals. We execute a
+  /* Initialize DDE management library and our related globals. We execute a
    * dde Open("file") by simulating a drop, so this depends on dnd support. */
 #ifdef HAVE_DRAGNDROP
   mswindows_dde_mlid = 0;
@@ -300,19 +313,6 @@ syms_of_device_mswindows (void)
 {
   defsymbol (&Qinit_pre_mswindows_win, "init-pre-mswindows-win");
   defsymbol (&Qinit_post_mswindows_win, "init-post-mswindows-win");
-
-  DEFVAR_LISP ("mswindows-downcase-file-names", &Vmswindows_downcase_file_names /*
-Non-nil means convert all-upper case file names to lower case.
-This applies when performing completions and file name expansion.*/ );
-  Vmswindows_downcase_file_names = Qnil;
-
-  DEFVAR_LISP ("mswindows-get-true-file-attributes", &Vmswindows_get_true_file_attributes /*
-    "Non-nil means determine accurate link count in file-attributes.
-This option slows down file-attributes noticeably, so is disabled by
-default.  Note that it is only useful for files on NTFS volumes,
-where hard links are supported.
-*/ );
-  Vmswindows_get_true_file_attributes = Qnil;
 }
 
 void
@@ -329,4 +329,17 @@ console_type_create_device_mswindows (void)
 void
 vars_of_device_mswindows (void)
 {
+  DEFVAR_LISP ("mswindows-downcase-file-names", &Vmswindows_downcase_file_names /*
+Non-nil means convert all-upper case file names to lower case.
+This applies when performing completions and file name expansion.
+*/ );
+  Vmswindows_downcase_file_names = Qnil;
+
+  DEFVAR_LISP ("mswindows-get-true-file-attributes", &Vmswindows_get_true_file_attributes /*
+Non-nil means determine accurate link count in file-attributes.
+This option slows down file-attributes noticeably, so is disabled by
+default.  Note that it is only useful for files on NTFS volumes,
+where hard links are supported.
+*/ );
+  Vmswindows_get_true_file_attributes = Qnil;
 }