This repository has been archived by the owner on Jun 22, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stopped multiple instances of the radio status display being loaded
- Loading branch information
Ciaran Fisher
committed
Oct 29, 2015
1 parent
933ae47
commit 8b06f82
Showing
7 changed files
with
136 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,6 +64,8 @@ namespace SimpleRadio | |
|
||
void checkForUpdate(); | ||
|
||
void launchOverlay(); | ||
|
||
private: | ||
char* pluginId; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#include "RegHelper.h" | ||
|
||
|
||
|
||
RegHelper::RegHelper() | ||
{ | ||
} | ||
|
||
|
||
RegHelper::~RegHelper() | ||
{ | ||
} | ||
|
||
std::string RegHelper::readSRPath() | ||
{ | ||
|
||
|
||
HKEY hKey = 0; | ||
DWORD bufferSize = 512; | ||
LPVOID regBuffer = new char[bufferSize]; | ||
DWORD dwType = 0; | ||
if (RegOpenKey(HKEY_CURRENT_USER, L"SOFTWARE\\DCS-SimpleRadio", &hKey) == ERROR_SUCCESS) | ||
{ | ||
dwType = REG_SZ; | ||
if (RegQueryValueEx(hKey, L"SRPath", 0, &dwType, (BYTE*)regBuffer, &bufferSize) == ERROR_SUCCESS) | ||
{ | ||
|
||
//its a 2 Byte CHAR! | ||
WCHAR *locationStr = reinterpret_cast<WCHAR *>(regBuffer); | ||
locationStr[bufferSize] = 0; //add terminator | ||
|
||
//convert to widestring | ||
std::wstring ws(locationStr); | ||
//convert to normal string | ||
std::string str(ws.begin(), ws.end()); | ||
|
||
|
||
RegCloseKey(hKey); | ||
|
||
delete[] regBuffer; | ||
return str; | ||
} | ||
|
||
RegCloseKey(hKey); | ||
} | ||
|
||
delete[] regBuffer; | ||
|
||
return ""; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#pragma once | ||
|
||
#include <iostream> | ||
#include <string> | ||
#include <Windows.h> | ||
|
||
|
||
|
||
class RegHelper | ||
{ | ||
public: | ||
RegHelper(); | ||
~RegHelper(); | ||
|
||
std::string readSRPath(); | ||
|
||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters