<p>Is there a way to trigger a beep/alarm/sound when my breakpoint is hit? I'm using Visual Studio 2005/2008.</p>

[{'answer_id': 80582, 'author': '1800 INFORMATION', 'author_id': 3146, 'author_profile': 'https://Stackoverflow.com/users/3146', 'pm_score': 2, 'selected': False, 'text': '<p>You can create a macro that runs in response to a breakpoint firing. In your macro, you could do whatever it takes to make a beeping noise.</p>\n'}, {'answer_id': 80587, 'author': 'Nescio', 'author_id': 14484, 'author_profile': 'https://Stackoverflow.com/users/14484', 'pm_score': 8, 'selected': True, 'text': '<h3>Windows\xa0XP</h3>\n<p>Control Panel -&gt; Sounds and Audio... -&gt; Program Events - Microsoft Developer -&gt; Breakpoint Hit</p>\n<h3>Windows\xa07</h3>\n<p>Control Panel -&gt; All Control Panel Items -&gt; Sounds -&gt; Sounds (tab) - Microsoft Visual Studio -&gt; Breakpoint Hit</p>\n'}, {'answer_id': 80735, 'author': 'Andrew', 'author_id': 15127, 'author_profile': 'https://Stackoverflow.com/users/15127', 'pm_score': 3, 'selected': False, 'text': '<p>Yes, you can do it with a Macro assigned to a breakpoint.  This works in VS 2005, I assume 2008 will work as well.  I assume you don\'t want a sound on EVERY breakpoint, or the other answer will work fine.  There is probably a way to play a specific sound, but I didn\'t dig that hard.  Here are the basic steps:</p>\n\n<p><strong>Add A New Macro Module</strong> (steps below the code)</p>\n\n<pre><code>Imports System.Runtime.InteropServices\nPublic Module Beeps\n    Public Sub WindowsBeep()\n        Interaction.Beep()\n    End Sub\n    Public Sub ForceBeep()\n        Beep(900, 300)\n    End Sub\n    &lt;DllImport("Kernel32.dll")&gt; _\n    Private Function Beep(ByVal frequency As UInt32, ByVal duration As UInt32) As Boolean\n    End Function\nEnd Module\n</code></pre>\n\n<ol>\n<li>Tools => Macros => Macros IDE</li>\n<li>My Macros (In Project Explorer) => Add New Module => Name: "Beeps"</li>\n<li>Copy the above code in.  It has 2 methods\n\n<ol>\n<li>First one uses the windows "Beep" sound</li>\n<li>Second one forces a "Beep" tone, not a .wav file.  This works with all sounds disabled (eg Control Panel -> Sounds -> Sound Scheme: No Sounds), but sounds ugly.</li>\n</ol></li>\n<li>View the Macro Explorer in VS.Net (not the macro IDE) to make sure it is there :)</li>\n</ol>\n\n<p><strong>Assign To A Breakpoint</strong></p>\n\n<ol>\n<li>Add a break point to a line</li>\n<li>Right click on the little red dot</li>\n<li>Select "When Hit"</li>\n<li>Check the box to enable macros</li>\n<li>Select your macro from the pulldown</li>\n<li><strong>Uncheck</strong> "continue execution" if you want to stop.  It is checked by default.</li>\n</ol>\n\n<p>Also, there <em>are</em> ways to play an arbitrary wav file, but that seems excessive for an alert.  Perhaps the forced "beep" is the best, since that at least <em>sounds</em> different than Ding.</p>\n'}]
['https://Stackoverflow.com/questions/80564', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1630/']