-
Notifications
You must be signed in to change notification settings - Fork 1
/
Winamp.cpp
98 lines (89 loc) · 2.38 KB
/
Winamp.cpp
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#include "DevilPK.h"
static int playerID = 0;
char currTitle[4096];
char* GetCurrentWinampTrack()
{
static char szTitle[2048], *rTitle;
HWND win = FindWindowA("Winamp v1.x",NULL);
if(!win)
return "Not active...";
GetWindowTextA(win, szTitle, sizeof(szTitle));
rTitle = szTitle+strlen(szTitle)-8;
while (rTitle >= szTitle)
{
if (!_strnicmp(rTitle,"- Winamp",8))
break;
rTitle--;
}
if (rTitle >= szTitle)
rTitle--;
while (rTitle >= szTitle && *rTitle == ' ')
rTitle--;
*++rTitle = 0;
if(strlen(szTitle) <= 0)
return "Track has no name...";
return szTitle;
}
void StopSong()
{
HWND hwndWinamp = FindWindow("Winamp v1.x",NULL);
SendMessage(hwndWinamp, WM_COMMAND, W2_STOP, 0);
}
void NextSong()
{
HWND hwndWinamp = FindWindow("Winamp v1.x",NULL);
SendMessage(hwndWinamp, WM_COMMAND, 40048, 0);
}
void PrevSong()
{
HWND hwndWinamp = FindWindow("Winamp v1.x",NULL);
SendMessage(hwndWinamp, WM_COMMAND, 40044, 0);
}
void PlayPause()
{
HWND hwndWinamp = FindWindow("Winamp v1.x",NULL);
SendMessage(hwndWinamp, WM_COMMAND, 40046, 0);
}
void FastForward()
{
HWND hwndWinamp = FindWindow("Winamp v1.x",NULL);
SendMessage(hwndWinamp, WM_COMMAND, 40148, 0);
}
void Rewind()
{
HWND hwndWinamp = FindWindow("Winamp v1.x",NULL);
SendMessage(hwndWinamp, WM_COMMAND, 40144, 0);
}
void RaiseVolume()
{
HWND hwndWinamp = FindWindow("Winamp v1.x",NULL);
SendMessage(hwndWinamp, WM_COMMAND, 40058, 0);
SendMessage(hwndWinamp, WM_COMMAND, 40058, 0);
SendMessage(hwndWinamp, WM_COMMAND, 40058, 0);
SendMessage(hwndWinamp, WM_COMMAND, 40058, 0);
SendMessage(hwndWinamp, WM_COMMAND, 40058, 0);
}
void LowerVolume()
{
HWND hwndWinamp = FindWindow("Winamp v1.x",NULL);
SendMessage(hwndWinamp, WM_COMMAND, 40059, 0);
SendMessage(hwndWinamp, WM_COMMAND, 40059, 0);
SendMessage(hwndWinamp, WM_COMMAND, 40059, 0);
SendMessage(hwndWinamp, WM_COMMAND, 40059, 0);
SendMessage(hwndWinamp, WM_COMMAND, 40059, 0);
}
void Shuffle()
{
HWND hwndWinamp = FindWindow("Winamp v1.x",NULL);
SendMessage(hwndWinamp, WM_COMMAND, 40023, 0);
}
void Repeat()
{
HWND hwndWinamp = FindWindow("Winamp v1.x",NULL);
SendMessage(hwndWinamp, WM_COMMAND, 40022, 0);
}
void Close()
{
HWND hwndWinamp = FindWindow("Winamp v1.x",NULL);
SendMessage(hwndWinamp, WM_COMMAND, 40001, 0);
}