-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* renames in prep of adding second combobox * add hmon capture helpers * basic hmon capture * layout adjustments * add stop capture * add stop capture button * add item name to title * check hresults
- Loading branch information
Showing
9 changed files
with
207 additions
and
22 deletions.
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
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,31 @@ | ||
#include "pch.h" | ||
#include "EnumerationMonitor.h" | ||
|
||
BOOL CALLBACK EnumDisplayMonitorsProc(HMONITOR hmon, HDC, LPRECT, LPARAM lparam) | ||
{ | ||
MONITORINFOEX monitorInfo = {}; | ||
monitorInfo.cbSize = sizeof(MONITORINFOEX); | ||
if (!GetMonitorInfo(hmon, &monitorInfo)) | ||
{ | ||
winrt::check_hresult(GetLastError()); | ||
} | ||
|
||
std::wstring displayName(monitorInfo.szDevice); | ||
|
||
std::vector<EnumerationMonitor>& monitors = *reinterpret_cast<std::vector<EnumerationMonitor>*>(lparam); | ||
monitors.push_back(EnumerationMonitor(hmon, displayName)); | ||
|
||
return TRUE; | ||
} | ||
|
||
const std::vector<EnumerationMonitor> EnumerateMonitors() | ||
{ | ||
std::vector<EnumerationMonitor> monitors; | ||
EnumDisplayMonitors(NULL, NULL, EnumDisplayMonitorsProc, reinterpret_cast<LPARAM>(&monitors)); | ||
return monitors; | ||
} | ||
|
||
std::vector<EnumerationMonitor> EnumerationMonitor::EnumerateAllMonitors() | ||
{ | ||
return EnumerateMonitors(); | ||
} |
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,21 @@ | ||
#pragma once | ||
|
||
struct EnumerationMonitor | ||
{ | ||
public: | ||
EnumerationMonitor(nullptr_t) {} | ||
EnumerationMonitor(HMONITOR hmon, std::wstring& displayName) | ||
{ | ||
m_hmon = hmon; | ||
m_displayName = displayName; | ||
} | ||
|
||
HMONITOR Hmon() const noexcept { return m_hmon; } | ||
std::wstring DisplayName() const noexcept { return m_displayName; } | ||
|
||
static std::vector<EnumerationMonitor> EnumerateAllMonitors(); | ||
|
||
private: | ||
HMONITOR m_hmon; | ||
std::wstring m_displayName; | ||
}; |
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
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