from example windows message handler by Ingo
windows message handler

mex_setmessage.m
%------------------------------------------------------------------------------------------------------------
% Function         hWnd=mex_setmessage(windowname, messagestring, id)
%
% Typ              MEX-Function MATLAB
%
% Input:           window name     --> up to 255 Bytes
%                  message string  --> up to 255 Bytes
%                  message id
%
% Output:          window handle <>0   --> o.k.      
%                                 =0   --> Error
%
% Change:          written                                                 Revision:   01.06.2007  I.Drews
%-------------------------------------------------------------------------#----------------------------------

Contact us at files@mathworks.com