14

I'm looking for a MessageBeep replacement on the OS X. It seems that the proper function to call would be NSBeep but it is not supported by XE2 RTL.

How do I call NSBeep from Delphi application?

Community
  • 1
  • 1
gabr
  • 26,580
  • 9
  • 75
  • 141
  • 1
    What about to use the [`Beep`](http://docwiki.embarcadero.com/Libraries/en/System.SysUtils.Beep) instead ? However I have no idea what they mean with the note *On MAC OS the Beep routine has limited functionality*, does it mean it does less than *beep* :-) ? – TLama Apr 23 '12 at 19:47
  • 3
    In my case this would probably be enough but I would like to learn how to properly add my own imports on OS X. – gabr Apr 23 '12 at 19:50

1 Answers1

12

It's just a plain C function:

procedure NSBeep; cdecl;
  external '/System/Library/Frameworks/AppKit.framework/AppKit' name '_NSBeep';
Giel
  • 2,066
  • 20
  • 22
  • 1
    Thanks! I almost got it but I was missing the last '/AppKit' in the external and it didn't work. – gabr Apr 24 '12 at 05:46