-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnotifyOS.cpp
More file actions
51 lines (40 loc) · 1.25 KB
/
Copy pathnotifyOS.cpp
File metadata and controls
51 lines (40 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include "pch.h"
#pragma comment(lib, "Winmm.lib")
#include <string>
using namespace std;
#include "Windows.h"
#include "winuser.h"
#include "processthreadsapi.h"
#include "Mmsystem.h"
#include "utf8_to_utf16.h"
#include "Vanilla1121_functions.h"
#include "notifyOS.h"
void flashTaskbarIcon() {
if (vanilla1121_gameInForeground() == true) {
return;
}
FLASHWINFO param = {};
param.cbSize = sizeof(FLASHWINFO);
param.hwnd = vanilla1121_gameWindow();
param.dwFlags = FLASHW_TRAY | FLASHW_TIMERNOFG;
param.uCount = 0u;
param.dwTimeout = 0u;
FlashWindowEx(¶m);
}
// Play a system sound
bool playSystemSound(const string soundName) {
if (vanilla1121_gameInForeground() == true) {
return false;
}
if (soundName == u8"SystemAsterisk"
|| soundName == u8"SystemDefault"
|| soundName == u8"SystemExclamation"
|| soundName == u8"SystemExit"
|| soundName == u8"SystemHand"
|| soundName == u8"SystemQuestion"
|| soundName == u8"SystemStart"
|| soundName == u8"SystemWelcome") {
return PlaySoundW(utf8_to_utf16(soundName).data(), NULL, SND_ALIAS | SND_ASYNC | SND_SENTRY);
}
return false;
}