No announcement yet.

Richedit2 with multilevel Undo/Redo, etc.

  • Filter
  • Time
  • Show
Clear All
new posts

  • Richedit2 with multilevel Undo/Redo, etc.

    Are you bored with the plain old Richedit control yet?

    Just tested some code to load Richedit 2 and I thought I'd share
    it here. Richedit 2 is a later version and the file is called
    Riched20.dll. If you have an older version of Windows 95, it may
    not be present, so if you want to use it, you'd better make sure
    it is available at all (like if LoadLibrary("Riched20.DLL") fails,
    use LoadLibrary("Riched32.DLL") instead, etc..)

    RE2 has support for multilevel Undo/Redo, Transparency support,
    password style through EM_SETPASSWORDCHAR, etc.

    To create it, use the following (DDT code example):
      %ID_RICHEDIT2 = 500  'whatever..
      LOCAL hRichEd AS LONG
      hRichEd = LoadLibrary("Riched20.DLL")
      CALL InitCommonControls
      'Use RichEdit20W if you want unicode support..
      CONTROL ADD "RichEdit20A", hDlg, %ID_RICHEDIT, "", 6, 6, 126, 110, _
                  %ES_NOHIDESEL, %WS_EX_CLIENTEDGE CALL DlgCallback
    To test the multilevel Undo/Redo, type some text into it, move some
    selected text around with the mouse and use Ctrl+V to paste something
    into it. Then use Ctrl+Z repeated times to undo, or Ctrl+Y to redo..

    To learn more about it, go to
    and search for "Riched20" or "Richedit 2", something like that..

    [This message has been edited by Borje Hagsten (edited April 26, 2000).]

  • #2
    I have been playing around with Richedit 3 for the past couple of weeks, Borje. Microsoft did not change the file name so you have to check the version number to see if you have version 2 or 3. The class name is the same "RICHEDIT20A", it will just automatically use version 3 if you have it. Another nice feature they added to it that I like is support for %EM_SETMARGINS, but it will only work if you have version 3, and there is a zoom in\out feature which is pretty cool and you get a slanted cursor over text that is italicized. Steve Hutchesson sent me a updated richedit.h file(that's why I was asking for it in the forum) from Jan 2000 so I could update my include file with all the new constants and types. Microsoft says version 3 comes with Windows 2000, but I have version 3 and I use Windows 98 SE. I got some extra info about version 3 from I also have been checking at msdn for info on version 3. It is becoming a very versitile control to use. I am still playing around with all the cool effects. So Check it out.



    [This message has been edited by Adam Ritchie (edited April 26, 2000).]


    • #3
      Thanks for the tip. The question is if MS allows you to distribute
      Riched20.dll at all, regardless of what version it is. The problem
      is that many still uses Win95, so one would need to include it in
      a final installation, to avoid too many support calls.. :-/

      It's fun to play around with though..



      • #4

        I run win95b and it takes all of the late Microsoft updates which
        has left RICHED20.DLL in my system directory so if you can pick
        which upgrade has it, it solves the problem of version distribution.

        I opened it in a resource editor and it says Product Version : 3.0

        I have a sneaking suspicion that it is in the later common control
        update from Microsoft, version 5.


        [email protected]

        hutch at movsd dot com
        The MASM Forum - SLL Modules and PB Libraries


        • #5
          Steve brings up a point I forgot to mention, I too downloaded all those win98 SE updates off of Microsoft's windows update site and did not buy the boxed win98 SE, so I too would suspect that is also where the new version came from. It is possible it came from a different program I installed, but it probably came from the boys in Redmond.




          • #6
            Windows 95
            Windows 95 includes only Rich Edit 1.0. However, Riched20.dll is
            compatible with Windows 95 and may be installed if an
            application that uses Rich Edit 2.0 has been installed.
            Windows NT/Windows 2000
            Microsoft® Windows NT® version 4.0 includes Rich Edit 1.0 and
            2.0. Microsoft Windows® 2000 includes Rich Edit 3.0 with a Rich
            Edit 1.0 emulator.
            Windows 98
            Windows 98 includes Rich Edit 1.0 and 2.0.
            To create a rich edit control, call the CreateWindowEx function,
            specifying the rich edit window class. If you are using Rich
            Edit 1.0 (Riched32.dll), specify RichEdit for the window class
            parameter. If you are using Rich Edit 2.0 or later
            (Riched20.dll), specify RICHEDIT_CLASS for the window class
            Rich edit controls support most of the window styles used with edit controls as well as additional styles
            mailto:[email protected][email protected]</A>

            [This message has been edited by Fred Oxenby (edited April 27, 2000).]
            mailto:[email protected][email protected]</A>


            • #7
              > compatible with Windows 95 and may be installed if an
              > application that uses Rich Edit 2.0 has been installed.

              Yes, I saw that one too and in another place at MSDN they say that
              we are not allowed to distribute the latest common controls, but
              instead we can include the complete IE 5 upgrade or redirect users
              to MS website, where they can download the latest upgrades themselves.

              Microsoft logic..



              • #8
                For me, as a licensed visual studio user, this means that
                I create a minimal testprogram in VC/VB that includes the
                latest control, and install/register that at the customer site.
                After that, you can use the control in PB,,,

                mailto:[email protected][email protected]</A>

                mailto:[email protected][email protected]</A>