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:
		@@ -41,7 +41,7 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLi
 | 
			
		||||
	// Avoid loading a dll from current directory
 | 
			
		||||
	SetDllDirectory(L"");
 | 
			
		||||
 | 
			
		||||
	CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE);
 | 
			
		||||
	CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE);
 | 
			
		||||
	InitCommonControls();
 | 
			
		||||
 | 
			
		||||
	if (lpCmdLine[0] == L'"')
 | 
			
		||||
@@ -88,7 +88,7 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLi
 | 
			
		||||
	}
 | 
			
		||||
	else
 | 
			
		||||
	{
 | 
			
		||||
		HRESULT hr = SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, SHGFP_TYPE_CURRENT, buffer);
 | 
			
		||||
		HRESULT hr = SHGetFolderPath(nullptr, CSIDL_APPDATA, nullptr, SHGFP_TYPE_CURRENT, buffer);
 | 
			
		||||
		wcscat(buffer, L"\\Rainmeter\\");
 | 
			
		||||
		g_Data.settingsPath = buffer;
 | 
			
		||||
		wcscat(buffer, L"Rainmeter.ini");
 | 
			
		||||
@@ -106,14 +106,14 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLi
 | 
			
		||||
			else
 | 
			
		||||
			{
 | 
			
		||||
				std::wstring error = L"SkinPath not found.\nMake sure that Rainmeter has been run at least once.";
 | 
			
		||||
				MessageBox(NULL, error.c_str(), L"Rainmeter Skin Installer", MB_ERROR);
 | 
			
		||||
				MessageBox(nullptr, error.c_str(), L"Rainmeter Skin Installer", MB_ERROR);
 | 
			
		||||
				return 1;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		else
 | 
			
		||||
		{
 | 
			
		||||
			std::wstring error = L"Rainmeter.ini not found.\nMake sure that Rainmeter has been run at least once.";
 | 
			
		||||
			MessageBox(NULL, error.c_str(), L"Rainmeter Skin Installer", MB_ERROR);
 | 
			
		||||
			MessageBox(nullptr, error.c_str(), L"Rainmeter Skin Installer", MB_ERROR);
 | 
			
		||||
			return 1;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
@@ -231,10 +231,10 @@ bool CloseRainmeterIfActive()
 | 
			
		||||
bool IsRunning(const WCHAR* name, HANDLE* hMutex)
 | 
			
		||||
{
 | 
			
		||||
	// Create mutex
 | 
			
		||||
	HANDLE hMutexTmp = CreateMutex(NULL, FALSE, name);
 | 
			
		||||
	HANDLE hMutexTmp = CreateMutex(nullptr, FALSE, name);
 | 
			
		||||
	if (GetLastError() == ERROR_ALREADY_EXISTS)
 | 
			
		||||
	{
 | 
			
		||||
		*hMutex = NULL;
 | 
			
		||||
		*hMutex = nullptr;
 | 
			
		||||
		return true;
 | 
			
		||||
	}
 | 
			
		||||
	else
 | 
			
		||||
@@ -254,7 +254,7 @@ bool CopyFiles(const std::wstring& strFrom, const std::wstring& strTo, bool bMov
 | 
			
		||||
 | 
			
		||||
	SHFILEOPSTRUCT fo =
 | 
			
		||||
	{
 | 
			
		||||
		NULL,
 | 
			
		||||
		nullptr,
 | 
			
		||||
		bMove ? FO_MOVE : FO_COPY,
 | 
			
		||||
		tmpFrom.c_str(),
 | 
			
		||||
		tmpTo.c_str(),
 | 
			
		||||
@@ -301,11 +301,11 @@ std::string ConvertToAscii(LPCTSTR str)
 | 
			
		||||
	if (str && *str)
 | 
			
		||||
	{
 | 
			
		||||
		int strLen = (int)wcslen(str);
 | 
			
		||||
		int bufLen = WideCharToMultiByte(CP_ACP, 0, str, strLen, NULL, 0, NULL, NULL);
 | 
			
		||||
		int bufLen = WideCharToMultiByte(CP_ACP, 0, str, strLen, nullptr, 0, nullptr, nullptr);
 | 
			
		||||
		if (bufLen > 0)
 | 
			
		||||
		{
 | 
			
		||||
			szAscii.resize(bufLen);
 | 
			
		||||
			WideCharToMultiByte(CP_ACP, 0, str, strLen, &szAscii[0], bufLen, NULL, NULL);
 | 
			
		||||
			WideCharToMultiByte(CP_ACP, 0, str, strLen, &szAscii[0], bufLen, nullptr, nullptr);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return szAscii;
 | 
			
		||||
@@ -318,7 +318,7 @@ std::wstring ConvertToWide(LPCSTR str)
 | 
			
		||||
	if (str && *str)
 | 
			
		||||
	{
 | 
			
		||||
		int strLen = (int)strlen(str);
 | 
			
		||||
		int bufLen = MultiByteToWideChar(CP_ACP, 0, str, strLen, NULL, 0);
 | 
			
		||||
		int bufLen = MultiByteToWideChar(CP_ACP, 0, str, strLen, nullptr, 0);
 | 
			
		||||
		if (bufLen > 0)
 | 
			
		||||
		{
 | 
			
		||||
			szWide.resize(bufLen);
 | 
			
		||||
 
 | 
			
		||||
@@ -28,7 +28,7 @@
 | 
			
		||||
 | 
			
		||||
extern GlobalData g_Data;
 | 
			
		||||
 | 
			
		||||
DialogInstall* DialogInstall::c_Dialog = NULL;
 | 
			
		||||
DialogInstall* DialogInstall::c_Dialog = nullptr;
 | 
			
		||||
 | 
			
		||||
inline bool IsWin32Build()
 | 
			
		||||
{
 | 
			
		||||
@@ -107,7 +107,7 @@ void DialogInstall::Create(HINSTANCE hInstance, LPWSTR lpCmdLine)
 | 
			
		||||
	}
 | 
			
		||||
	else
 | 
			
		||||
	{
 | 
			
		||||
		DialogBoxParam(hInstance, MAKEINTRESOURCE(IDD_INSTALL_DIALOG), NULL, (DLGPROC)DlgProc, (LPARAM)lpCmdLine);
 | 
			
		||||
		DialogBoxParam(hInstance, MAKEINTRESOURCE(IDD_INSTALL_DIALOG), nullptr, (DLGPROC)DlgProc, (LPARAM)lpCmdLine);
 | 
			
		||||
		ReleaseMutex(hMutex);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
@@ -143,7 +143,7 @@ INT_PTR CALLBACK DialogInstall::DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPA
 | 
			
		||||
 | 
			
		||||
		case WM_DESTROY:
 | 
			
		||||
			delete c_Dialog;
 | 
			
		||||
			c_Dialog = NULL;
 | 
			
		||||
			c_Dialog = nullptr;
 | 
			
		||||
			return FALSE;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
@@ -153,7 +153,7 @@ INT_PTR CALLBACK DialogInstall::DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPA
 | 
			
		||||
 | 
			
		||||
INT_PTR DialogInstall::OnInitDialog(WPARAM wParam, LPARAM lParam)
 | 
			
		||||
{
 | 
			
		||||
	HICON hIcon = (HICON)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_SKININSTALLER), IMAGE_ICON, 16, 16, LR_SHARED);
 | 
			
		||||
	HICON hIcon = (HICON)LoadImage(GetModuleHandle(nullptr), MAKEINTRESOURCE(IDI_SKININSTALLER), IMAGE_ICON, 16, 16, LR_SHARED);
 | 
			
		||||
	SendMessage(m_Window, WM_SETICON, ICON_SMALL, (LPARAM)hIcon);
 | 
			
		||||
 | 
			
		||||
	if (GetOSPlatform() >= OSPLATFORM_VISTA)
 | 
			
		||||
@@ -184,7 +184,7 @@ INT_PTR DialogInstall::OnInitDialog(WPARAM wParam, LPARAM lParam)
 | 
			
		||||
			{
 | 
			
		||||
				HWND control = controlIds[i] ? GetDlgItem(m_Window, controlIds[i]) : m_TabInstall.GetWindow();
 | 
			
		||||
				GetWindowRect(control, &r);
 | 
			
		||||
				MapWindowPoints(NULL, m_Window, (POINT*)&r, sizeof(RECT) / sizeof(POINT));
 | 
			
		||||
				MapWindowPoints(nullptr, m_Window, (POINT*)&r, sizeof(RECT) / sizeof(POINT));
 | 
			
		||||
				MoveWindow(control, r.left, r.top - yDiff, r.right - r.left, r.bottom - r.top, TRUE);
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
@@ -204,7 +204,7 @@ INT_PTR DialogInstall::OnInitDialog(WPARAM wParam, LPARAM lParam)
 | 
			
		||||
			m_ErrorMessage += L"\n\nThe Skin Packager tool must be used to create valid .rmskin packages.";
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		MessageBox(NULL, m_ErrorMessage.c_str(), L"Rainmeter Skin Installer", MB_ERROR);
 | 
			
		||||
		MessageBox(nullptr, m_ErrorMessage.c_str(), L"Rainmeter Skin Installer", MB_ERROR);
 | 
			
		||||
		EndDialog(m_Window, 0);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -220,7 +220,7 @@ INT_PTR DialogInstall::OnCommand(WPARAM wParam, LPARAM lParam)
 | 
			
		||||
		{
 | 
			
		||||
			RECT r;
 | 
			
		||||
			GetWindowRect((HWND)lParam, &r);
 | 
			
		||||
			HMENU menu = LoadMenu(GetModuleHandle(NULL), MAKEINTRESOURCE(IDR_INSTALL_MENU));
 | 
			
		||||
			HMENU menu = LoadMenu(GetModuleHandle(nullptr), MAKEINTRESOURCE(IDR_INSTALL_MENU));
 | 
			
		||||
			HMENU subMenu = GetSubMenu(menu, 0);
 | 
			
		||||
 | 
			
		||||
			if (m_PackageSkins.empty() || m_MergeSkins || m_BackupPackage)
 | 
			
		||||
@@ -251,7 +251,7 @@ INT_PTR DialogInstall::OnCommand(WPARAM wParam, LPARAM lParam)
 | 
			
		||||
				--r.bottom,
 | 
			
		||||
				0,
 | 
			
		||||
				m_Window,
 | 
			
		||||
				NULL);
 | 
			
		||||
				nullptr);
 | 
			
		||||
 | 
			
		||||
			DestroyMenu(menu);
 | 
			
		||||
		}
 | 
			
		||||
@@ -324,7 +324,7 @@ bool DialogInstall::ExtractCurrentFile(const std::wstring& fileName)
 | 
			
		||||
		return false;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	HANDLE hFile = CreateFile(fileName.c_str(), GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
 | 
			
		||||
	HANDLE hFile = CreateFile(fileName.c_str(), GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr);
 | 
			
		||||
	if (hFile == INVALID_HANDLE_VALUE)
 | 
			
		||||
	{
 | 
			
		||||
		return false;
 | 
			
		||||
@@ -336,7 +336,7 @@ bool DialogInstall::ExtractCurrentFile(const std::wstring& fileName)
 | 
			
		||||
		BYTE buffer[16384];
 | 
			
		||||
		DWORD written;
 | 
			
		||||
		read = unzReadCurrentFile(m_PackageUnzFile, buffer, 16384);
 | 
			
		||||
		if (read < 0 || !WriteFile(hFile, (LPCVOID)buffer, read, &written, NULL) || read != written)
 | 
			
		||||
		if (read < 0 || !WriteFile(hFile, (LPCVOID)buffer, read, &written, nullptr) || read != written)
 | 
			
		||||
		{
 | 
			
		||||
			read = UNZ_ERRNO;
 | 
			
		||||
			break;
 | 
			
		||||
@@ -407,7 +407,7 @@ bool DialogInstall::ReadPackage()
 | 
			
		||||
	{
 | 
			
		||||
		char cBuffer[MAX_PATH];
 | 
			
		||||
		unz_file_info ufi;
 | 
			
		||||
		if (unzGetCurrentFileInfo(m_PackageUnzFile, &ufi, cBuffer, MAX_PATH, NULL, 0, NULL, 0) == UNZ_OK)
 | 
			
		||||
		if (unzGetCurrentFileInfo(m_PackageUnzFile, &ufi, cBuffer, MAX_PATH, nullptr, 0, nullptr, 0) == UNZ_OK)
 | 
			
		||||
		{
 | 
			
		||||
			MultiByteToWideChar(CP_ACP, 0, cBuffer, strlen(cBuffer) + 1, buffer, MAX_PATH);
 | 
			
		||||
			while (WCHAR* pos = wcschr(buffer, L'/')) *pos = L'\\';
 | 
			
		||||
@@ -495,7 +495,7 @@ bool DialogInstall::ReadPackage()
 | 
			
		||||
					return false;
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
				m_HeaderBitmap = (HBITMAP)LoadImage(NULL, tempFileSz, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
 | 
			
		||||
				m_HeaderBitmap = (HBITMAP)LoadImage(nullptr, tempFileSz, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
 | 
			
		||||
				DeleteFile(tempFileSz);
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
@@ -673,10 +673,10 @@ bool DialogInstall::InstallPackage()
 | 
			
		||||
 | 
			
		||||
			SHFILEOPSTRUCT fo =
 | 
			
		||||
			{
 | 
			
		||||
				NULL,
 | 
			
		||||
				nullptr,
 | 
			
		||||
				FO_DELETE,
 | 
			
		||||
				NULL,
 | 
			
		||||
				NULL,
 | 
			
		||||
				nullptr,
 | 
			
		||||
				nullptr,
 | 
			
		||||
				FOF_NO_UI | FOF_NOCONFIRMATION | FOF_ALLOWUNDO
 | 
			
		||||
			};
 | 
			
		||||
 | 
			
		||||
@@ -690,7 +690,7 @@ bool DialogInstall::InstallPackage()
 | 
			
		||||
			else
 | 
			
		||||
			{
 | 
			
		||||
				std::wstring to = g_Data.skinsPath + L"@Backup\\";
 | 
			
		||||
				CreateDirectory(to.c_str(), NULL);
 | 
			
		||||
				CreateDirectory(to.c_str(), nullptr);
 | 
			
		||||
 | 
			
		||||
				// Delete current backup
 | 
			
		||||
				to += *iter;
 | 
			
		||||
@@ -715,7 +715,7 @@ bool DialogInstall::InstallPackage()
 | 
			
		||||
	{
 | 
			
		||||
		char cBuffer[MAX_PATH];
 | 
			
		||||
		unz_file_info ufi;
 | 
			
		||||
		if (unzGetCurrentFileInfo(m_PackageUnzFile, &ufi, cBuffer, MAX_PATH, NULL, 0, NULL, 0) == UNZ_OK)
 | 
			
		||||
		if (unzGetCurrentFileInfo(m_PackageUnzFile, &ufi, cBuffer, MAX_PATH, nullptr, 0, nullptr, 0) == UNZ_OK)
 | 
			
		||||
		{
 | 
			
		||||
			MultiByteToWideChar(CP_ACP, 0, cBuffer, strlen(cBuffer) + 1, buffer, MAX_PATH);
 | 
			
		||||
			while (WCHAR* pos = wcschr(buffer, L'/')) *pos = L'\\';
 | 
			
		||||
@@ -884,7 +884,7 @@ void DialogInstall::BeginInstall()
 | 
			
		||||
		{
 | 
			
		||||
			ListView_GetItem(item, &lvi);
 | 
			
		||||
 | 
			
		||||
			std::set<std::wstring>* component = NULL;
 | 
			
		||||
			std::set<std::wstring>* component = nullptr;
 | 
			
		||||
			switch (lvi.iGroupId)
 | 
			
		||||
			{
 | 
			
		||||
			case 0: component = &m_PackageSkins;   break;
 | 
			
		||||
@@ -902,7 +902,7 @@ void DialogInstall::BeginInstall()
 | 
			
		||||
	}
 | 
			
		||||
	EnableWindow(item, FALSE);
 | 
			
		||||
 | 
			
		||||
	m_InstallThread = (HANDLE)_beginthreadex(NULL, 0, InstallThread, this, 0, NULL);
 | 
			
		||||
	m_InstallThread = (HANDLE)_beginthreadex(nullptr, 0, InstallThread, this, 0, nullptr);
 | 
			
		||||
	if (!m_InstallThread)
 | 
			
		||||
	{
 | 
			
		||||
		MessageBox(m_Window, L"Unable to start install.", L"Rainmeter Skin Installer", MB_ERROR);
 | 
			
		||||
@@ -972,7 +972,7 @@ void DialogInstall::KeepVariables()
 | 
			
		||||
			{
 | 
			
		||||
				if (keyname[j] == L'=')
 | 
			
		||||
				{
 | 
			
		||||
					if (GetPrivateProfileString(L"Variables", currKey.c_str(), NULL, buffer, 4, toPath.c_str()) > 0)
 | 
			
		||||
					if (GetPrivateProfileString(L"Variables", currKey.c_str(), nullptr, buffer, 4, toPath.c_str()) > 0)
 | 
			
		||||
					{
 | 
			
		||||
						while (keyname[++j] != L'\0') currValue += keyname[j];
 | 
			
		||||
						WritePrivateProfileString(L"Variables", currKey.c_str(), currValue.c_str(), toPath.c_str());
 | 
			
		||||
@@ -1203,7 +1203,7 @@ bool DialogInstall::CreateDirectoryRecursive(const std::wstring& path)
 | 
			
		||||
		// Temporarily terminate string
 | 
			
		||||
		directory[pos] = L'\0';
 | 
			
		||||
 | 
			
		||||
		failed = CreateDirectory(directorySz, NULL) == 0 && GetLastError() == ERROR_PATH_NOT_FOUND;
 | 
			
		||||
		failed = CreateDirectory(directorySz, nullptr) == 0 && GetLastError() == ERROR_PATH_NOT_FOUND;
 | 
			
		||||
 | 
			
		||||
		// Restore slash
 | 
			
		||||
		directory[pos] = L'\\';
 | 
			
		||||
@@ -1288,7 +1288,7 @@ std::wstring DialogInstall::GetWindowsVersionString()
 | 
			
		||||
** Constructor.
 | 
			
		||||
**
 | 
			
		||||
*/
 | 
			
		||||
DialogInstall::TabInstall::TabInstall(HWND wnd) : Tab(GetModuleHandle(NULL), wnd, IDD_INSTALL_TAB, DlgProc)
 | 
			
		||||
DialogInstall::TabInstall::TabInstall(HWND wnd) : Tab(GetModuleHandle(nullptr), wnd, IDD_INSTALL_TAB, DlgProc)
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -1301,7 +1301,7 @@ void DialogInstall::TabInstall::Initialize()
 | 
			
		||||
	if (GetOSPlatform() >= OSPLATFORM_VISTA)
 | 
			
		||||
	{
 | 
			
		||||
		extendedFlags |= LVS_EX_DOUBLEBUFFER;
 | 
			
		||||
		SetWindowTheme(item, L"explorer", NULL);
 | 
			
		||||
		SetWindowTheme(item, L"explorer", nullptr);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	ListView_EnableGroupView(item, TRUE);
 | 
			
		||||
 
 | 
			
		||||
@@ -28,7 +28,7 @@
 | 
			
		||||
extern GlobalData g_Data;
 | 
			
		||||
extern OsNameVersion g_OsNameVersions[];
 | 
			
		||||
 | 
			
		||||
DialogPackage* DialogPackage::c_Dialog = NULL;
 | 
			
		||||
DialogPackage* DialogPackage::c_Dialog = nullptr;
 | 
			
		||||
 | 
			
		||||
DialogPackage::DialogPackage(HWND wnd) : Dialog(wnd),
 | 
			
		||||
	m_TabInfo(wnd),
 | 
			
		||||
@@ -55,7 +55,7 @@ void DialogPackage::Create(HINSTANCE hInstance, LPWSTR lpCmdLine)
 | 
			
		||||
	}
 | 
			
		||||
	else
 | 
			
		||||
	{
 | 
			
		||||
		DialogBoxParam(hInstance, MAKEINTRESOURCE(IDD_PACKAGE_DIALOG), NULL, (DLGPROC)DlgProc, (LPARAM)lpCmdLine);
 | 
			
		||||
		DialogBoxParam(hInstance, MAKEINTRESOURCE(IDD_PACKAGE_DIALOG), nullptr, (DLGPROC)DlgProc, (LPARAM)lpCmdLine);
 | 
			
		||||
		ReleaseMutex(hMutex);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
@@ -108,7 +108,7 @@ INT_PTR CALLBACK DialogPackage::DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPA
 | 
			
		||||
 | 
			
		||||
		case WM_DESTROY:
 | 
			
		||||
			delete c_Dialog;
 | 
			
		||||
			c_Dialog = NULL;
 | 
			
		||||
			c_Dialog = nullptr;
 | 
			
		||||
			return FALSE;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
@@ -118,7 +118,7 @@ INT_PTR CALLBACK DialogPackage::DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPA
 | 
			
		||||
 | 
			
		||||
INT_PTR DialogPackage::OnInitDialog(WPARAM wParam, LPARAM lParam)
 | 
			
		||||
{
 | 
			
		||||
	HICON hIcon = (HICON)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_SKININSTALLER), IMAGE_ICON, 16, 16, LR_SHARED);
 | 
			
		||||
	HICON hIcon = (HICON)LoadImage(GetModuleHandle(nullptr), MAKEINTRESOURCE(IDI_SKININSTALLER), IMAGE_ICON, 16, 16, LR_SHARED);
 | 
			
		||||
	SendMessage(m_Window, WM_SETICON, ICON_SMALL, (LPARAM)hIcon);
 | 
			
		||||
 | 
			
		||||
	if (GetOSPlatform() >= OSPLATFORM_VISTA)
 | 
			
		||||
@@ -180,7 +180,7 @@ INT_PTR DialogPackage::OnCommand(WPARAM wParam, LPARAM lParam)
 | 
			
		||||
			ShowWindow(item, SW_SHOWNORMAL);
 | 
			
		||||
			SendMessage(item, PBM_SETMARQUEE, (WPARAM)TRUE, 0);
 | 
			
		||||
 | 
			
		||||
			m_PackagerThread = (HANDLE)_beginthreadex(NULL, 0, PackagerThreadProc, this, 0, NULL);
 | 
			
		||||
			m_PackagerThread = (HANDLE)_beginthreadex(nullptr, 0, PackagerThreadProc, this, 0, nullptr);
 | 
			
		||||
			if (!m_PackagerThread)
 | 
			
		||||
			{
 | 
			
		||||
				MessageBox(m_Window, L"Unknown error.", L"Rainmeter Skin Packager", MB_ERROR);
 | 
			
		||||
@@ -268,7 +268,7 @@ bool DialogPackage::CreatePackage()
 | 
			
		||||
 | 
			
		||||
	auto cleanup = [&]()->bool
 | 
			
		||||
	{
 | 
			
		||||
		zipClose(m_ZipFile, NULL);
 | 
			
		||||
		zipClose(m_ZipFile, nullptr);
 | 
			
		||||
		return false;
 | 
			
		||||
	};
 | 
			
		||||
 | 
			
		||||
@@ -332,8 +332,8 @@ bool DialogPackage::CreatePackage()
 | 
			
		||||
 | 
			
		||||
	// Add footer
 | 
			
		||||
	FILE* file;
 | 
			
		||||
	if (zipClose(m_ZipFile, NULL) == ZIP_OK &&
 | 
			
		||||
		(file = _wfopen(m_TargetFile.c_str(), L"r+b")) != NULL)
 | 
			
		||||
	if (zipClose(m_ZipFile, nullptr) == ZIP_OK &&
 | 
			
		||||
		(file = _wfopen(m_TargetFile.c_str(), L"r+b")) != nullptr)
 | 
			
		||||
	{
 | 
			
		||||
		fseek(file, 0, SEEK_END);
 | 
			
		||||
		DialogInstall::PackageFooter footer = { _ftelli64(file), 0, "RMSKIN" };
 | 
			
		||||
@@ -388,7 +388,7 @@ bool DialogPackage::AddFileToPackage(const WCHAR* filePath, const WCHAR* zipPath
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	int open = zipOpenNewFileInZip(m_ZipFile, zipPathAscii.c_str(), NULL, NULL, 0, NULL, 0, NULL, Z_DEFLATED, Z_DEFAULT_COMPRESSION);
 | 
			
		||||
	int open = zipOpenNewFileInZip(m_ZipFile, zipPathAscii.c_str(), nullptr, nullptr, 0, nullptr, 0, nullptr, Z_DEFLATED, Z_DEFAULT_COMPRESSION);
 | 
			
		||||
	if (open != ZIP_OK)
 | 
			
		||||
	{
 | 
			
		||||
		return false;
 | 
			
		||||
@@ -398,7 +398,7 @@ bool DialogPackage::AddFileToPackage(const WCHAR* filePath, const WCHAR* zipPath
 | 
			
		||||
 | 
			
		||||
	if (filePath)
 | 
			
		||||
	{
 | 
			
		||||
		HANDLE file = CreateFile(filePath, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING,  FILE_ATTRIBUTE_NORMAL, NULL);
 | 
			
		||||
		HANDLE file = CreateFile(filePath, GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING,  FILE_ATTRIBUTE_NORMAL, nullptr);
 | 
			
		||||
		if (file == INVALID_HANDLE_VALUE)
 | 
			
		||||
		{
 | 
			
		||||
			result = false;
 | 
			
		||||
@@ -410,7 +410,7 @@ bool DialogPackage::AddFileToPackage(const WCHAR* filePath, const WCHAR* zipPath
 | 
			
		||||
				const DWORD bufferSize = 16 * 1024;
 | 
			
		||||
				BYTE buffer[bufferSize];
 | 
			
		||||
				DWORD readSize;
 | 
			
		||||
				if (!ReadFile(file, buffer, bufferSize, &readSize, NULL))
 | 
			
		||||
				if (!ReadFile(file, buffer, bufferSize, &readSize, nullptr))
 | 
			
		||||
				{
 | 
			
		||||
					result = false;
 | 
			
		||||
				}
 | 
			
		||||
@@ -448,7 +448,7 @@ bool DialogPackage::AddFolderToPackage(const std::wstring& path, std::wstring ba
 | 
			
		||||
		FindExInfoStandard,
 | 
			
		||||
		&fd,
 | 
			
		||||
		FindExSearchNameMatch,
 | 
			
		||||
		NULL,
 | 
			
		||||
		nullptr,
 | 
			
		||||
		0);
 | 
			
		||||
 | 
			
		||||
	if (hFind == INVALID_HANDLE_VALUE)
 | 
			
		||||
@@ -505,7 +505,7 @@ bool DialogPackage::AddFolderToPackage(const std::wstring& path, std::wstring ba
 | 
			
		||||
			// Add directory entry if folder is empty.
 | 
			
		||||
			std::wstring zipPath = zipPrefix;
 | 
			
		||||
			zipPath.append(currentPath, path.length(), currentPath.length() - path.length());
 | 
			
		||||
			AddFileToPackage(NULL, zipPath.c_str());
 | 
			
		||||
			AddFileToPackage(nullptr, zipPath.c_str());
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		std::list<std::wstring>::const_iterator iter = folders.begin();
 | 
			
		||||
@@ -529,14 +529,14 @@ void DialogPackage::ShowHelp()
 | 
			
		||||
		url += L"_beta";
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	ShellExecute(m_Window, L"open", url.c_str(), NULL, NULL, SW_SHOWNORMAL);
 | 
			
		||||
	ShellExecute(m_Window, L"open", url.c_str(), nullptr, nullptr, SW_SHOWNORMAL);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
std::wstring DialogPackage::SelectFolder(HWND parent, const std::wstring& existingPath)
 | 
			
		||||
{
 | 
			
		||||
	LPCWSTR dialog = MAKEINTRESOURCE(IDD_PACKAGESELECTFOLDER_DIALOG);
 | 
			
		||||
	std::wstring folder = existingPath;
 | 
			
		||||
	if (DialogBoxParam(GetModuleHandle(NULL), dialog, parent, SelectFolderDlgProc, (LPARAM)&folder) != 1)
 | 
			
		||||
	if (DialogBoxParam(GetModuleHandle(nullptr), dialog, parent, SelectFolderDlgProc, (LPARAM)&folder) != 1)
 | 
			
		||||
	{
 | 
			
		||||
		folder.clear();
 | 
			
		||||
	}
 | 
			
		||||
@@ -557,7 +557,7 @@ INT_PTR CALLBACK DialogPackage::SelectFolderDlgProc(HWND hWnd, UINT uMsg, WPARAM
 | 
			
		||||
 | 
			
		||||
			*existingPath += L'*';
 | 
			
		||||
			WIN32_FIND_DATA fd;
 | 
			
		||||
			HANDLE hFind = FindFirstFileEx(existingPath->c_str(), FindExInfoStandard, &fd, FindExSearchNameMatch, NULL, 0);
 | 
			
		||||
			HANDLE hFind = FindFirstFileEx(existingPath->c_str(), FindExInfoStandard, &fd, FindExSearchNameMatch, nullptr, 0);
 | 
			
		||||
			existingPath->pop_back();
 | 
			
		||||
 | 
			
		||||
			if (hFind != INVALID_HANDLE_VALUE)
 | 
			
		||||
@@ -695,7 +695,7 @@ std::pair<std::wstring, std::wstring> DialogPackage::SelectPlugin(HWND parent)
 | 
			
		||||
{
 | 
			
		||||
	LPCWSTR dialog = MAKEINTRESOURCE(IDD_PACKAGESELECTPLUGIN_DIALOG);
 | 
			
		||||
	std::pair<std::wstring, std::wstring> plugins;
 | 
			
		||||
	if (DialogBoxParam(GetModuleHandle(NULL), dialog, parent, SelectPluginDlgProc, (LPARAM)&plugins) != 1)
 | 
			
		||||
	if (DialogBoxParam(GetModuleHandle(nullptr), dialog, parent, SelectPluginDlgProc, (LPARAM)&plugins) != 1)
 | 
			
		||||
	{
 | 
			
		||||
		plugins.first.clear();
 | 
			
		||||
		plugins.second.clear();
 | 
			
		||||
@@ -743,7 +743,7 @@ INT_PTR CALLBACK DialogPackage::SelectPluginDlgProc(HWND hWnd, UINT uMsg, WPARAM
 | 
			
		||||
 | 
			
		||||
				bool x32 = LOWORD(wParam) == IDC_PACKAGESELECTPLUGIN_32BITBROWSE_BUTTON;
 | 
			
		||||
 | 
			
		||||
				LOADED_IMAGE* loadedImage = ImageLoad(ConvertToAscii(buffer).c_str(), NULL);
 | 
			
		||||
				LOADED_IMAGE* loadedImage = ImageLoad(ConvertToAscii(buffer).c_str(), nullptr);
 | 
			
		||||
				if (loadedImage)
 | 
			
		||||
				{
 | 
			
		||||
					WORD machine = loadedImage->FileHeader->FileHeader.Machine;
 | 
			
		||||
@@ -800,7 +800,7 @@ INT_PTR CALLBACK DialogPackage::SelectPluginDlgProc(HWND hWnd, UINT uMsg, WPARAM
 | 
			
		||||
//
 | 
			
		||||
// -----------------------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
DialogPackage::TabInfo::TabInfo(HWND wnd) : Tab(GetModuleHandle(NULL), wnd, IDD_PACKAGEINFO_TAB, DlgProc)
 | 
			
		||||
DialogPackage::TabInfo::TabInfo(HWND wnd) : Tab(GetModuleHandle(nullptr), wnd, IDD_PACKAGEINFO_TAB, DlgProc)
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -824,7 +824,7 @@ void DialogPackage::TabInfo::Initialize()
 | 
			
		||||
	if (GetOSPlatform() >= OSPLATFORM_VISTA)
 | 
			
		||||
	{
 | 
			
		||||
		extendedFlags |= LVS_EX_DOUBLEBUFFER;
 | 
			
		||||
		SetWindowTheme(item, L"explorer", NULL);
 | 
			
		||||
		SetWindowTheme(item, L"explorer", nullptr);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	ListView_EnableGroupView(item, TRUE);
 | 
			
		||||
@@ -1052,7 +1052,7 @@ INT_PTR DialogPackage::TabInfo::OnNotify(WPARAM wParam, LPARAM lParam)
 | 
			
		||||
//
 | 
			
		||||
// -----------------------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
DialogPackage::TabOptions::TabOptions(HWND wnd) : Tab(GetModuleHandle(NULL), wnd, IDD_PACKAGEOPTIONS_TAB, DlgProc)
 | 
			
		||||
DialogPackage::TabOptions::TabOptions(HWND wnd) : Tab(GetModuleHandle(nullptr), wnd, IDD_PACKAGEOPTIONS_TAB, DlgProc)
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -1061,7 +1061,7 @@ void DialogPackage::TabOptions::Initialize()
 | 
			
		||||
	m_Initialized = true;
 | 
			
		||||
 | 
			
		||||
	WCHAR buffer[MAX_PATH];
 | 
			
		||||
	SHGetFolderPath(NULL, CSIDL_DESKTOPDIRECTORY, NULL, SHGFP_TYPE_CURRENT, buffer);
 | 
			
		||||
	SHGetFolderPath(nullptr, CSIDL_DESKTOPDIRECTORY, nullptr, SHGFP_TYPE_CURRENT, buffer);
 | 
			
		||||
 | 
			
		||||
	c_Dialog->m_TargetFile = buffer;
 | 
			
		||||
	c_Dialog->m_TargetFile += L'\\';
 | 
			
		||||
@@ -1292,7 +1292,7 @@ INT_PTR DialogPackage::TabOptions::OnCommand(WPARAM wParam, LPARAM lParam)
 | 
			
		||||
//
 | 
			
		||||
// -----------------------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
DialogPackage::TabAdvanced::TabAdvanced(HWND wnd) : Tab(GetModuleHandle(NULL), wnd, IDD_PACKAGEADVANCED_TAB, DlgProc)
 | 
			
		||||
DialogPackage::TabAdvanced::TabAdvanced(HWND wnd) : Tab(GetModuleHandle(nullptr), wnd, IDD_PACKAGEADVANCED_TAB, DlgProc)
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user