وبلاگ شخصی حامد شیرزاد
وبلاگ شخصی حامد شیرزاد
صفحات وبلاگ
نویسنده: حامد شیرزاد - ۱۳٩٠/٧/۱٥

Sometimes in development very useful to sound a "context" beep. For example, user entered the incorrect value - you can show the message dialog with information about it but also useful to beep with "error" sound.

Try this - it's very useful for end-user as context help/assistent:

uses Windows;

procedure PlayBeep(ActionType: TMsgDlgType);
var mb: dWord;
begin case ActionType of mtInformation: mb := MB_ICONASTERISK; //SystemAsterisk mtWarning: mb := MB_ICONEXCLAMATION; //SystemExclamation mtError: mb := MB_ICONHAND; //SystemHand mtConfirmation: mb := MB_ICONQUESTION; //SystemQuestion mtCustom: mb := MB_OK; //SystemDefault else mb:= $0FFFFFFFF; //Standard beep using the computer speaker end;
  MessageBeep(mb);
end;
نویسندگان وبلاگ:
مطالب اخیر:
کدهای اضافی کاربر :