コード例 #1
0
void SteamLoader::Initialize()
{
	if (IsSteamRunning(true))
	{
		std::wstring steamDllPath = GetSteamDllPath();
		std::wstring steamDirectory = steamDllPath.substr(0, steamDllPath.rfind(L'\\'));

		// add Steam to the process path
		static wchar_t pathBuffer[65536];
		GetEnvironmentVariable(L"PATH", pathBuffer, sizeof(pathBuffer));

		wcscat(pathBuffer, L";");
		wcscat(pathBuffer, steamDirectory.c_str());

		SetEnvironmentVariable(L"PATH", pathBuffer);

		// oh you wanted this to work on old win7? ehhh
		AddDllDirectory(steamDirectory.c_str());

		// load steamclient*.dll
		m_hSteamClient = LoadLibrary(steamDllPath.c_str());

		// load the Steam overlay, if 'rtsshooks64.dll' is not present
		if (GetModuleHandleW(L"rtsshooks64.dll") == nullptr)
		{
			LoadGameOverlayRenderer(steamDllPath);
		}
	}
}
コード例 #2
0
void SteamLoader::Initialize()
{
	if (IsSteamRunning(true))
	{
		std::wstring steamDllPath = GetSteamDllPath();
		std::wstring steamDirectory = steamDllPath.substr(0, steamDllPath.rfind(L'\\'));

		// add Steam to the process path
		static wchar_t pathBuffer[65536];
		GetEnvironmentVariable(L"PATH", pathBuffer, sizeof(pathBuffer));

		wcscat(pathBuffer, L";");
		wcscat(pathBuffer, steamDirectory.c_str());

		SetEnvironmentVariable(L"PATH", pathBuffer);

		// load steamclient*.dll
		m_hSteamClient = LoadLibrary(steamDllPath.c_str());

		//LoadGameOverlayRenderer(steamDllPath);
	}
}