diff --git a/Contrib/BgImage/BgImage.cpp b/Contrib/BgImage/BgImage.cpp index 8a1cc10d..c230c1a1 100644 --- a/Contrib/BgImage/BgImage.cpp +++ b/Contrib/BgImage/BgImage.cpp @@ -323,14 +323,20 @@ NSISFunc(Destroy) { } NSISFunc(Sound) { - DWORD flags = SND_FILENAME|SND_NODEFAULT|SND_NOWAIT; + char szLoop[] = {'/', 'L', 'O', 'O', 'P', 0}; + + DWORD flags = SND_FILENAME | SND_NODEFAULT; g_stacktop=stacktop; popstring(szTemp); if (lstrcmpi(szTemp, "/WAIT")) flags |= SND_ASYNC; else popstring(szTemp); - PlaySound(szTemp, 0, flags); + if (!lstrcmpi(szTemp, szLoop)) { + flags |= SND_LOOP; + popstring(szTemp); + } + PlaySound(lstrcmpi(szTemp, "/STOP") ? szTemp : 0, 0, flags); } LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { @@ -396,11 +402,9 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) if (img->iType == MIL_TEXT) { SetBkMode(hdc, TRANSPARENT); - HFONT hOldFont; SetTextColor(hdc, img->cTextColor); - hOldFont = (HFONT)SelectObject(hdc, img->hFont); + SelectObject(hdc, img->hFont); DrawText(hdc, img->szText, -1, &img->rPos, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_WORDBREAK); - SelectObject(hdc, hOldFont); } else if (img->iType == MIL_BITMAP) { HDC cdc = CreateCompatibleDC(hdc); diff --git a/Contrib/BgImage/BgImage.txt b/Contrib/BgImage/BgImage.txt index 69e0789d..d6562d1c 100644 --- a/Contrib/BgImage/BgImage.txt +++ b/Contrib/BgImage/BgImage.txt @@ -69,9 +69,12 @@ Destroy Destroys the current background window Destroy calls Clear automatically -Sound [/WAIT] path_to_wav +Sound [/WAIT|/LOOP] path_to_wav +Sound /STOP Plays a wave file Use /WAIT to wait for the sound to finish playing + Use /LOOP to loop the sound + Use Sound /STOP to stop the loop SetReturn on|off Enable return values from SetBg, AddImage and AddText diff --git a/Plugins/BgImage.dll b/Plugins/BgImage.dll index e77cad8d..2d371b0e 100644 Binary files a/Plugins/BgImage.dll and b/Plugins/BgImage.dll differ