VCL Delphi

Title: check, if Undo is possible in a TMemo?
procedure TForm1.Button1Click(Sender: TObject);
begin
if Memo1.Perform(EM_CANUNDO, 0, 0) 0 then
ShowMessage('Undo is possible')
else
ShowMessage('Undo is not possible');
end;