mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-06-10 00:34:31 +00:00
Compare commits
3 Commits
gnif-lates
...
idd-prefer
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
04607d6139 | ||
|
|
462f638c12 | ||
|
|
37bb89f490 |
@@ -71,7 +71,6 @@ reInit:
|
||||
}
|
||||
|
||||
m_swapChain.reset(new CSwapChainProcessor(m_monitor, m_devContext, swapChain, m_dx11Device, m_dx12Device, newFrameEvent));
|
||||
g_pipe.SetGPUStatus(m_dx11Device->IsSoftware());
|
||||
}
|
||||
|
||||
void CIndirectMonitorContext::UnassignSwapChain()
|
||||
|
||||
@@ -114,6 +114,11 @@ void CPipeServer::Thread()
|
||||
DEBUG_TRACE("Client connected");
|
||||
|
||||
m_connected = true;
|
||||
|
||||
for (const auto& msg : m_queue)
|
||||
WriteMsg(msg);
|
||||
m_queue.clear();
|
||||
|
||||
while (m_running && m_connected)
|
||||
{
|
||||
//TODO: Read messages from the client
|
||||
@@ -129,8 +134,14 @@ void CPipeServer::Thread()
|
||||
DEBUG_TRACE("Pipe thread shutdown");
|
||||
}
|
||||
|
||||
void CPipeServer::WriteMsg(LGPipeMsg & msg)
|
||||
void CPipeServer::WriteMsg(const LGPipeMsg & msg)
|
||||
{
|
||||
if (!m_connected)
|
||||
{
|
||||
m_queue.push_back(msg);
|
||||
return;
|
||||
}
|
||||
|
||||
DWORD written;
|
||||
if (!WriteFile(m_pipe.Get(), &msg, sizeof(msg), &written, NULL))
|
||||
{
|
||||
@@ -151,6 +162,7 @@ void CPipeServer::WriteMsg(LGPipeMsg & msg)
|
||||
|
||||
void CPipeServer::SetCursorPos(uint32_t x, uint32_t y)
|
||||
{
|
||||
// do not send cursor messages if we are not connected or they will end up queued
|
||||
if (!m_connected)
|
||||
return;
|
||||
|
||||
@@ -164,9 +176,6 @@ void CPipeServer::SetCursorPos(uint32_t x, uint32_t y)
|
||||
|
||||
void CPipeServer::SetDisplayMode(uint32_t width, uint32_t height, uint32_t refresh)
|
||||
{
|
||||
if (!m_connected)
|
||||
return;
|
||||
|
||||
LGPipeMsg msg;
|
||||
msg.size = sizeof(msg);
|
||||
msg.type = LGPipeMsg::SETDISPLAYMODE;
|
||||
@@ -178,9 +187,6 @@ void CPipeServer::SetDisplayMode(uint32_t width, uint32_t height, uint32_t refre
|
||||
|
||||
void CPipeServer::SetGPUStatus(bool software)
|
||||
{
|
||||
if (!m_connected)
|
||||
return;
|
||||
|
||||
LGPipeMsg msg;
|
||||
msg.size = sizeof(msg);
|
||||
msg.type = LGPipeMsg::GPUSTATUS;
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include <wdf.h>
|
||||
#include <stdint.h>
|
||||
#include <wrl.h>
|
||||
#include <vector>
|
||||
|
||||
#include "PipeMsg.h"
|
||||
|
||||
@@ -36,6 +37,7 @@ class CPipeServer
|
||||
private:
|
||||
HandleT<HANDLENullTraits> m_pipe;
|
||||
HandleT<HANDLENullTraits> m_thread;
|
||||
std::vector<LGPipeMsg> m_queue;
|
||||
|
||||
bool m_running = false;
|
||||
bool m_connected = false;
|
||||
@@ -45,7 +47,7 @@ class CPipeServer
|
||||
static DWORD WINAPI _pipeThread(LPVOID lpParam) { ((CPipeServer*)lpParam)->Thread(); return 0; }
|
||||
void Thread();
|
||||
|
||||
void WriteMsg(LGPipeMsg & msg);
|
||||
void WriteMsg(const LGPipeMsg & msg);
|
||||
|
||||
public:
|
||||
~CPipeServer() { DeInit(); }
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
#include <avrt.h>
|
||||
#include "CDebug.h"
|
||||
#include "CPipeServer.h"
|
||||
|
||||
CSwapChainProcessor::CSwapChainProcessor(IDDCX_MONITOR monitor, CIndirectDeviceContext* devContext, IDDCX_SWAPCHAIN hSwapChain,
|
||||
std::shared_ptr<CD3D11Device> dx11Device, std::shared_ptr<CD3D12Device> dx12Device, HANDLE newFrameEvent) :
|
||||
@@ -130,6 +131,10 @@ void CSwapChainProcessor::SwapChainThreadCore()
|
||||
m_lastShapeId = 0;
|
||||
m_thread[1].Attach(CreateThread(nullptr, 0, _CursorThread, this, 0, nullptr));
|
||||
|
||||
// postpone sending this to ensure we dont spam messages if we end up in a
|
||||
// restart loop while waiting for a valid configuration
|
||||
g_pipe.SetGPUStatus(m_dx11Device->IsSoftware());
|
||||
|
||||
UINT lastFrameNumber = 0;
|
||||
for (;;)
|
||||
{
|
||||
|
||||
@@ -89,7 +89,7 @@ void CConfigWindow::updateFont()
|
||||
}
|
||||
|
||||
for (HWND child : std::initializer_list<HWND>({
|
||||
*m_version, *m_modeGroup, *m_modeBox, *m_widthLabel, *m_heightLabel, *m_refreshLabel,
|
||||
*m_version, *m_modeGroup, *m_modeBox, *m_widthLabel, *m_heightLabel, *m_refreshLabel, *m_modePreferred,
|
||||
*m_modeWidth, *m_modeHeight, *m_modeRefresh, *m_modeUpdate, *m_modeDelete, *m_modeReset,
|
||||
*m_autosizeGroup, *m_defRefreshLabel, *m_defRefresh, *m_defRefreshHz,
|
||||
*m_prefGroup, *m_prefNoGPU,
|
||||
@@ -97,13 +97,20 @@ void CConfigWindow::updateFont()
|
||||
SendMessage(child, WM_SETFONT, (WPARAM)m_font.Get(), 1);
|
||||
}
|
||||
|
||||
void CConfigWindow::updateModeList()
|
||||
int CConfigWindow::updateModeList(int wanted)
|
||||
{
|
||||
int result = 0;
|
||||
m_modeBox->addItem(L"<add new>", -1);
|
||||
|
||||
auto &modes = *m_modes;
|
||||
for (size_t i = 0; i < modes.size(); ++i)
|
||||
m_modeBox->addItem(modes[i].toString(), i);
|
||||
{
|
||||
int idx = m_modeBox->addItem(modes[i].toString(), i);
|
||||
if (wanted == i)
|
||||
result = idx;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
LRESULT CConfigWindow::handleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
@@ -154,6 +161,7 @@ LRESULT CConfigWindow::onCreate()
|
||||
m_modeWidth.reset(new CEditWidget(WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_LEFT | ES_NUMBER, m_hwnd));
|
||||
m_modeHeight.reset(new CEditWidget(WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_LEFT | ES_NUMBER, m_hwnd));
|
||||
m_modeRefresh.reset(new CEditWidget(WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_LEFT | ES_NUMBER, m_hwnd));
|
||||
m_modePreferred.reset(new CCheckbox(L"prefer", WS_CHILD | WS_VISIBLE, m_hwnd));
|
||||
|
||||
m_modeUpdate.reset(new CButton(L"Save", WS_CHILD | WS_VISIBLE | WS_TABSTOP, m_hwnd));
|
||||
m_modeDelete.reset(new CButton(L"Delete", WS_CHILD | WS_VISIBLE | WS_TABSTOP, m_hwnd));
|
||||
@@ -206,6 +214,7 @@ LRESULT CConfigWindow::onResize(DWORD width, DWORD height)
|
||||
pos.pinBottomLeft(*m_modeWidth, 75, 96, 50, 20);
|
||||
pos.pinBottomLeft(*m_modeHeight, 75, 72, 50, 20);
|
||||
pos.pinBottomLeft(*m_modeRefresh, 75, 48, 50, 20);
|
||||
pos.pinBottomLeft(*m_modePreferred, 130, 96, 70, 20);
|
||||
pos.pinBottomLeft(*m_modeUpdate, 24, 20, 50, 24);
|
||||
pos.pinBottomLeft(*m_modeDelete, 75, 20, 50, 24);
|
||||
pos.pinBottomLeft(*m_modeReset, 126, 20, 50, 24);
|
||||
@@ -238,6 +247,7 @@ void CConfigWindow::onModeListSelectChange()
|
||||
m_modeWidth->setNumericValue(mode.width);
|
||||
m_modeHeight->setNumericValue(mode.height);
|
||||
m_modeRefresh->setNumericValue(mode.refresh);
|
||||
m_modePreferred->setChecked(mode.preferred);
|
||||
}
|
||||
EnableWindow(*m_modeUpdate, TRUE);
|
||||
EnableWindow(*m_modeDelete, index >= 0);
|
||||
@@ -249,6 +259,10 @@ LRESULT CConfigWindow::onCommand(WORD id, WORD code, HWND hwnd)
|
||||
{
|
||||
onModeListSelectChange();
|
||||
}
|
||||
else if (m_modePreferred && hwnd == *m_modePreferred && code == BN_CLICKED && m_modes)
|
||||
{
|
||||
m_modePreferred->setChecked(!m_modePreferred->isChecked());
|
||||
}
|
||||
else if (m_modeUpdate && hwnd == *m_modeUpdate && code == BN_CLICKED && m_modes)
|
||||
{
|
||||
int sel = m_modeBox->getSel();
|
||||
@@ -258,21 +272,23 @@ LRESULT CConfigWindow::onCommand(WORD id, WORD code, HWND hwnd)
|
||||
int index = m_modeBox->getData(sel);
|
||||
auto &mode = index >= 0 ? (*m_modes)[index] : m_modes->emplace_back();
|
||||
|
||||
for (auto &mode : *m_modes)
|
||||
mode.preferred = false;
|
||||
|
||||
try
|
||||
{
|
||||
mode.width = m_modeWidth->getNumericValue();
|
||||
mode.height = m_modeHeight->getNumericValue();
|
||||
mode.refresh = m_modeRefresh->getNumericValue();
|
||||
mode.preferred = m_modePreferred->isChecked();
|
||||
}
|
||||
catch (std::logic_error&)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (index >= 0)
|
||||
m_modeBox->delItem(sel);
|
||||
|
||||
m_modeBox->setSel(m_modeBox->addItem(mode.toString().c_str(), index));
|
||||
m_modeBox->clear();
|
||||
m_modeBox->setSel(updateModeList(index));
|
||||
|
||||
LRESULT result = m_settings.setModes(*m_modes);
|
||||
if (result != ERROR_SUCCESS)
|
||||
|
||||
@@ -49,6 +49,7 @@ class CConfigWindow : public CWindow
|
||||
std::unique_ptr<CEditWidget> m_modeWidth;
|
||||
std::unique_ptr<CEditWidget> m_modeHeight;
|
||||
std::unique_ptr<CEditWidget> m_modeRefresh;
|
||||
std::unique_ptr<CCheckbox> m_modePreferred;
|
||||
|
||||
std::unique_ptr<CButton> m_modeUpdate;
|
||||
std::unique_ptr<CButton> m_modeDelete;
|
||||
@@ -72,7 +73,7 @@ class CConfigWindow : public CWindow
|
||||
|
||||
void getMinimumSize(LONG &width, LONG &height);
|
||||
void updateFont();
|
||||
void updateModeList();
|
||||
int updateModeList(int wanted = -1);
|
||||
void onModeListSelectChange();
|
||||
|
||||
virtual LRESULT handleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam) override;
|
||||
|
||||
@@ -20,13 +20,13 @@
|
||||
|
||||
#include "CNotifyWindow.h"
|
||||
#include "CConfigWindow.h"
|
||||
#include "Devices.h"
|
||||
#include <CDebug.h>
|
||||
#include <windowsx.h>
|
||||
#include <strsafe.h>
|
||||
|
||||
#define WM_NOTIFY_ICON (WM_USER)
|
||||
#define WM_NOTIFY_ICON (WM_USER)
|
||||
#define WM_CLEAN_UP_CONFIG (WM_USER+1)
|
||||
#define WM_NO_GPU (WM_USER+2)
|
||||
|
||||
#define ID_MENU_SHOW_LOG 3000
|
||||
#define ID_MENU_SHOW_CONFIG 3001
|
||||
@@ -81,6 +81,10 @@ LRESULT CNotifyWindow::handleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
}
|
||||
return 0;
|
||||
|
||||
case WM_NO_GPU:
|
||||
handleNoGPUNotification();
|
||||
return 0;
|
||||
|
||||
default:
|
||||
if (s_taskbarCreated && uMsg == s_taskbarCreated)
|
||||
{
|
||||
@@ -162,20 +166,14 @@ void CNotifyWindow::registerIcon()
|
||||
|
||||
if (!Shell_NotifyIcon(NIM_SETVERSION, &m_iconData))
|
||||
DEBUG_ERROR_HR(GetLastError(), "Shell_NotifyIcon(NIM_SETVERSION)");
|
||||
|
||||
bool hasGPU;
|
||||
if (!checkGPU(hasGPU))
|
||||
DEBUG_ERROR("Failed to check if the system has a GPU");
|
||||
else if (hasGPU)
|
||||
DEBUG_INFO("GPU identified");
|
||||
else
|
||||
{
|
||||
DEBUG_INFO("System has no GPU");
|
||||
noGPUNotification();
|
||||
}
|
||||
}
|
||||
|
||||
void CNotifyWindow::noGPUNotification()
|
||||
{
|
||||
PostMessage(m_hwnd, WM_NO_GPU, 0, 0);
|
||||
}
|
||||
|
||||
void CNotifyWindow::handleNoGPUNotification()
|
||||
{
|
||||
CRegistrySettings settings;
|
||||
LSTATUS error = settings.open();
|
||||
|
||||
@@ -36,7 +36,7 @@ class CNotifyWindow : public CWindow
|
||||
|
||||
LRESULT onNotifyIcon(UINT uEvent, WORD wIconId, int x, int y);
|
||||
void registerIcon();
|
||||
void noGPUNotification();
|
||||
void handleNoGPUNotification();
|
||||
|
||||
virtual LRESULT handleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam) override;
|
||||
virtual LRESULT onCreate() override;
|
||||
@@ -44,11 +44,26 @@ class CNotifyWindow : public CWindow
|
||||
virtual LRESULT onDestroy() override;
|
||||
virtual LRESULT onFinal() override;
|
||||
|
||||
public:
|
||||
CNotifyWindow();
|
||||
~CNotifyWindow() override;
|
||||
|
||||
public:
|
||||
CNotifyWindow(const CNotifyWindow&) = delete;
|
||||
CNotifyWindow& operator=(const CNotifyWindow&) = delete;
|
||||
|
||||
CNotifyWindow(CNotifyWindow&&) = delete;
|
||||
CNotifyWindow& operator=(CNotifyWindow&&) = delete;
|
||||
|
||||
static CNotifyWindow& instance()
|
||||
{
|
||||
static CNotifyWindow window;
|
||||
return window;
|
||||
}
|
||||
|
||||
static bool registerClass();
|
||||
|
||||
void noGPUNotification();
|
||||
|
||||
HWND hwndDialog();
|
||||
void close();
|
||||
};
|
||||
};
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "CPipeClient.h"
|
||||
#include "CDebug.h"
|
||||
#include "CNotifyWindow.h"
|
||||
|
||||
#include <setupapi.h>
|
||||
#include <tchar.h>
|
||||
@@ -307,5 +308,6 @@ void CPipeClient::HandleSetDisplayMode(const LGPipeMsg& msg)
|
||||
|
||||
void CPipeClient::HandleGPUStatus(const LGPipeMsg& msg)
|
||||
{
|
||||
// TODO: implement me
|
||||
if (msg.gpuStatus.software)
|
||||
CNotifyWindow::instance().noGPUNotification();
|
||||
}
|
||||
|
||||
@@ -1,106 +0,0 @@
|
||||
/**
|
||||
* Looking Glass
|
||||
* Copyright © 2017-2026 The Looking Glass Authors
|
||||
* https://looking-glass.io
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation; either version 2 of the License, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc., 59
|
||||
* Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "Devices.h"
|
||||
#include <windows.h>
|
||||
#include <devguid.h>
|
||||
#include <setupapi.h>
|
||||
#include <CDebug.h>
|
||||
|
||||
inline static bool wprefix(const wchar_t *pre, const wchar_t *str)
|
||||
{
|
||||
return wcsncmp(pre, str, wcslen(pre)) == 0;
|
||||
}
|
||||
|
||||
bool checkGPU(bool &found)
|
||||
{
|
||||
found = false;
|
||||
|
||||
HDEVINFO hDevInfo = SetupDiGetClassDevsW(&GUID_DEVCLASS_DISPLAY, NULL, NULL, DIGCF_PRESENT);
|
||||
if (hDevInfo == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
DEBUG_WARN_HR(GetLastError(), L"SetupDiGetClassDevsW");
|
||||
return false;
|
||||
}
|
||||
|
||||
SP_DEVINFO_DATA devInfo = { 0 };
|
||||
devInfo.cbSize = sizeof devInfo;
|
||||
|
||||
for (DWORD dwIndex = 0; SetupDiEnumDeviceInfo(hDevInfo, dwIndex, &devInfo); ++dwIndex)
|
||||
{
|
||||
DWORD dwSizeRequired;
|
||||
DWORD dwPropertyType;
|
||||
SetupDiGetDeviceRegistryPropertyW(hDevInfo, &devInfo, SPDRP_HARDWAREID, &dwPropertyType, NULL, 0, &dwSizeRequired);
|
||||
|
||||
DWORD dwLastError = GetLastError();
|
||||
if (dwLastError == ERROR_INVALID_DATA)
|
||||
continue;
|
||||
else if (dwLastError != ERROR_INSUFFICIENT_BUFFER)
|
||||
{
|
||||
DEBUG_WARN_HR(GetLastError(), L"SetupDiGetDeviceRegistryPropertyW(SPDRP_HARDWAREID) size calculation");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (dwPropertyType != REG_MULTI_SZ)
|
||||
{
|
||||
DEBUG_WARN(L"SetupDiGetDeviceRegistryPropertyW(SPDRP_HARDWAREID) returned wrong type");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
LPWSTR lpBuffer = (LPWSTR)malloc(dwSizeRequired);
|
||||
if (!lpBuffer)
|
||||
{
|
||||
DEBUG_WARN(L"failed to allocate memory for SetupDiGetDeviceRegistryPropertyW(SPDRP_HARDWAREID)");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (!SetupDiGetDeviceRegistryPropertyW(hDevInfo, &devInfo, SPDRP_HARDWAREID, &dwPropertyType, (PBYTE)lpBuffer, dwSizeRequired, NULL))
|
||||
{
|
||||
DEBUG_WARN_HR(GetLastError(), L"SetupDiGetDeviceRegistryPropertyW(SPDRP_HARDWAREID) for real");
|
||||
free(lpBuffer);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
for (LPWSTR lpHwId = lpBuffer; *lpHwId; lpHwId += wcslen(lpBuffer) + 1)
|
||||
{
|
||||
if (
|
||||
wprefix(L"PCI\\VEN_10DE&", lpHwId) || // Nvidia
|
||||
wprefix(L"PCI\\VEN_1002&", lpHwId) || // AMD
|
||||
wprefix(L"PCI\\VEN_8086&", lpHwId) // Intel
|
||||
)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
free(lpBuffer);
|
||||
|
||||
if (found)
|
||||
break;
|
||||
}
|
||||
|
||||
SetupDiDestroyDeviceInfoList(hDevInfo);
|
||||
return true;
|
||||
|
||||
fail:
|
||||
SetupDiDestroyDeviceInfoList(hDevInfo);
|
||||
return false;
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
/**
|
||||
* Looking Glass
|
||||
* Copyright © 2017-2026 The Looking Glass Authors
|
||||
* https://looking-glass.io
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation; either version 2 of the License, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc., 59
|
||||
* Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
bool checkGPU(bool &found);
|
||||
@@ -191,7 +191,6 @@ copy /Y "$(ProjectDir)VERSION" "$(SolutionDir)$(Platform)\$(Configuration)\LGIdd
|
||||
<ClCompile Include="CStaticWidget.cpp" />
|
||||
<ClCompile Include="CWidget.cpp" />
|
||||
<ClCompile Include="CWindow.cpp" />
|
||||
<ClCompile Include="Devices.cpp" />
|
||||
<ClCompile Include="main.cpp" />
|
||||
<ClCompile Include="UIHelpers.cpp" />
|
||||
</ItemGroup>
|
||||
@@ -208,7 +207,6 @@ copy /Y "$(ProjectDir)VERSION" "$(SolutionDir)$(Platform)\$(Configuration)\LGIdd
|
||||
<ClInclude Include="CRegistrySettings.h" />
|
||||
<ClInclude Include="CStaticWidget.h" />
|
||||
<ClInclude Include="CWidget.h" />
|
||||
<ClInclude Include="Devices.h" />
|
||||
<ClInclude Include="UIHelpers.h" />
|
||||
<ClInclude Include="CWindow.h" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -22,14 +22,12 @@
|
||||
<ClCompile Include="CPipeClient.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="$(SolutionDir)LGCommon\*.cpp" />
|
||||
<ClCompile Include="CWindow.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="CNotifyWindow.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="$(SolutionDir)LGCommon\*.cpp" />
|
||||
<ClCompile Include="CConfigWindow.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
@@ -39,7 +37,6 @@
|
||||
<ClCompile Include="CWidget.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="$(SolutionDir)LGCommon\*.cpp" />
|
||||
<ClCompile Include="CRegistrySettings.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
@@ -49,18 +46,16 @@
|
||||
<ClCompile Include="UIHelpers.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="$(SolutionDir)LGCommon\*.cpp" />
|
||||
<ClCompile Include="CGroupBox.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="$(SolutionDir)LGCommon\*.cpp" />
|
||||
<ClCompile Include="CButton.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="CEditWidget.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Devices.cpp">
|
||||
<ClCompile Include="CCheckbox.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
@@ -69,16 +64,12 @@
|
||||
<ClInclude Include="CPipeClient.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<CLInclude Include="$(SolutionDir)LGCommon\*.h" />
|
||||
<CLInclude Include="$(SolutionDir)LGCommon\*.h" />
|
||||
<ClInclude Include="CWindow.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="CNotifyWindow.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<CLInclude Include="$(SolutionDir)LGCommon\*.h" />
|
||||
<CLInclude Include="$(SolutionDir)LGCommon\*.h" />
|
||||
<ClInclude Include="CConfigWindow.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
@@ -91,29 +82,22 @@
|
||||
<ClInclude Include="UIHelpers.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<CLInclude Include="$(SolutionDir)LGCommon\*.h" />
|
||||
<CLInclude Include="$(SolutionDir)LGCommon\*.h" />
|
||||
<ClInclude Include="CRegistrySettings.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="CListBox.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<CLInclude Include="$(SolutionDir)LGCommon\*.h" />
|
||||
<CLInclude Include="$(SolutionDir)LGCommon\*.h" />
|
||||
<ClInclude Include="CGroupBox.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<CLInclude Include="$(SolutionDir)LGCommon\*.h" />
|
||||
<CLInclude Include="$(SolutionDir)LGCommon\*.h" />
|
||||
<CLInclude Include="$(SolutionDir)LGCommon\*.h" />
|
||||
<ClInclude Include="CButton.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="CEditWidget.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Devices.h">
|
||||
<ClInclude Include="CCheckbox.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
@@ -125,4 +109,4 @@
|
||||
<Filter>Resource Files</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
@@ -113,11 +113,13 @@ int WINAPI WinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
CNotifyWindow& window = CNotifyWindow::instance();
|
||||
|
||||
// the pipe must be initialized after the CNotifyWindow
|
||||
// has been created to avoid a potential race
|
||||
if (!g_pipe.Init())
|
||||
return EXIT_FAILURE;
|
||||
|
||||
CNotifyWindow window;
|
||||
|
||||
HANDLE hWait;
|
||||
if (!RegisterWaitForSingleObject(&hWait, hParent.Get(), DestroyNotifyWindow, &window, INFINITE, WT_EXECUTEONLYONCE))
|
||||
DEBUG_ERROR_HR(GetLastError(), "Failed to RegisterWaitForSingleObject");
|
||||
|
||||
Reference in New Issue
Block a user