Notepad - Richedit Window

Steven Edwards steven_ed4153 at yahoo.com
Thu Mar 11 12:39:55 CST 2004


Hello,
I was thinking about doing some work on richedit until Mike McCormack
said it would take a year of work. That means it would take me two or
three and I am just not that interested. Anyway it was still good for
me to get to pratice writting something that really works for once,
even if it is worthless on WINE. This patch does make running notepad
on windows look much better though and has no effect on WINE that I can
tell.

Thanks
Steven

Changelog:
Use a richedit control in notepad

__________________________________
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com
-------------- next part --------------
Index: main.c
===================================================================
RCS file: /home/wine/wine/programs/notepad/main.c,v
retrieving revision 1.29
diff -u -r1.29 main.c
--- main.c	18 Aug 2003 20:11:29 -0000	1.29
+++ main.c	11 Mar 2004 18:29:53 -0000
@@ -31,6 +31,10 @@
 #include "dialog.h"
 #include "notepad_res.h"
 
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(notepad);
+
 NOTEPAD_GLOBALS Globals;
 static ATOM aFINDMSGSTRING;
 
@@ -113,6 +117,7 @@
     *p = '\0';
 }
 
+
 /***********************************************************************
  *
  *           NOTEPAD_WndProc
@@ -124,7 +129,7 @@
 
     case WM_CREATE:
     {
-        static const WCHAR editW[] = { 'e','d','i','t',0 };
+        static const WCHAR editW[] = { 'R','i','c','h','E','d','i','t',0 };
         RECT rc;
         GetClientRect(hWnd, &rc);
         Globals.hEdit = CreateWindow(editW, NULL,
@@ -132,6 +137,11 @@
                              ES_AUTOVSCROLL | ES_MULTILINE,
                              0, 0, rc.right, rc.bottom, hWnd,
                              NULL, Globals.hInstance, NULL);
+        if (!Globals.hEdit) 
+        {
+          WINE_ERR("Error creating RichEdit control\n");
+          return 0;
+        }
         break;
     }
 
@@ -318,6 +328,15 @@
     class.lpszClassName = className;
 
     if (!RegisterClassEx(&class)) return FALSE;
+
+
+    const WCHAR module[] = {'R','I','C','H','E','D','3','2','.','D','L','L','\0'};
+    HMODULE mod;
+    if (!(mod = LoadLibraryW(module)))
+    {
+      WINE_ERR("Could not load RICHED32.DLL\n");
+      return (FALSE);
+    }
 
     /* Setup windows */
 


More information about the wine-patches mailing list