showmessage最大的缺点是对话框没有图标,不好看,而用MessageBox调用又比较麻烦。
procedure MsgBox(strMsg: string);
var
h: THandle;
begin
if not Assigned(screen) or (not Assigned(screen.ActiveForm)) then
h := application.handle
else
h := screen.ActiveForm.Handle;
MessageBox(h, PChar(strMsg), PChar(Application.Title), MB_ICONINFORMATION+MB_ok);
end;
本文介绍了一种改进的ShowMessage方法,通过使用MessageBox替代原有的ShowMessage,解决了对话框无图标的问题,提高了用户体验。
1219

被折叠的 条评论
为什么被折叠?



