Rather than compose an example...
I've provided all the necessary/relevant code snippets below.

You can try this in any form that contains... a RichEdit.
And a menu that contains something like...
Open, Undo, Redo, Cut, Copy, Delete, Paste, and Exit.
(with the appropriate subs to handle these menus options)
(subs to handle Undo and Redo are listed below)
(name the Undo menu option: mUndo)
(name the Redo menu option: mRedo)

This all works just fine and as expected under WinXP.

But "only" the EM_CANUNDO works under Win98.
And the EM_GETUNDONAME "always" returns a value of 0
(aka "Last Action") under Win98.

If anyone can get this to work fully under Win98...
please post a message in the group as soon as possible.
Thanks In Advance.
David

' Start Of Code Snippet: Define Constants
  Const EM_UNDO = &HC7
  Const EM_REDO = &H454
  Const EM_CANUNDO = &HC6
  Const EM_CANREDO = &H455
  Const EM_GETUNDONAME = &H456
  Const EM_GETREDONAME = &H457
  Const EM_EMPTYUNDOBUFFER = &HCD

  Const ercUID_UNKNOWN = 0
  Const ercUID_TYPING = 1
  Const ercUID_DELETE = 2
  Const ercUID_DRAGDROP = 3
  Const ercUID_CUT = 4
  Const ercUID_PASTE = 5
' End Of Code Snippet: Define Constants


' Start Of Code Snippet: Declare Function to determine EM_GET??DONAME
  Declare Function TranslateType (eType As Integer) As String
' End Of Code Snippet: Declare Function to determine EM_GET??DONAME

' Start Of Code Snippet: Declare Sub to handle mUndo.OnClick
  Declare Sub UndoIt
' End Of Code Snippet: Declare Sub to handle mUndo.OnClick

' Start Of Code Snippet: Declare Sub to handle mRedo.OnClick
  Declare Sub RedoIt
' End Of Code Snippet: Declare Sub to handle mRedo.OnClick


' Start Of Code Snippet: Define Empty Variables
  DefInt iCanUndo
  DefInt iCanRedo

  DefLng lUndoType
  DefLng lRedoType
' End Of Code Snippet: Define Empty Variables


' Start Of Code Snippet: Function to determine EM_GET??DONAME
  Function TranslateType(eType As Integer) As String
    Select Case eType
      Case ercUID_UNKNOWN
        TranslateType = "Last Action"
      Case ercUID_TYPING
        TranslateType = "Typing"
      Case ercUID_PASTE
        TranslateType = "Paste"
      Case ercUID_DRAGDROP
        TranslateType = "Drag Drop"
      Case ercUID_DELETE
        TranslateType = "Delete"
      Case ercUID_CUT
        TranslateType = "Cut"
    End Select
  End Function
' End Of Code Snippet: Function to determine EM_GET??DONAME


' Start Of Code Snippet: Empty Undo Buffer if RichEdit is cleared by user
  SendMessage(RichEdit.Handle, EM_EMPTYUNDOBUFFER, 0, 0)
' End Of Code Snippet: Empty Undo Buffer if RichEdit is cleared by user


' Start Of Code Snippet: Part of the sub to update menu options including mUndo and mRedo
  ' the return value for iCanUndo should be either 0 or 1
  ' this is the only one to work properly under Win98
  iCanUndo = SendMessageAPI(RichEdit.Handle, EM_CANUNDO, 0, 0)
  If iCanUndo Then
    mUndo.Enabled = iCanUndo
    ' the return value for lUndoType should be in the range of 0 - 5
    ' this one works under Win 98 but always returns 0
    lUndoType = SendMessageAPI(RichEdit.Handle, EM_GETUNDONAME, 0, 0)
    mUndo.Caption = "Undo " + TranslateType(lUndoType)
  Else
    mUndo.Caption = "Undo"
  End If

  ' the return value for iCanRedo should be either 0 or 1
  ' this one does not work under Win98 which means the If/Then is skipped
  iCanRedo = SendMessageAPI(RichEdit.Handle, EM_CANREDO, 0, 0)
  If iCanRedo Then
    mRedo.Enabled = iCanRedo
    mUndo.Enabled = False
    mUndo.Caption = "Undo"
    ' the return value for lRedoType should be in the range of 0 - 5
    ' this one does not work under Win98
    lRedoType = SendMessageAPI(RichEdit.Handle, EM_GETREDONAME, 0, 0)
    mRedo.Caption = "Redo " + TranslateType(lRedoType)
  Else
    mRedo.Caption = "Redo"
  End If
' End Of Code Snippet: Part of the sub to update menu options including mUndo and mRedo


' Start Of Code Snippet: Sub to handle mUndo.OnClick
  Sub UndoIt
    SendMessageAPI(RichEdit.Handle, EM_UNDO, 0, 0)
  End Sub
' End Of Code Snippet: Sub to handle mUndo.OnClick


' Start Of Code Snippet: Sub to handle mRedo.OnClick
  ' this sub only gets called under WinXP (until a solution is found for Win98)
  Sub RedoIt
    SendMessageAPI(RichEdit.Handle, EM_REDO, 0, 0)
  End Sub
' End Of Code Snippet: Sub to handle mRedo.OnClick

