Bug 683188 - nsISound should be used in Win32 widget code, not PlaySound. r=jimm

This commit is contained in:
Brian R. Bondy 2011-09-08 11:24:43 -04:00
parent 64113c6ae2
commit 872cc68f78

View File

@ -158,6 +158,7 @@
#include "Layers.h"
#include "nsPrintfCString.h"
#include "mozilla/Preferences.h"
#include "nsISound.h"
#ifdef MOZ_ENABLE_D3D9_LAYER
#include "LayerManagerD3D9.h"
@ -6157,7 +6158,10 @@ void nsWindow::ActivateOtherWindowHelper(HWND aWnd)
// Play the minimize sound while we're here, since that is also
// forgotten when we use SW_SHOWMINIMIZED.
::PlaySoundW(L"Minimize", nsnull, SND_ALIAS | SND_NODEFAULT | SND_ASYNC);
nsCOMPtr<nsISound> sound(do_CreateInstance("@mozilla.org/sound;1"));
if (sound) {
sound->PlaySystemSound(NS_LITERAL_STRING("Minimize"));
}
}
void nsWindow::OnWindowPosChanging(LPWINDOWPOS& info)