mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Change NULL to nullptr
This commit is contained in:
@ -19,7 +19,7 @@
|
||||
#include "StdAfx.h"
|
||||
#include "Internet.h"
|
||||
|
||||
HINTERNET Internet::c_NetHandle = NULL;
|
||||
HINTERNET Internet::c_NetHandle = nullptr;
|
||||
|
||||
/*
|
||||
** Initialize internet handle and crtical section.
|
||||
@ -29,8 +29,8 @@ void Internet::Initialize()
|
||||
{
|
||||
c_NetHandle = InternetOpen(L"Rainmeter NowPlaying.dll",
|
||||
INTERNET_OPEN_TYPE_PRECONFIG,
|
||||
NULL,
|
||||
NULL,
|
||||
nullptr,
|
||||
nullptr,
|
||||
0);
|
||||
|
||||
if (!c_NetHandle)
|
||||
@ -57,7 +57,7 @@ std::wstring Internet::DownloadUrl(const std::wstring& url, int codepage)
|
||||
// From WebParser.cpp
|
||||
std::wstring result;
|
||||
DWORD flags = INTERNET_FLAG_RESYNCHRONIZE;
|
||||
HINTERNET hUrlDump = InternetOpenUrl(c_NetHandle, url.c_str(), NULL, NULL, flags, 0);
|
||||
HINTERNET hUrlDump = InternetOpenUrl(c_NetHandle, url.c_str(), nullptr, 0, flags, 0);
|
||||
|
||||
if (!hUrlDump)
|
||||
{
|
||||
@ -68,7 +68,7 @@ std::wstring Internet::DownloadUrl(const std::wstring& url, int codepage)
|
||||
const int CHUNK_SIZE = 8192;
|
||||
BYTE* lpData = new BYTE[CHUNK_SIZE];
|
||||
BYTE* lpOutPut;
|
||||
BYTE* lpHolding = NULL;
|
||||
BYTE* lpHolding = nullptr;
|
||||
int nCounter = 1;
|
||||
int nBufferSize;
|
||||
DWORD dwDataSize = 0;
|
||||
@ -98,7 +98,7 @@ std::wstring Internet::DownloadUrl(const std::wstring& url, int codepage)
|
||||
lpOutPut = new BYTE[nBufferSize + 2];
|
||||
|
||||
// Make sure the buffer is not the initial buffer.
|
||||
if (lpHolding != NULL)
|
||||
if (lpHolding != nullptr)
|
||||
{
|
||||
// Copy the data in the holding buffer.
|
||||
memcpy(lpOutPut, lpHolding, dwDataSize);
|
||||
@ -223,10 +223,10 @@ void Internet::DecodeReferences(std::wstring& str)
|
||||
}
|
||||
|
||||
std::wstring num(str, pos, end - pos);
|
||||
WCHAR* pch = NULL;
|
||||
WCHAR* pch = nullptr;
|
||||
errno = 0;
|
||||
long ch = wcstol(num.c_str(), &pch, base);
|
||||
if (pch == NULL || *pch != L'\0' || errno == ERANGE || ch <= 0 || ch >= 0xFFFE) // invalid character
|
||||
if (pch == nullptr || *pch != L'\0' || errno == ERANGE || ch <= 0 || ch >= 0xFFFE) // invalid character
|
||||
{
|
||||
start = pos;
|
||||
continue;
|
||||
@ -253,7 +253,7 @@ std::wstring Internet::ConvertToWide(LPCSTR str, int codepage)
|
||||
if (str && *str)
|
||||
{
|
||||
int strLen = (int)strlen(str);
|
||||
int bufLen = MultiByteToWideChar(codepage, 0, str, strLen, NULL, 0);
|
||||
int bufLen = MultiByteToWideChar(codepage, 0, str, strLen, nullptr, 0);
|
||||
if (bufLen > 0)
|
||||
{
|
||||
szWide.resize(bufLen);
|
||||
|
@ -29,7 +29,7 @@
|
||||
|
||||
static std::vector<ParentMeasure*> g_ParentMeasures;
|
||||
bool g_Initialized = false;
|
||||
HINSTANCE g_Instance = NULL;
|
||||
HINSTANCE g_Instance = nullptr;
|
||||
|
||||
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
||||
{
|
||||
@ -116,7 +116,7 @@ PLUGIN_EXPORT void Reload(void* data, void* rm, double* maxValue)
|
||||
{
|
||||
// ParentMeasure is created when PlayerName is an actual player (and not a reference)
|
||||
ParentMeasure* parent = measure->parent;
|
||||
Player* oldPlayer = NULL;
|
||||
Player* oldPlayer = nullptr;
|
||||
if (parent)
|
||||
{
|
||||
if (parent->data != data)
|
||||
@ -147,13 +147,13 @@ PLUGIN_EXPORT void Reload(void* data, void* rm, double* maxValue)
|
||||
}
|
||||
else if (_wcsicmp(L"foobar2000", str) == 0)
|
||||
{
|
||||
HWND fooWindow = FindWindow(L"foo_rainmeter_class", NULL);
|
||||
HWND fooWindow = FindWindow(L"foo_rainmeter_class", nullptr);
|
||||
if (fooWindow)
|
||||
{
|
||||
const WCHAR* error = L"Your foobar2000 plugin is out of date.\n\nDo you want to update the plugin now?";
|
||||
if (MessageBox(NULL, error, L"Rainmeter", MB_YESNO | MB_ICONINFORMATION | MB_TOPMOST) == IDYES)
|
||||
if (MessageBox(nullptr, error, L"Rainmeter", MB_YESNO | MB_ICONINFORMATION | MB_TOPMOST) == IDYES)
|
||||
{
|
||||
ShellExecute(NULL, L"open", L"http://github.com/poiru/foo-cad#readme", NULL, NULL, SW_SHOWNORMAL);
|
||||
ShellExecute(nullptr, L"open", L"http://github.com/poiru/foo-cad#readme", nullptr, nullptr, SW_SHOWNORMAL);
|
||||
}
|
||||
}
|
||||
|
||||
@ -365,7 +365,7 @@ PLUGIN_EXPORT LPCWSTR GetString(void* data)
|
||||
{
|
||||
Measure* measure = (Measure*)data;
|
||||
ParentMeasure* parent = measure->parent;
|
||||
if (!parent) return NULL;
|
||||
if (!parent) return nullptr;
|
||||
|
||||
const Player* player = parent->player;
|
||||
static WCHAR buffer[32];
|
||||
@ -435,7 +435,7 @@ PLUGIN_EXPORT LPCWSTR GetString(void* data)
|
||||
return buffer;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PLUGIN_EXPORT void Finalize(void* data)
|
||||
|
@ -141,7 +141,7 @@ void Player::FindLyrics()
|
||||
m_Lyrics.clear();
|
||||
|
||||
unsigned int id;
|
||||
HANDLE thread = (HANDLE)_beginthreadex(NULL, 0, LyricsThreadProc, this, 0, &id);
|
||||
HANDLE thread = (HANDLE)_beginthreadex(nullptr, 0, LyricsThreadProc, this, 0, &id);
|
||||
if (thread)
|
||||
{
|
||||
m_InternetThread = thread;
|
||||
@ -185,7 +185,7 @@ unsigned __stdcall Player::LyricsThreadProc(void* pParam)
|
||||
}
|
||||
|
||||
CloseHandle(player->m_InternetThread);
|
||||
player->m_InternetThread = NULL;
|
||||
player->m_InternetThread = nullptr;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include "AIMP/aimp2_sdk.h"
|
||||
#include "Winamp/wa_ipc.h"
|
||||
|
||||
Player* PlayerAIMP::c_Player = NULL;
|
||||
Player* PlayerAIMP::c_Player = nullptr;
|
||||
|
||||
/*
|
||||
** Constructor.
|
||||
@ -44,7 +44,7 @@ PlayerAIMP::PlayerAIMP() : Player(),
|
||||
*/
|
||||
PlayerAIMP::~PlayerAIMP()
|
||||
{
|
||||
c_Player = NULL;
|
||||
c_Player = nullptr;
|
||||
if (m_FileMap) UnmapViewOfFile(m_FileMap);
|
||||
if (m_FileMapHandle) CloseHandle(m_FileMapHandle);
|
||||
}
|
||||
@ -79,7 +79,7 @@ bool PlayerAIMP::CheckWindow()
|
||||
|
||||
if (m_Window)
|
||||
{
|
||||
m_WinampWindow = FindWindow(L"Winamp v1.x", NULL);
|
||||
m_WinampWindow = FindWindow(L"Winamp v1.x", nullptr);
|
||||
|
||||
m_FileMapHandle = OpenFileMapping(FILE_MAP_READ, FALSE, L"AIMP2_RemoteInfo");
|
||||
if (m_FileMapHandle)
|
||||
@ -315,14 +315,14 @@ void PlayerAIMP::OpenPlayer(std::wstring& path)
|
||||
|
||||
if (RegQueryValueEx(hKey,
|
||||
L"DisplayIcon",
|
||||
NULL,
|
||||
nullptr,
|
||||
(LPDWORD)&type,
|
||||
(LPBYTE)data,
|
||||
(LPDWORD)&size) == ERROR_SUCCESS)
|
||||
{
|
||||
if (type == REG_SZ)
|
||||
{
|
||||
ShellExecute(NULL, L"open", data, NULL, NULL, SW_SHOW);
|
||||
ShellExecute(nullptr, L"open", data, nullptr, nullptr, SW_SHOW);
|
||||
path = data;
|
||||
}
|
||||
}
|
||||
@ -338,7 +338,7 @@ void PlayerAIMP::OpenPlayer(std::wstring& path)
|
||||
|
||||
if (RegQueryValueEx(hKey,
|
||||
L"DisplayIcon",
|
||||
NULL,
|
||||
nullptr,
|
||||
(LPDWORD)&type,
|
||||
(LPBYTE)data,
|
||||
(LPDWORD)&size) == ERROR_SUCCESS)
|
||||
@ -348,7 +348,7 @@ void PlayerAIMP::OpenPlayer(std::wstring& path)
|
||||
path = data;
|
||||
path.resize(path.find_last_of(L'\\') + 1);
|
||||
path += L"AIMP3.exe";
|
||||
ShellExecute(NULL, L"open", path.c_str(), NULL, NULL, SW_SHOW);
|
||||
ShellExecute(nullptr, L"open", path.c_str(), nullptr, nullptr, SW_SHOW);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -358,6 +358,6 @@ void PlayerAIMP::OpenPlayer(std::wstring& path)
|
||||
}
|
||||
else
|
||||
{
|
||||
ShellExecute(NULL, L"open", path.c_str(), NULL, NULL, SW_SHOW);
|
||||
ShellExecute(nullptr, L"open", path.c_str(), nullptr, nullptr, SW_SHOW);
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include "PlayerCAD.h"
|
||||
#include "CAD/cad_sdk.h"
|
||||
|
||||
Player* PlayerCAD::c_Player = NULL;
|
||||
Player* PlayerCAD::c_Player = nullptr;
|
||||
extern HINSTANCE g_Instance;
|
||||
|
||||
// This player emulates the CD Art Display IPC interface, which is supported by
|
||||
@ -45,7 +45,7 @@ PlayerCAD::PlayerCAD() : Player(),
|
||||
*/
|
||||
PlayerCAD::~PlayerCAD()
|
||||
{
|
||||
c_Player = NULL;
|
||||
c_Player = nullptr;
|
||||
Uninitialize();
|
||||
}
|
||||
|
||||
@ -85,8 +85,8 @@ void PlayerCAD::Initialize()
|
||||
CW_USEDEFAULT,
|
||||
CW_USEDEFAULT,
|
||||
CW_USEDEFAULT,
|
||||
NULL,
|
||||
NULL,
|
||||
nullptr,
|
||||
nullptr,
|
||||
g_Instance,
|
||||
this);
|
||||
|
||||
@ -98,8 +98,8 @@ void PlayerCAD::Initialize()
|
||||
FPCHANGEWINDOWMESSAGEFILTEREX ChangeWindowMessageFilterEx = (FPCHANGEWINDOWMESSAGEFILTEREX)GetProcAddress(hUser32, "ChangeWindowMessageFilterEx");
|
||||
if (ChangeWindowMessageFilterEx)
|
||||
{
|
||||
ChangeWindowMessageFilterEx(m_Window, WM_USER, MSGFLT_ALLOW, NULL);
|
||||
ChangeWindowMessageFilterEx(m_Window, WM_COPYDATA, MSGFLT_ALLOW, NULL);
|
||||
ChangeWindowMessageFilterEx(m_Window, WM_USER, MSGFLT_ALLOW, nullptr);
|
||||
ChangeWindowMessageFilterEx(m_Window, WM_COPYDATA, MSGFLT_ALLOW, nullptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -119,17 +119,17 @@ void PlayerCAD::Initialize()
|
||||
LPCTSTR file = RmGetSettingsFile();
|
||||
|
||||
// Read saved settings
|
||||
GetPrivateProfileString(L"NowPlaying.dll", L"ClassName", NULL, buffer, MAX_PATH, file);
|
||||
GetPrivateProfileString(L"NowPlaying.dll", L"ClassName", nullptr, buffer, MAX_PATH, file);
|
||||
std::wstring className = buffer;
|
||||
|
||||
GetPrivateProfileString(L"NowPlaying.dll", L"WindowName", NULL, buffer, MAX_PATH, file);
|
||||
GetPrivateProfileString(L"NowPlaying.dll", L"WindowName", nullptr, buffer, MAX_PATH, file);
|
||||
std::wstring windowName = buffer;
|
||||
|
||||
GetPrivateProfileString(L"NowPlaying.dll", L"PlayerPath", NULL, buffer, MAX_PATH, file);
|
||||
GetPrivateProfileString(L"NowPlaying.dll", L"PlayerPath", nullptr, buffer, MAX_PATH, file);
|
||||
m_PlayerPath = buffer;
|
||||
|
||||
LPCTSTR classSz = className.empty() ? NULL : className.c_str();
|
||||
LPCTSTR windowSz = windowName.empty() ? NULL : windowName.c_str();
|
||||
LPCTSTR classSz = className.empty() ? nullptr : className.c_str();
|
||||
LPCTSTR windowSz = windowName.empty() ? nullptr : windowName.c_str();
|
||||
|
||||
if (classSz || windowSz)
|
||||
{
|
||||
@ -138,12 +138,12 @@ void PlayerCAD::Initialize()
|
||||
else
|
||||
{
|
||||
classSz = L"CD Art Display IPC Class";
|
||||
m_PlayerWindow = FindWindow(classSz, NULL);
|
||||
m_PlayerWindow = FindWindow(classSz, nullptr);
|
||||
if (m_PlayerWindow)
|
||||
{
|
||||
WritePrivateProfileString(L"NowPlaying.dll", L"ClassName", classSz, file);
|
||||
|
||||
windowSz = (GetWindowText(m_PlayerWindow, buffer, MAX_PATH) > 0) ? buffer : NULL;
|
||||
windowSz = (GetWindowText(m_PlayerWindow, buffer, MAX_PATH) > 0) ? buffer : nullptr;
|
||||
WritePrivateProfileString(L"NowPlaying.dll", L"WindowName", windowSz, file);
|
||||
|
||||
DWORD pID;
|
||||
@ -151,7 +151,7 @@ void PlayerCAD::Initialize()
|
||||
HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, pID);
|
||||
if (hProcess)
|
||||
{
|
||||
if (GetModuleFileNameEx(hProcess, NULL, buffer, MAX_PATH) > 0)
|
||||
if (GetModuleFileNameEx(hProcess, nullptr, buffer, MAX_PATH) > 0)
|
||||
{
|
||||
WritePrivateProfileString(L"NowPlaying.dll", L"PlayerPath", buffer, file);
|
||||
}
|
||||
@ -279,7 +279,7 @@ LRESULT CALLBACK PlayerCAD::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
|
||||
WCHAR* data = (WCHAR*)cds->lpData;
|
||||
WCHAR* pos;
|
||||
UINT index = 1;
|
||||
while ((pos = wcschr(data, '\t')) != NULL)
|
||||
while ((pos = wcschr(data, '\t')) != nullptr)
|
||||
{
|
||||
switch (index)
|
||||
{
|
||||
@ -368,8 +368,8 @@ LRESULT CALLBACK PlayerCAD::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
|
||||
player->m_PlayerPath.assign(data, 0, len);
|
||||
data.erase(0, ++len);
|
||||
|
||||
LPCTSTR classSz = className.empty() ? NULL : className.c_str();
|
||||
LPCTSTR windowSz = windowName.empty() ? NULL : windowName.c_str();
|
||||
LPCTSTR classSz = className.empty() ? nullptr : className.c_str();
|
||||
LPCTSTR windowSz = windowName.empty() ? nullptr : windowName.c_str();
|
||||
LPCTSTR file = RmGetSettingsFile();
|
||||
|
||||
WritePrivateProfileString(L"NowPlaying.dll", L"ClassName", classSz, file);
|
||||
@ -537,15 +537,15 @@ void PlayerCAD::OpenPlayer(std::wstring& path)
|
||||
{
|
||||
if (!m_Initialized)
|
||||
{
|
||||
HINSTANCE ret = NULL;
|
||||
HINSTANCE ret = nullptr;
|
||||
|
||||
if (!path.empty())
|
||||
{
|
||||
ret = ShellExecute(NULL, L"open", path.c_str(), NULL, NULL, SW_SHOW);
|
||||
ret = ShellExecute(nullptr, L"open", path.c_str(), nullptr, nullptr, SW_SHOW);
|
||||
}
|
||||
else if (!m_PlayerPath.empty())
|
||||
{
|
||||
ret = ShellExecute(NULL, L"open", m_PlayerPath.c_str(), NULL, NULL, SW_SHOW);
|
||||
ret = ShellExecute(nullptr, L"open", m_PlayerPath.c_str(), nullptr, nullptr, SW_SHOW);
|
||||
}
|
||||
|
||||
m_Open = (ret > (HINSTANCE)32);
|
||||
|
@ -19,7 +19,7 @@
|
||||
#include "StdAfx.h"
|
||||
#include "PlayerITunes.h"
|
||||
|
||||
Player* PlayerITunes::c_Player = NULL;
|
||||
Player* PlayerITunes::c_Player = nullptr;
|
||||
extern HINSTANCE g_Instance;
|
||||
|
||||
/*
|
||||
@ -101,7 +101,7 @@ HRESULT STDMETHODCALLTYPE PlayerITunes::CEventHandler::Invoke(DISPID dispidMembe
|
||||
|
||||
case ITEventAboutToPromptUserToQuit:
|
||||
PostMessage(m_Player->m_CallbackWindow, WM_USER, ITEventAboutToPromptUserToQuit, 0);
|
||||
SetTimer(m_Player->m_CallbackWindow, TIMER_CHECKACTIVE, 500, NULL);
|
||||
SetTimer(m_Player->m_CallbackWindow, TIMER_CHECKACTIVE, 500, nullptr);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -135,7 +135,7 @@ PlayerITunes::PlayerITunes() : Player(),
|
||||
CW_USEDEFAULT,
|
||||
CW_USEDEFAULT,
|
||||
HWND_MESSAGE,
|
||||
NULL,
|
||||
nullptr,
|
||||
g_Instance,
|
||||
this);
|
||||
}
|
||||
@ -146,7 +146,7 @@ PlayerITunes::PlayerITunes() : Player(),
|
||||
*/
|
||||
PlayerITunes::~PlayerITunes()
|
||||
{
|
||||
c_Player = NULL;
|
||||
c_Player = nullptr;
|
||||
|
||||
DestroyWindow(m_CallbackWindow);
|
||||
UnregisterClass(L"NowPlayingITunesClass", g_Instance);
|
||||
@ -176,7 +176,7 @@ void PlayerITunes::Initialize()
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
HRESULT hr = CoCreateInstance(CLSID_iTunesApp, NULL, CLSCTX_LOCAL_SERVER, IID_IiTunes, (PVOID*)&m_iTunes);
|
||||
HRESULT hr = CoCreateInstance(CLSID_iTunesApp, nullptr, CLSCTX_LOCAL_SERVER, IID_IiTunes, (PVOID*)&m_iTunes);
|
||||
|
||||
if (hr == CO_E_SERVER_EXEC_FAILURE)
|
||||
{
|
||||
@ -187,7 +187,7 @@ void PlayerITunes::Initialize()
|
||||
else if (hr != S_OK)
|
||||
{
|
||||
// Failed to get hold of iTunes instance via COM
|
||||
m_iTunes = NULL;
|
||||
m_iTunes = nullptr;
|
||||
}
|
||||
|
||||
break;
|
||||
@ -621,7 +621,7 @@ void PlayerITunes::ClosePlayer()
|
||||
{
|
||||
m_iTunes->Quit();
|
||||
Uninitialize();
|
||||
SetTimer(m_CallbackWindow, TIMER_CHECKACTIVE, 500, NULL);
|
||||
SetTimer(m_CallbackWindow, TIMER_CHECKACTIVE, 500, nullptr);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -630,5 +630,5 @@ void PlayerITunes::ClosePlayer()
|
||||
*/
|
||||
void PlayerITunes::OpenPlayer(std::wstring& path)
|
||||
{
|
||||
ShellExecute(NULL, L"open", path.empty() ? L"iTunes.exe" : path.c_str(), NULL, NULL, SW_SHOW);
|
||||
ShellExecute(nullptr, L"open", path.empty() ? L"iTunes.exe" : path.c_str(), nullptr, nullptr, SW_SHOW);
|
||||
}
|
||||
|
@ -19,7 +19,7 @@
|
||||
#include "StdAfx.h"
|
||||
#include "PlayerSpotify.h"
|
||||
|
||||
Player* PlayerSpotify::c_Player = NULL;
|
||||
Player* PlayerSpotify::c_Player = nullptr;
|
||||
|
||||
/*
|
||||
** Constructor.
|
||||
@ -37,7 +37,7 @@ PlayerSpotify::PlayerSpotify() : Player(),
|
||||
*/
|
||||
PlayerSpotify::~PlayerSpotify()
|
||||
{
|
||||
c_Player = NULL;
|
||||
c_Player = nullptr;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -67,7 +67,7 @@ bool PlayerSpotify::CheckWindow()
|
||||
{
|
||||
m_LastCheckTime = time;
|
||||
|
||||
m_Window = FindWindow(L"SpotifyMainWindow", NULL);
|
||||
m_Window = FindWindow(L"SpotifyMainWindow", nullptr);
|
||||
if (m_Window)
|
||||
{
|
||||
m_Initialized = true;
|
||||
@ -202,8 +202,8 @@ void PlayerSpotify::OpenPlayer(std::wstring& path)
|
||||
DWORD type = 0;
|
||||
|
||||
if (RegQueryValueEx(hKey,
|
||||
NULL,
|
||||
NULL,
|
||||
nullptr,
|
||||
nullptr,
|
||||
(LPDWORD)&type,
|
||||
(LPBYTE)data,
|
||||
(LPDWORD)&size) == ERROR_SUCCESS)
|
||||
@ -213,7 +213,7 @@ void PlayerSpotify::OpenPlayer(std::wstring& path)
|
||||
path = data;
|
||||
path.erase(0, 1); // Get rid of the leading quote
|
||||
path.resize(path.length() - 3); // And the ",0 at the end
|
||||
ShellExecute(NULL, L"open", path.c_str(), NULL, NULL, SW_SHOW);
|
||||
ShellExecute(nullptr, L"open", path.c_str(), nullptr, nullptr, SW_SHOW);
|
||||
}
|
||||
}
|
||||
|
||||
@ -222,7 +222,7 @@ void PlayerSpotify::OpenPlayer(std::wstring& path)
|
||||
}
|
||||
else
|
||||
{
|
||||
ShellExecute(NULL, L"open", path.c_str(), NULL, NULL, SW_SHOW);
|
||||
ShellExecute(nullptr, L"open", path.c_str(), nullptr, nullptr, SW_SHOW);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -19,7 +19,7 @@
|
||||
#include "StdAfx.h"
|
||||
#include "PlayerWLM.h"
|
||||
|
||||
Player* PlayerWLM::c_Player = NULL;
|
||||
Player* PlayerWLM::c_Player = nullptr;
|
||||
extern HINSTANCE g_Instance;
|
||||
|
||||
// This player emulates the MSN/WLM Messenger 'Listening to' interface, which is
|
||||
@ -47,8 +47,8 @@ PlayerWLM::PlayerWLM() : Player(),
|
||||
CW_USEDEFAULT,
|
||||
CW_USEDEFAULT,
|
||||
CW_USEDEFAULT,
|
||||
NULL,
|
||||
NULL,
|
||||
nullptr,
|
||||
nullptr,
|
||||
g_Instance,
|
||||
this);
|
||||
|
||||
@ -61,7 +61,7 @@ PlayerWLM::PlayerWLM() : Player(),
|
||||
*/
|
||||
PlayerWLM::~PlayerWLM()
|
||||
{
|
||||
c_Player = NULL;
|
||||
c_Player = nullptr;
|
||||
DestroyWindow(m_Window);
|
||||
UnregisterClass(L"MsnMsgrUIManager", g_Instance);
|
||||
}
|
||||
|
@ -19,7 +19,7 @@
|
||||
#include "StdAfx.h"
|
||||
#include "PlayerWMP.h"
|
||||
|
||||
Player* PlayerWMP::c_Player = NULL;
|
||||
Player* PlayerWMP::c_Player = nullptr;
|
||||
extern HINSTANCE g_Instance;
|
||||
|
||||
namespace {
|
||||
@ -114,7 +114,7 @@ HRESULT STDMETHODCALLTYPE PlayerWMP::CRemoteHost::QueryInterface(IID const& riid
|
||||
}
|
||||
else
|
||||
{
|
||||
*object = NULL;
|
||||
*object = nullptr;
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
@ -143,11 +143,11 @@ HRESULT PlayerWMP::CRemoteHost::GetScriptableObject(BSTR* pbstrName, IDispatch**
|
||||
{
|
||||
if (pbstrName)
|
||||
{
|
||||
*pbstrName = NULL;
|
||||
*pbstrName = nullptr;
|
||||
}
|
||||
if (ppDispatch)
|
||||
{
|
||||
*ppDispatch = NULL;
|
||||
*ppDispatch = nullptr;
|
||||
}
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
@ -220,7 +220,7 @@ PlayerWMP::PlayerWMP() : Player(),
|
||||
|
||||
PlayerWMP::~PlayerWMP()
|
||||
{
|
||||
c_Player = NULL;
|
||||
c_Player = nullptr;
|
||||
Uninitialize();
|
||||
}
|
||||
|
||||
@ -265,13 +265,13 @@ void PlayerWMP::Initialize()
|
||||
L"NowPlayingWMP", L"",
|
||||
WS_DISABLED,
|
||||
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
|
||||
NULL, NULL, g_Instance, NULL);
|
||||
nullptr, nullptr, g_Instance, nullptr);
|
||||
|
||||
HWND window = CreateWindow(
|
||||
L"AtlAxWin", L"",
|
||||
WS_DISABLED | WS_CHILD,
|
||||
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
|
||||
m_Window, NULL, g_Instance, NULL);
|
||||
m_Window, nullptr, g_Instance, nullptr);
|
||||
|
||||
Microsoft::WRL::ComPtr<IUnknown> axHost;
|
||||
Microsoft::WRL::ComPtr<IObjectWithSite> hostObject;
|
||||
@ -513,7 +513,7 @@ void PlayerWMP::UpdateData()
|
||||
{
|
||||
m_LastCheckTime = time;
|
||||
|
||||
if (FindWindow(L"WMPlayerApp", NULL))
|
||||
if (FindWindow(L"WMPlayerApp", nullptr))
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
@ -639,7 +639,7 @@ void PlayerWMP::SetVolume(int volume)
|
||||
*/
|
||||
void PlayerWMP::ClosePlayer()
|
||||
{
|
||||
HWND wnd = FindWindow(L"WMPlayerApp", NULL);
|
||||
HWND wnd = FindWindow(L"WMPlayerApp", nullptr);
|
||||
|
||||
if (wnd)
|
||||
{
|
||||
@ -653,5 +653,5 @@ void PlayerWMP::ClosePlayer()
|
||||
*/
|
||||
void PlayerWMP::OpenPlayer(std::wstring& path)
|
||||
{
|
||||
ShellExecute(NULL, L"open", path.empty() ? L"wmplayer.exe" : path.c_str(), NULL, NULL, SW_SHOW);
|
||||
ShellExecute(nullptr, L"open", path.empty() ? L"wmplayer.exe" : path.c_str(), nullptr, nullptr, SW_SHOW);
|
||||
}
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include "Winamp/wa_ipc.h"
|
||||
#include "Winamp/wa_cmd.h"
|
||||
|
||||
Player* PlayerWinamp::c_Player = NULL;
|
||||
Player* PlayerWinamp::c_Player = nullptr;
|
||||
|
||||
// This player retrieves data through the Winamp IPC interface.
|
||||
|
||||
@ -47,7 +47,7 @@ PlayerWinamp::PlayerWinamp(WINAMPTYPE type) : Player(),
|
||||
*/
|
||||
PlayerWinamp::~PlayerWinamp()
|
||||
{
|
||||
c_Player = NULL;
|
||||
c_Player = nullptr;
|
||||
if (m_WinampHandle) CloseHandle(m_WinampHandle);
|
||||
}
|
||||
|
||||
@ -78,7 +78,7 @@ bool PlayerWinamp::CheckWindow()
|
||||
{
|
||||
m_LastCheckTime = time;
|
||||
|
||||
m_Window = FindWindow(L"Winamp v1.x", NULL);
|
||||
m_Window = FindWindow(L"Winamp v1.x", nullptr);
|
||||
if (m_Window)
|
||||
{
|
||||
DWORD pID;
|
||||
@ -136,7 +136,7 @@ void PlayerWinamp::UpdateData()
|
||||
|
||||
if (m_UseUnicodeAPI)
|
||||
{
|
||||
if (!ReadProcessMemory(m_WinampHandle, m_WinampAddress, &wBuffer, sizeof(wBuffer), NULL))
|
||||
if (!ReadProcessMemory(m_WinampHandle, m_WinampAddress, &wBuffer, sizeof(wBuffer), nullptr))
|
||||
{
|
||||
// Failed to read memory
|
||||
return;
|
||||
@ -148,7 +148,7 @@ void PlayerWinamp::UpdateData()
|
||||
int pos = SendMessage(m_Window, WM_WA_IPC, 0, IPC_GETLISTPOS);
|
||||
LPCVOID address = (LPCVOID)SendMessage(m_Window, WM_WA_IPC, pos, IPC_GETPLAYLISTFILE);
|
||||
|
||||
if (!ReadProcessMemory(m_WinampHandle, address, &cBuffer, sizeof(cBuffer), NULL))
|
||||
if (!ReadProcessMemory(m_WinampHandle, address, &cBuffer, sizeof(cBuffer), nullptr))
|
||||
{
|
||||
// Failed to read memory
|
||||
return;
|
||||
@ -281,13 +281,13 @@ void PlayerWinamp::UpdateData()
|
||||
if (m_UseUnicodeAPI)
|
||||
{
|
||||
LPCVOID address = (LPCVOID)SendMessage(m_Window, WM_WA_IPC, 0, IPC_GET_PLAYING_TITLE);
|
||||
ReadProcessMemory(m_WinampHandle, address, &wBuffer, sizeof(wBuffer), NULL);
|
||||
ReadProcessMemory(m_WinampHandle, address, &wBuffer, sizeof(wBuffer), nullptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
int pos = SendMessage(m_Window, WM_WA_IPC, 0, IPC_GETLISTPOS);
|
||||
LPCVOID address = (LPCVOID)SendMessage(m_Window, WM_WA_IPC, pos, IPC_GETPLAYLISTTITLE);
|
||||
ReadProcessMemory(m_WinampHandle, address, &cBuffer, sizeof(cBuffer), NULL);
|
||||
ReadProcessMemory(m_WinampHandle, address, &cBuffer, sizeof(cBuffer), nullptr);
|
||||
mbstowcs(wBuffer, cBuffer, MAX_PATH);
|
||||
}
|
||||
|
||||
@ -458,7 +458,7 @@ void PlayerWinamp::OpenPlayer(std::wstring& path)
|
||||
{
|
||||
if (m_WinampType == WA_WINAMP)
|
||||
{
|
||||
ShellExecute(NULL, L"open", path.empty() ? L"winamp.exe" : path.c_str(), NULL, NULL, SW_SHOW);
|
||||
ShellExecute(nullptr, L"open", path.empty() ? L"winamp.exe" : path.c_str(), nullptr, nullptr, SW_SHOW);
|
||||
}
|
||||
else // if (m_WinampType == WA_MEDIAMONKEY)
|
||||
{
|
||||
@ -477,15 +477,15 @@ void PlayerWinamp::OpenPlayer(std::wstring& path)
|
||||
DWORD type = 0;
|
||||
|
||||
if (RegQueryValueEx(hKey,
|
||||
NULL,
|
||||
NULL,
|
||||
nullptr,
|
||||
nullptr,
|
||||
(LPDWORD)&type,
|
||||
(LPBYTE)data,
|
||||
(LPDWORD)&size) == ERROR_SUCCESS)
|
||||
{
|
||||
if (type == REG_SZ)
|
||||
{
|
||||
ShellExecute(NULL, L"open", data, NULL, NULL, SW_SHOW);
|
||||
ShellExecute(nullptr, L"open", data, nullptr, nullptr, SW_SHOW);
|
||||
path = data;
|
||||
}
|
||||
}
|
||||
@ -495,7 +495,7 @@ void PlayerWinamp::OpenPlayer(std::wstring& path)
|
||||
}
|
||||
else
|
||||
{
|
||||
ShellExecute(NULL, L"open", path.c_str(), NULL, NULL, SW_SHOW);
|
||||
ShellExecute(nullptr, L"open", path.c_str(), nullptr, nullptr, SW_SHOW);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user