No. The function is implemented in a Kernel32.dll, which is loaded at runtime from whatever version of the OS you're currently running. Since the code isn't there in either your executable or in a system DLL, you can't run it (don't even think about copying over Kernel32.dll from a different OS version, that's just screaming for trouble).
You can try using MessageBeep
instead of Beep
, but that gives you less control over the output and will probably still use your sound card instead of the internal
For an interesting history of the MessageBeep
function, see Larry Osterman's blog.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…