ZoomIt initial code dump

This commit is contained in:
Jaime Bernardo 2024-09-03 14:12:32 +01:00
parent 2fac6ed582
commit c3a026452c
41 changed files with 12938 additions and 0 deletions

View File

@ -0,0 +1,75 @@
Sysinternals Software License Terms
These license terms are an agreement between Sysinternals (a wholly owned subsidiary of Microsoft Corporation) and you. Please read them. They apply to the software you are downloading from technet.microsoft.com/sysinternals, which includes the media on which you received it, if any. The terms also apply to any Sysinternals
* updates,
* supplements,
* Internet-based services,
* and support services
for this software, unless other terms accompany those items. If so, those terms apply.
BY USING THE SOFTWARE, YOU ACCEPT THESE TERMS. IF YOU DO NOT ACCEPT THEM, DO NOT USE THE SOFTWARE.
If you comply with these license terms, you have the rights below.
Installation and User Rights
You may install and use any number of copies of the software on your devices.
Scope of License
The software is licensed, not sold. This agreement only gives you some rights to use the software. Sysinternals reserves all other rights. Unless applicable law gives you more rights despite this limitation, you may use the software only as expressly permitted in this agreement. In doing so, you must comply with any technical limitations in the software that only allow you to use it in certain ways. You may not
* work around any technical limitations in the software;
* reverse engineer, decompile or disassemble the software, except and only to the extent that applicable law expressly permits, despite this limitation;
* make more copies of the software than specified in this agreement or allowed by applicable law, despite this limitation;
* publish the software for others to copy;
* rent, lease or lend the software;
* transfer the software or this agreement to any third party; or
* use the software for commercial software hosting services.
Sensitive Information
Please be aware that, similar to other debug tools that capture “process state” information, files saved by Sysinternals tools may include personally identifiable or other sensitive information (such as usernames, passwords, paths to files accessed, and paths to registry accessed). By using this software, you acknowledge that you are aware of this and take sole responsibility for any personally identifiable or other sensitive information provided to Microsoft or any other party through your use of the software.
Documentation
Any person that has valid access to your computer or internal network may copy and use the documentation for your internal, reference purposes.
Export Restrictions
The software is subject to United States export laws and regulations. You must comply with all domestic and international export laws and regulations that apply to the software. These laws include restrictions on destinations, end users and end use. For additional information, see www.microsoft.com/exporting .
Support Services
Because this software is "as is," we may not provide support services for it.
Entire Agreement
This agreement, and the terms for supplements, updates, Internet-based services and support services that you use, are the entire agreement for the software and support services.
Applicable Law
United States . If you acquired the software in the United States , Washington state law governs the interpretation of this agreement and applies to claims for breach of it, regardless of conflict of laws principles. The laws of the state where you live govern all other claims, including claims under state consumer protection laws, unfair competition laws, and in tort.
Outside the United States . If you acquired the software in any other country, the laws of that country apply.
Legal Effect
This agreement describes certain legal rights. You may have other rights under the laws of your country. You may also have rights with respect to the party from whom you acquired the software. This agreement does not change your rights under the laws of your country if the laws of your country do not permit it to do so.
Disclaimer of Warranty
The software is licensed "as-is." You bear the risk of using it. Sysinternals gives no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this agreement cannot change. To the extent permitted under your local laws, sysinternals excludes the implied warranties of merchantability, fitness for a particular purpose and non-infringement.
Limitation on and Exclusion of Remedies and Damages
You can recover from sysinternals and its suppliers only direct damages up to U.S. $5.00. You cannot recover any other damages, including consequential, lost profits, special, indirect or incidental damages.
This limitation applies to
* anything related to the software, services, content (including code) on third party Internet sites, or third party programs; and
* claims for breach of contract, breach of warranty, guarantee or condition, strict liability, negligence, or other tort to the extent permitted by applicable law.
It also applies even if Sysinternals knew or should have known about the possibility of the damages. The above limitation or exclusion may not apply to you because your country may not allow the exclusion or limitation of incidental, consequential or other damages.
Please note: As this software is distributed in Quebec , Canada , some of the clauses in this agreement are provided below in French.
Remarque : Ce logiciel étant distribué au Québec, Canada, certaines des clauses dans ce contrat sont fournies ci-dessous en français.
EXONÉRATION DE GARANTIE. Le logiciel visé par une licence est offert « tel quel ». Toute utilisation de ce logiciel est à votre seule risque et péril. Sysinternals n'accorde aucune autre garantie expresse. Vous pouvez bénéficier de droits additionnels en vertu du droit local sur la protection dues consommateurs, que ce contrat ne peut modifier. La ou elles sont permises par le droit locale, les garanties implicites de qualité marchande, d'adéquation à un usage particulier et d'absence de contrefaçon sont exclues.
LIMITATION DES DOMMAGES-INTÉRÊTS ET EXCLUSION DE RESPONSABILITÉ POUR LES DOMMAGES. Vous pouvez obtenir de Sysinternals et de ses fournisseurs une indemnisation en cas de dommages directs uniquement à hauteur de 5,00 $ US. Vous ne pouvez prétendre à aucune indemnisation pour les autres dommages, y compris les dommages spéciaux, indirects ou accessoires et pertes de bénéfices.
Cette limitation concerne :
tout ce qui est relié au logiciel, aux services ou au contenu (y compris le code) figurant sur des sites Internet tiers ou dans des programmes tiers ; et
les réclamations au titre de violation de contrat ou de garantie, ou au titre de responsabilité stricte, de négligence ou d'une autre faute dans la limite autorisée par la loi en vigueur.
Elle s'applique également, même si Sysinternals connaissait ou devrait connaître l'éventualité d'un tel dommage. Si votre pays n'autorise pas l'exclusion ou la limitation de responsabilité pour les dommages indirects, accessoires ou de quelque nature que ce soit, il se peut que la limitation ou l'exclusion ci-dessus ne s'appliquera pas à votre égard.
EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous pourriez avoir d'autres droits prévus par les lois de votre pays. Le présent contrat ne modifie pas les droits que vous confèrent les lois de votre pays si celles-ci ne le permettent pas.

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,17 @@
#ifdef __cplusplus
extern "C" {
#endif
BOOL ShowEulaW( const TCHAR * ToolName, int *argc, PWCHAR argv[] );
BOOL ShowEula( const TCHAR * ToolName, int *argc, TCHAR *argv[] );
DWORD ShowEulaConsole();
void ShowEulaConsoleNoPrompt();
BOOL IsIoTEdition();
BOOL IsRemoteOnlyEdition();
BOOL IsRunningRemotely();
BOOL IsEulaAccepted(const TCHAR * ToolName, int *argc, PTCHAR argv[]);
#ifdef __cplusplus
}
#endif

View File

@ -0,0 +1,76 @@
{\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang1033{\fonttbl{\f0\fswiss\fprq2\fcharset0 Tahoma;}{\f1\fnil\fcharset0 Calibri;}}
{\colortbl ;\red0\green0\blue255;\red0\green0\blue0;}
{\*\generator Riched20 10.0.10240}\viewkind4\uc1
\pard\brdrb\brdrs\brdrw10\brsp20 \sb120\sa120\b\f0\fs24 SYSINTERNALS SOFTWARE LICENSE TERMS\fs28\par
\pard\sb120\sa120\b0\fs19 These license terms are an agreement between Sysinternals (a wholly owned subsidiary of Microsoft Corporation) and you. Please read them. They apply to the software you are downloading from Sysinternals.com, which includes the media on which you received it, if any. The terms also apply to any Sysinternals\par
\pard\fi-363\li720\sb120\sa120\tx720\'b7\tab updates,\par
\pard\fi-363\li720\sb120\sa120\'b7\tab supplements,\par
\'b7\tab Internet-based services, and \par
\'b7\tab support services\par
\pard\sb120\sa120 for this software, unless other terms accompany those items. If so, those terms apply.\par
\b BY USING THE SOFTWARE, YOU ACCEPT THESE TERMS. IF YOU DO NOT ACCEPT THEM, DO NOT USE THE SOFTWARE.\par
\pard\brdrt\brdrs\brdrw10\brsp20 \sb120\sa120 If you comply with these license terms, you have the rights below.\par
\pard\fi-357\li357\sb120\sa120\tx360\fs20 1.\tab\fs19 INSTALLATION AND USE RIGHTS. \b0 You may install and use any number of copies of the software on your devices.\b\par
\caps\fs20 2.\tab\fs19 Scope of License\caps0 .\b0 The software is licensed, not sold. This agreement only gives you some rights to use the software. Sysinternals reserves all other rights. Unless applicable law gives you more rights despite this limitation, you may use the software only as expressly permitted in this agreement. In doing so, you must comply with any technical limitations in the software that only allow you to use it in certain ways. You may not\b\par
\pard\fi-363\li720\sb120\sa120\tx720\b0\'b7\tab work around any technical limitations in the binary versions of the software;\par
\pard\fi-363\li720\sb120\sa120\'b7\tab reverse engineer, decompile or disassemble the binary versions of the software, except and only to the extent that applicable law expressly permits, despite this limitation;\par
\'b7\tab make more copies of the software than specified in this agreement or allowed by applicable law, despite this limitation;\par
\'b7\tab publish the software for others to copy;\par
\'b7\tab rent, lease or lend the software;\par
\'b7\tab transfer the software or this agreement to any third party; or\par
\'b7\tab use the software for commercial software hosting services.\par
\pard\fi-357\li357\sb120\sa120\tx360\b\fs20 3.\tab SENSITIVE INFORMATION. \b0 Please be aware that, similar to other debug tools that capture \ldblquote process state\rdblquote information, files saved by Sysinternals tools may include personally identifiable or other sensitive information (such as usernames, passwords, paths to files accessed, and paths to registry accessed). By using this software, you acknowledge that you are aware of this and take sole responsibility for any personally identifiable or other sensitive information provided to Microsoft or any other party through your use of the software.\b\par
5. \tab\fs19 DOCUMENTATION.\b0 Any person that has valid access to your computer or internal network may copy and use the documentation for your internal, reference purposes.\b\par
\caps\fs20 6.\tab\fs19 Export Restrictions\caps0 .\b0 The software is subject to United States export laws and regulations. You must comply with all domestic and international export laws and regulations that apply to the software. These laws include restrictions on destinations, end users and end use. For additional information, see {\cf1\ul{\field{\*\fldinst{HYPERLINK www.microsoft.com/exporting }}{\fldrslt{www.microsoft.com/exporting}}}}\cf1\ul\f0\fs19 <{{\field{\*\fldinst{HYPERLINK "http://www.microsoft.com/exporting"}}{\fldrslt{http://www.microsoft.com/exporting}}}}\f0\fs19 >\cf0\ulnone .\b\par
\caps\fs20 7.\tab\fs19 SUPPORT SERVICES.\caps0 \b0 Because this software is "as is," we may not provide support services for it.\b\par
\caps\fs20 8.\tab\fs19 Entire Agreement.\b0\caps0 This agreement, and the terms for supplements, updates, Internet-based services and support services that you use, are the entire agreement for the software and support services.\par
\pard\keepn\fi-360\li360\sb120\sa120\tx360\cf2\b\caps\fs20 9.\tab\fs19 Applicable Law\caps0 .\par
\pard\fi-363\li720\sb120\sa120\tx720\cf0\fs20 a.\tab\fs19 United States.\b0 If you acquired the software in the United States, Washington state law governs the interpretation of this agreement and applies to claims for breach of it, regardless of conflict of laws principles. The laws of the state where you live govern all other claims, including claims under state consumer protection laws, unfair competition laws, and in tort.\b\par
\pard\fi-363\li720\sb120\sa120\fs20 b.\tab\fs19 Outside the United States.\b0 If you acquired the software in any other country, the laws of that country apply.\b\par
\pard\fi-357\li357\sb120\sa120\tx360\caps\fs20 10.\tab\fs19 Legal Effect.\b0\caps0 This agreement describes certain legal rights. You may have other rights under the laws of your country. You may also have rights with respect to the party from whom you acquired the software. This agreement does not change your rights under the laws of your country if the laws of your country do not permit it to do so.\b\caps\par
\fs20 11.\tab\fs19 Disclaimer of Warranty.\caps0 \caps The software is licensed "as-is." You bear the risk of using it. SYSINTERNALS gives no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this agreement cannot change. To the extent permitted under your local laws, SYSINTERNALS excludes the implied warranties of merchantability, fitness for a particular purpose and non-infringement.\par
\pard\fi-360\li360\sb120\sa120\tx360\fs20 12.\tab\fs19 Limitation on and Exclusion of Remedies and Damages. You can recover from SYSINTERNALS and its suppliers only direct damages up to U.S. $5.00. You cannot recover any other damages, including consequential, lost profits, special, indirect or incidental damages.\par
\pard\li357\sb120\sa120\b0\caps0 This limitation applies to\par
\pard\fi-363\li720\sb120\sa120\tx720\'b7\tab anything related to the software, services, content (including code) on third party Internet sites, or third party programs; and\par
\pard\fi-363\li720\sb120\sa120\'b7\tab claims for breach of contract, breach of warranty, guarantee or condition, strict liability, negligence, or other tort to the extent permitted by applicable law.\par
\pard\li360\sb120\sa120 It also applies even if Sysinternals knew or should have known about the possibility of the damages. The above limitation or exclusion may not apply to you because your country may not allow the exclusion or limitation of incidental, consequential or other damages.\par
\pard\b Please note: As this software is distributed in Quebec, Canada, some of the clauses in this agreement are provided below in French.\par
\pard\sb240\lang1036 Remarque : Ce logiciel \'e9tant distribu\'e9 au Qu\'e9bec, Canada, certaines des clauses dans ce contrat sont fournies ci-dessous en fran\'e7ais.\par
\pard\sb120\sa120 EXON\'c9RATION DE GARANTIE.\b0 Le logiciel vis\'e9 par une licence est offert \'ab tel quel \'bb. Toute utilisation de ce logiciel est \'e0 votre seule risque et p\'e9ril. Sysinternals n'accorde aucune autre garantie expresse. Vous pouvez b\'e9n\'e9ficier de droits additionnels en vertu du droit local sur la protection dues consommateurs, que ce contrat ne peut modifier. La ou elles sont permises par le droit locale, les garanties implicites de qualit\'e9 marchande, d'ad\'e9quation \'e0 un usage particulier et d'absence de contrefa\'e7on sont exclues.\par
\pard\keepn\sb120\sa120\b LIMITATION DES DOMMAGES-INT\'c9R\'caTS ET EXCLUSION DE RESPONSABILIT\'c9 POUR LES DOMMAGES.\b0 Vous pouvez obtenir de Sysinternals et de ses fournisseurs une indemnisation en cas de dommages directs uniquement \'e0 hauteur de 5,00 $ US. Vous ne pouvez pr\'e9tendre \'e0 aucune indemnisation pour les autres dommages, y compris les dommages sp\'e9ciaux, indirects ou accessoires et pertes de b\'e9n\'e9fices.\par
\lang1033 Cette limitation concerne :\par
\pard\keepn\fi-360\li720\sb120\sa120\tx720\lang1036\'b7\tab tout ce qui est reli\'e9 au logiciel, aux services ou au contenu (y compris le code) figurant sur des sites Internet tiers ou dans des programmes tiers ; et\par
\pard\fi-363\li720\sb120\sa120\tx720\'b7\tab les r\'e9clamations au titre de violation de contrat ou de garantie, ou au titre de responsabilit\'e9 stricte, de n\'e9gligence ou d'une autre faute dans la limite autoris\'e9e par la loi en vigueur.\par
\pard\sb120\sa120 Elle s'applique \'e9galement, m\'eame si Sysinternals connaissait ou devrait conna\'eetre l'\'e9ventualit\'e9 d'un tel dommage. Si votre pays n'autorise pas l'exclusion ou la limitation de responsabilit\'e9 pour les dommages indirects, accessoires ou de quelque nature que ce soit, il se peut que la limitation ou l'exclusion ci-dessus ne s'appliquera pas \'e0 votre \'e9gard.\par
\b EFFET JURIDIQUE.\b0 Le pr\'e9sent contrat d\'e9crit certains droits juridiques. Vous pourriez avoir d'autres droits pr\'e9vus par les lois de votre pays. Le pr\'e9sent contrat ne modifie pas les droits que vous conf\'e8rent les lois de votre pays si celles-ci ne le permettent pas.\b\par
\pard\b0\fs20\lang1033\par
\pard\sa200\sl276\slmult1\f1\fs22\lang9\par
}

View File

@ -0,0 +1,24 @@
#include <Windows.h>
#include "WindowsVersions.h"
// Declared in wdm.h
typedef NTSYSAPI NTSTATUS (NTAPI *RtlGetVersionType)( PRTL_OSVERSIONINFOW );
DWORD GetWindowsBuild( DWORD* revision )
{
if( revision ) {
DWORD size = sizeof( *revision );
if( RegGetValueW( HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", L"UBR", RRF_RT_REG_DWORD, NULL, revision, &size ) != ERROR_SUCCESS ) {
*revision = 0;
}
}
RtlGetVersionType pRtlGetVersion = reinterpret_cast<RtlGetVersionType>(GetProcAddress( GetModuleHandleW( L"ntdll.dll" ), "RtlGetVersion" ));
RTL_OSVERSIONINFOW version;
pRtlGetVersion( &version );
return version.dwBuildNumber;
}

View File

@ -0,0 +1,32 @@
//----------------------------------------------------------------------
//
// WindowsVersions.h
//
// Provides helpers for Windows builds and versions.
//
//----------------------------------------------------------------------
#pragma once
#define BUILD_WINDOWS_SERVER_2008 6003
#define BUILD_WINDOWS_SERVER_2008_R2 7601
#define BUILD_WINDOWS_SERVER_2012 9200
#define BUILD_WINDOWS_8_1 9600
#define BUILD_WINDOWS_SERVER_2012_R2 9600
#define BUILD_WINDOWS_10_1507 10240
#define BUILD_WINDOWS_10_1607 14393
#define BUILD_WINDOWS_SERVER_2016 14393
#define BUILD_WINDOWS_10_1809 17763
#define BUILD_WINDOWS_SERVER_2019 17763
#define BUILD_WINDOWS_10_1903 18362
#define BUILD_WINDOWS_10_1909 18363
#define BUILD_WINDOWS_10_2004 19041
#define BUILD_WINDOWS_10_20H2 19042
#define BUILD_WINDOWS_SERVER_20H2 19042
#define BUILD_WINDOWS_10_21H1 19043
#define BUILD_WINDOWS_10_21H2 19044
#define BUILD_WINDOWS_SERVER_2022 20348
#define BUILD_WINDOWS_11_21H2 22000
#define BUILD_WINDOWS_11_22H2 22621
DWORD GetWindowsBuild( DWORD* revision );

View File

@ -0,0 +1,74 @@
//=========================================================================-==
//
// dll.c
//
// DLL support functions
//
//============================================================================
#include <windows.h>
#include <assert.h>
#include <tchar.h>
#include <stdlib.h>
#include "dll.h"
#ifndef LOAD_LIBRARY_SEARCH_SYSTEM32
#define LOAD_LIBRARY_SEARCH_SYSTEM32 0x800
#endif
//=========================================================================-==
//
// ExtendedFlagsSupported
//
// Returns TRUE if running on Windows 7 or later and FALSE otherwise
//
//============================================================================
static BOOLEAN ExtendedFlagsSupported()
{
OSVERSIONINFO osInfo;
BOOLEAN rc = FALSE;
ZeroMemory(&osInfo, sizeof(OSVERSIONINFO));
osInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
#pragma warning ( disable : 4996 ) // deprecated in favour of version helper functions which we can't use
if (GetVersionEx(&osInfo) && (osInfo.dwMajorVersion > 6 || (osInfo.dwMajorVersion == 6 && osInfo.dwMinorVersion > 0)))
rc = TRUE;
#pragma warning ( default : 4996 )
return rc;
}
//=========================================================================-==
//
// LoadLibrarySafe
//
// Loads a DLL from the system folder in a way that mitigates DLL spoofing /
// side-loading attacks
//
//============================================================================
HMODULE LoadLibrarySafe(LPCTSTR libraryName, DLL_LOAD_LOCATION location)
{
HMODULE hMod = NULL;
if (NULL == libraryName || location <= DLL_LOAD_LOCATION_MIN || location >= DLL_LOAD_LOCATION_MAX) {
SetLastError(ERROR_INVALID_PARAMETER);
return NULL;
}
// LOAD_LIBRARY_SEARCH_SYSTEM32 is only supported on Window 7 or later. On earlier SKUs we could use a fully
// qualified path to the system folder but specifying a path causes Ldr to skip sxs file redirection. This can
// cause the wrong library to be loaded if the application is using a manifest that defines a specific version
// of Microsoft.Windows.Common-Controls when loading comctl32.dll
if (DLL_LOAD_LOCATION_SYSTEM == location) {
DWORD flags = ExtendedFlagsSupported() ? LOAD_LIBRARY_SEARCH_SYSTEM32 : 0;
hMod = LoadLibraryEx(libraryName, NULL, flags);
}
return hMod;
}

View File

@ -0,0 +1,26 @@
//=========================================================================-==
//
// dll.h
//
// DLL support functions
//
//============================================================================
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
typedef enum
{
DLL_LOAD_LOCATION_MIN = 0,
DLL_LOAD_LOCATION_SYSTEM = 1,
DLL_LOAD_LOCATION_MAX
} DLL_LOAD_LOCATION, *PDLL_LOAD_LOCATION;
HMODULE LoadLibrarySafe(LPCTSTR libraryName, DLL_LOAD_LOCATION location);
#ifdef __cplusplus
}
#endif

View File

@ -0,0 +1,168 @@
#include "pch.h"
#include "AudioSampleGenerator.h"
#include "CaptureFrameWait.h"
extern TCHAR g_MicrophoneDeviceId[];
namespace winrt
{
using namespace Windows::Foundation;
using namespace Windows::Storage;
using namespace Windows::Storage::Streams;
using namespace Windows::Media;
using namespace Windows::Media::Audio;
using namespace Windows::Media::Capture;
using namespace Windows::Media::Core;
using namespace Windows::Media::Render;
using namespace Windows::Media::MediaProperties;
using namespace Windows::Media::Devices;
using namespace Windows::Devices::Enumeration;
}
AudioSampleGenerator::AudioSampleGenerator()
{
m_audioEvent.create(wil::EventOptions::ManualReset);
m_endEvent.create(wil::EventOptions::ManualReset);
m_asyncInitialized.create(wil::EventOptions::ManualReset);
}
AudioSampleGenerator::~AudioSampleGenerator()
{
Stop();
if (m_started.load())
{
m_audioGraph.Close();
}
}
winrt::IAsyncAction AudioSampleGenerator::InitializeAsync()
{
auto expected = false;
if (m_initialized.compare_exchange_strong(expected, true))
{
// Initialize the audio graph
auto audioGraphSettings = winrt::AudioGraphSettings(winrt::AudioRenderCategory::Media);
auto audioGraphResult = co_await winrt::AudioGraph::CreateAsync(audioGraphSettings);
if (audioGraphResult.Status() != winrt::AudioGraphCreationStatus::Success)
{
throw winrt::hresult_error(E_FAIL, L"Failed to initialize AudioGraph!");
}
m_audioGraph = audioGraphResult.Graph();
// Initialize the selected microphone
auto defaultMicrophoneId = winrt::MediaDevice::GetDefaultAudioCaptureId(winrt::AudioDeviceRole::Default);
auto microphoneId = (g_MicrophoneDeviceId[0] == 0) ? defaultMicrophoneId : winrt::to_hstring(g_MicrophoneDeviceId);
auto microphone = co_await winrt::DeviceInformation::CreateFromIdAsync(microphoneId);
// Initialize audio input and output nodes
auto inputNodeResult = co_await m_audioGraph.CreateDeviceInputNodeAsync(winrt::MediaCategory::Media, m_audioGraph.EncodingProperties(), microphone);
if (inputNodeResult.Status() != winrt::AudioDeviceNodeCreationStatus::Success && microphoneId != defaultMicrophoneId)
{
// If the selected microphone failed, try again with the default
microphone = co_await winrt::DeviceInformation::CreateFromIdAsync(defaultMicrophoneId);
inputNodeResult = co_await m_audioGraph.CreateDeviceInputNodeAsync(winrt::MediaCategory::Media, m_audioGraph.EncodingProperties(), microphone);
}
if (inputNodeResult.Status() != winrt::AudioDeviceNodeCreationStatus::Success)
{
throw winrt::hresult_error(E_FAIL, L"Failed to initialize input audio node!");
}
m_audioInputNode = inputNodeResult.DeviceInputNode();
m_audioOutputNode = m_audioGraph.CreateFrameOutputNode();
// Hookup audio nodes
m_audioInputNode.AddOutgoingConnection(m_audioOutputNode);
m_audioGraph.QuantumStarted({ this, &AudioSampleGenerator::OnAudioQuantumStarted });
m_asyncInitialized.SetEvent();
}
}
winrt::AudioEncodingProperties AudioSampleGenerator::GetEncodingProperties()
{
CheckInitialized();
return m_audioOutputNode.EncodingProperties();
}
std::optional<winrt::MediaStreamSample> AudioSampleGenerator::TryGetNextSample()
{
CheckInitialized();
CheckStarted();
{
auto lock = m_lock.lock_exclusive();
if (m_samples.empty() && m_endEvent.is_signaled())
{
return std::nullopt;
}
else if (!m_samples.empty())
{
std::optional result(m_samples.front());
m_samples.pop_front();
return result;
}
}
m_audioEvent.ResetEvent();
std::vector<HANDLE> events = { m_endEvent.get(), m_audioEvent.get() };
auto waitResult = WaitForMultipleObjectsEx(static_cast<DWORD>(events.size()), events.data(), false, INFINITE, false);
auto eventIndex = -1;
switch (waitResult)
{
case WAIT_OBJECT_0:
case WAIT_OBJECT_0 + 1:
eventIndex = waitResult - WAIT_OBJECT_0;
break;
}
WINRT_VERIFY(eventIndex >= 0);
auto signaledEvent = events[eventIndex];
if (signaledEvent == m_endEvent.get())
{
return std::nullopt;
}
else
{
auto lock = m_lock.lock_exclusive();
std::optional result(m_samples.front());
m_samples.pop_front();
return result;
}
}
void AudioSampleGenerator::Start()
{
CheckInitialized();
auto expected = false;
if (m_started.compare_exchange_strong(expected, true))
{
m_audioGraph.Start();
}
}
void AudioSampleGenerator::Stop()
{
CheckInitialized();
if (m_started.load())
{
m_asyncInitialized.wait();
m_audioGraph.Stop();
m_endEvent.SetEvent();
}
}
void AudioSampleGenerator::OnAudioQuantumStarted(winrt::AudioGraph const& sender, winrt::IInspectable const& args)
{
{
auto lock = m_lock.lock_exclusive();
auto frame = m_audioOutputNode.GetFrame();
std::optional<winrt::TimeSpan> timestamp = frame.RelativeTime();
auto audioBuffer = frame.LockBuffer(winrt::AudioBufferAccessMode::Read);
auto sampleBuffer = winrt::Buffer::CreateCopyFromMemoryBuffer(audioBuffer);
sampleBuffer.Length(audioBuffer.Length());
auto sample = winrt::MediaStreamSample::CreateFromBuffer(sampleBuffer, timestamp.value());
m_samples.push_back(sample);
}
m_audioEvent.SetEvent();
}

View File

@ -0,0 +1,48 @@
#pragma once
class AudioSampleGenerator
{
public:
AudioSampleGenerator();
~AudioSampleGenerator();
winrt::Windows::Foundation::IAsyncAction InitializeAsync();
winrt::Windows::Media::MediaProperties::AudioEncodingProperties GetEncodingProperties();
std::optional<winrt::Windows::Media::Core::MediaStreamSample> TryGetNextSample();
void Start();
void Stop();
private:
void OnAudioQuantumStarted(
winrt::Windows::Media::Audio::AudioGraph const& sender,
winrt::Windows::Foundation::IInspectable const& args);
void CheckInitialized()
{
if (!m_initialized.load())
{
throw winrt::hresult_error(E_FAIL, L"Must initialize audio sample generator before use!");
}
}
void CheckStarted()
{
if (!m_started.load())
{
throw winrt::hresult_error(E_FAIL, L"Must start audio sample generator before calling this method!");
}
}
private:
winrt::Windows::Media::Audio::AudioGraph m_audioGraph{ nullptr };
winrt::Windows::Media::Audio::AudioDeviceInputNode m_audioInputNode{ nullptr };
winrt::Windows::Media::Audio::AudioFrameOutputNode m_audioOutputNode{ nullptr };
wil::srwlock m_lock;
wil::unique_event m_audioEvent;
wil::unique_event m_endEvent;
wil::unique_event m_asyncInitialized;
std::deque<winrt::Windows::Media::Core::MediaStreamSample> m_samples;
std::atomic<bool> m_initialized = false;
std::atomic<bool> m_started = false;
};

View File

@ -0,0 +1,147 @@
//==============================================================================
//
// Zoomit
// Sysinternals - www.sysinternals.com
//
// Video capture code derived from https://github.com/robmikh/capturevideosample
//
//==============================================================================
#include "pch.h"
#include "CaptureFrameWait.h"
namespace winrt
{
using namespace Windows::Foundation;
using namespace Windows::Graphics;
using namespace Windows::Graphics::Capture;
using namespace Windows::Graphics::DirectX;
using namespace Windows::Graphics::DirectX::Direct3D11;
using namespace Windows::Storage;
using namespace Windows::UI::Composition;
}
namespace util
{
using namespace robmikh::common::uwp;
}
//----------------------------------------------------------------------------
//
// CaptureFrameWait::CaptureFrameWait
//
//----------------------------------------------------------------------------
CaptureFrameWait::CaptureFrameWait(
winrt::IDirect3DDevice const& device,
winrt::GraphicsCaptureItem const& item,
winrt::SizeInt32 const& size)
{
m_device = device;
m_item = item;
m_nextFrameEvent = wil::shared_event(wil::EventOptions::ManualReset);
m_endEvent = wil::shared_event(wil::EventOptions::ManualReset);
m_closedEvent = wil::shared_event(wil::EventOptions::ManualReset);
m_framePool = winrt::Direct3D11CaptureFramePool::CreateFreeThreaded(
m_device,
winrt::DirectXPixelFormat::B8G8R8A8UIntNormalized,
1,
size);
m_session = m_framePool.CreateCaptureSession(m_item);
m_framePool.FrameArrived({ this, &CaptureFrameWait::OnFrameArrived });
m_session.StartCapture();
}
//----------------------------------------------------------------------------
//
// CaptureFrameWait::~CaptureFrameWait
//
//----------------------------------------------------------------------------
CaptureFrameWait::~CaptureFrameWait()
{
StopCapture();
// We might end the capture before we ever get another frame.
m_closedEvent.wait(200);
}
//----------------------------------------------------------------------------
//
// CaptureFrameWait::TryGetNextFrame
//
// Fetches next available frame
//
//----------------------------------------------------------------------------
std::optional<CaptureFrame> CaptureFrameWait::TryGetNextFrame()
{
if (m_currentFrame != nullptr)
{
m_currentFrame.Close();
}
m_nextFrameEvent.ResetEvent();
std::vector<HANDLE> events = { m_endEvent.get(), m_nextFrameEvent.get() };
auto waitResult = WaitForMultipleObjectsEx(static_cast<DWORD>(events.size()), events.data(), false, INFINITE, false);
auto eventIndex = -1;
switch (waitResult)
{
case WAIT_OBJECT_0:
case WAIT_OBJECT_0 + 1:
eventIndex = waitResult - WAIT_OBJECT_0;
break;
}
WINRT_VERIFY(eventIndex >= 0);
auto signaledEvent = events[eventIndex];
if (signaledEvent == m_endEvent.get())
{
return std::nullopt;
}
return std::optional<CaptureFrame>(
{
m_currentFrame.Surface(),
m_currentFrame.ContentSize(),
m_currentFrame.SystemRelativeTime(),
});
}
//----------------------------------------------------------------------------
//
// CaptureFrameWait::StopCapture
//
// Stops frame capture and notified any frame waiters
//
//----------------------------------------------------------------------------
void CaptureFrameWait::StopCapture()
{
auto lock = m_lock.lock_exclusive();
m_endEvent.SetEvent();
m_framePool.Close();
m_session.Close();
}
//----------------------------------------------------------------------------
//
// CaptureFrameWait::OnFrameArrived
//
// Callback for new frames
//
//----------------------------------------------------------------------------
void CaptureFrameWait::OnFrameArrived(
winrt::Direct3D11CaptureFramePool const& sender,
winrt::IInspectable const&)
{
auto lock = m_lock.lock_exclusive();
if (m_endEvent.is_signaled())
{
m_closedEvent.SetEvent();
return;
}
auto frame = sender.TryGetNextFrame();
if( frame ) {
m_currentFrame = frame;
m_nextFrameEvent.SetEvent();
}
}

View File

@ -0,0 +1,142 @@
//==============================================================================
//
// Zoomit
// Sysinternals - www.sysinternals.com
//
// Video capture code derived from https://github.com/robmikh/capturevideosample
//
//==============================================================================
#pragma once
// Must come before C++/WinRT
#include <wil/cppwinrt.h>
// WinRT
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.Foundation.Collections.h>
#include <winrt/Windows.Foundation.Metadata.h>
#include <winrt/Windows.Foundation.Numerics.h>
#include <winrt/Windows.System.h>
#include <winrt/Windows.UI.h>
#include <winrt/Windows.UI.Composition.h>
#include <winrt/Windows.UI.Composition.Desktop.h>
#include <winrt/Windows.UI.Popups.h>
#include <winrt/Windows.Graphics.Capture.h>
#include <winrt/Windows.Graphics.DirectX.h>
#include <winrt/Windows.Graphics.DirectX.Direct3d11.h>
#include <winrt/Windows.Media.h>
#include <winrt/Windows.Media.Audio.h>
#include <winrt/Windows.Media.Core.h>
#include <winrt/Windows.Media.Render.h>
#include <winrt/Windows.Media.Transcoding.h>
#include <winrt/Windows.Media.MediaProperties.h>
#include <winrt/Windows.Storage.h>
#include <winrt/Windows.Storage.Streams.h>
#include <winrt/Windows.Storage.Pickers.h>
// WIL
#include <wil/resource.h>
// DirectX
#include <d3d11_4.h>
#include <dxgi1_6.h>
#include <d2d1_3.h>
#include <wincodec.h>
// STL
#include <vector>
#include <string>
#include <atomic>
#include <memory>
#include <algorithm>
#include <filesystem>
#include <array>
#include <thread>
#include <functional>
#include <optional>
#include <chrono>
#include <mutex>
#include <deque>
// robmikh.common
#include <robmikh.common/composition.interop.h>
#include <robmikh.common/direct3d11.interop.h>
#include <robmikh.common/d3dHelpers.h>
#include <robmikh.common/graphics.interop.h>
#include <robmikh.common/dispatcherqueue.desktop.interop.h>
#include <robmikh.common/d3dHelpers.desktop.h>
#include <robmikh.common/composition.desktop.interop.h>
#include <robmikh.common/hwnd.interop.h>
#include <robmikh.common/capture.desktop.interop.h>
#include <robmikh.common/DesktopWindow.h>
namespace winrt
{
using namespace Windows::Foundation;
using namespace Windows::Foundation::Metadata;
using namespace Windows::Graphics;
using namespace Windows::Graphics::Capture;
using namespace Windows::Graphics::DirectX;
using namespace Windows::Graphics::DirectX::Direct3D11;
using namespace Windows::Storage;
using namespace Windows::UI::Composition;
using namespace Windows::Media::Core;
using namespace Windows::Media::Transcoding;
using namespace Windows::Media::MediaProperties;
}
namespace util
{
using namespace robmikh::common::uwp;
}
struct CaptureFrame
{
winrt::Direct3D11::IDirect3DSurface FrameTexture;
winrt::SizeInt32 ContentSize;
winrt::TimeSpan SystemRelativeTime;
};
class CaptureFrameWait
{
public:
CaptureFrameWait(
winrt::Direct3D11::IDirect3DDevice const& device,
winrt::GraphicsCaptureItem const& item,
winrt::SizeInt32 const& size );
~CaptureFrameWait();
std::optional<CaptureFrame> TryGetNextFrame();
void StopCapture();
void EnableCursorCapture( bool enable = true )
{
if( winrt::ApiInformation::IsPropertyPresent( winrt::name_of<decltype(m_session)>(), L"IsCursorCaptureEnabled" ) )
{
m_session.IsCursorCaptureEnabled( enable );
}
}
void ShowCaptureBorder( bool show = true )
{
if( winrt::ApiInformation::IsPropertyPresent( winrt::name_of<decltype(m_session)>(), L"IsBorderRequired" ) )
{
m_session.IsBorderRequired( show );
}
}
private:
void OnFrameArrived(
winrt::Direct3D11CaptureFramePool const& sender,
winrt::IInspectable const& args );
private:
winrt::Direct3D11::IDirect3DDevice m_device{ nullptr };
winrt::GraphicsCaptureItem m_item{ nullptr };
winrt::Direct3D11CaptureFramePool m_framePool{ nullptr };
winrt::GraphicsCaptureSession m_session{ nullptr };
wil::shared_event m_nextFrameEvent;
wil::shared_event m_endEvent;
wil::shared_event m_closedEvent;
wil::srwlock m_lock;
winrt::Direct3D11CaptureFrame m_currentFrame{ nullptr };
};

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,24 @@
//============================================================================
//
// Zoomit
// Copyright (C) Mark Russinovich
// Sysinternals - www.sysinternals.com
//
// DemoType allows the presenter to synthesize keystrokes from a script
//
//============================================================================
#pragma once
#define MAX_INPUT_SIZE 1048576 // 1 MiB
#define MAX_TYPING_SPEED 10 // ms
#define MIN_TYPING_SPEED 100 // ms
#define ERROR_LOADING_FILE 1
#define NO_FILE_SPECIFIED 2
#define FILE_SIZE_OVERFLOW 3
#define UNKNOWN_FILE_DATA 4
void ResetDemoTypeIndex();
int StartDemoType( const TCHAR* filePath, const DWORD speedSlider, const BOOLEAN userDriven );

View File

@ -0,0 +1,323 @@
//============================================================================
//
// Process Explorer
// Copyright (C) 1999-2005 Mark Russinovich
// Sysinternals - www.sysinternals.com
//
// Registry.h
//
//============================================================================
typedef enum {
SETTING_TYPE_DWORD,
SETTING_TYPE_BOOLEAN,
SETTING_TYPE_DOUBLE,
SETTING_TYPE_WORD,
SETTING_TYPE_STRING,
SETTING_TYPE_DWORD_ARRAY,
SETTING_TYPE_WORD_ARRAY,
SETTING_TYPE_BINARY
} REG_SETTING_TYPE;
typedef struct {
PCTSTR Valuename;
REG_SETTING_TYPE Type;
DWORD Size; // Optional
PVOID Setting;
double DefaultSetting;
} REG_SETTING, *PREG_SETTING;
class CRegistry {
private:
PTCHAR m_Keyname;
HKEY hKey;
public:
CRegistry( PCTSTR Keyname )
{
m_Keyname = _tcsdup( Keyname );
hKey = NULL;
}
~CRegistry()
{
free( m_Keyname );
}
void ReadRegSettings( PREG_SETTING Settings )
{
PREG_SETTING curSetting;
hKey = NULL;
RegOpenKeyEx(HKEY_CURRENT_USER,
m_Keyname, 0, KEY_READ, &hKey );
curSetting = Settings;
while( curSetting->Valuename ) {
switch( curSetting->Type ) {
case SETTING_TYPE_DWORD:
ReadValue( curSetting->Valuename, (PDWORD) curSetting->Setting,
(DWORD) curSetting->DefaultSetting );
break;
case SETTING_TYPE_BOOLEAN:
ReadValue( curSetting->Valuename, (PBOOLEAN) curSetting->Setting,
(BOOLEAN) curSetting->DefaultSetting );
break;
case SETTING_TYPE_DOUBLE:
ReadValue( curSetting->Valuename, (double *) curSetting->Setting,
curSetting->DefaultSetting );
break;
case SETTING_TYPE_WORD:
ReadValue( curSetting->Valuename, (short *) curSetting->Setting,
(WORD) curSetting->DefaultSetting );
break;
case SETTING_TYPE_STRING:
ReadValue( curSetting->Valuename, (PTCHAR) curSetting->Setting,
curSetting->Size, (PTCHAR) (DWORD_PTR) curSetting->DefaultSetting );
break;
case SETTING_TYPE_DWORD_ARRAY:
ReadValueArray( curSetting->Valuename, curSetting->Size/sizeof DWORD,
(PDWORD) curSetting->Setting );
break;
case SETTING_TYPE_WORD_ARRAY:
ReadValueArray( curSetting->Valuename, curSetting->Size/sizeof(short),
(PWORD) curSetting->Setting );
break;
case SETTING_TYPE_BINARY:
ReadValueBinary( curSetting->Valuename, (PBYTE) curSetting->Setting,
curSetting->Size );
break;
}
curSetting++;
}
if( hKey ) {
RegCloseKey( hKey );
}
}
void WriteRegSettings( PREG_SETTING Settings )
{
PREG_SETTING curSetting;
if( !RegCreateKeyEx(HKEY_CURRENT_USER,
m_Keyname, NULL, NULL, 0, KEY_WRITE, NULL, &hKey, NULL )) {
curSetting = Settings;
while( curSetting->Valuename ) {
switch( curSetting->Type ) {
case SETTING_TYPE_DWORD:
WriteValue( curSetting->Valuename, *(PDWORD) curSetting->Setting );
break;
case SETTING_TYPE_BOOLEAN:
WriteValue( curSetting->Valuename, *(PBOOLEAN) curSetting->Setting );
break;
case SETTING_TYPE_DOUBLE:
WriteValue( curSetting->Valuename, *(double *) curSetting->Setting );
break;
case SETTING_TYPE_WORD:
WriteValue( curSetting->Valuename, *(short *) curSetting->Setting );
break;
case SETTING_TYPE_STRING:
WriteValue( curSetting->Valuename, (PTCHAR) curSetting->Setting );
break;
case SETTING_TYPE_DWORD_ARRAY:
WriteValueArray( curSetting->Valuename, curSetting->Size/sizeof DWORD,
(PDWORD) curSetting->Setting );
break;
case SETTING_TYPE_WORD_ARRAY:
WriteValueArray( curSetting->Valuename, curSetting->Size/sizeof(short),
(PWORD) curSetting->Setting );
break;
case SETTING_TYPE_BINARY:
WriteValueBinary( curSetting->Valuename, (PBYTE) curSetting->Setting,
curSetting->Size );
break;
}
curSetting++;
}
RegCloseKey( hKey );
}
}
private:
// Reads
void ReadValue( PCTSTR Valuename, PDWORD Value, DWORD Default = 0 )
{
DWORD length = sizeof(DWORD);
if( RegQueryValueEx( hKey, Valuename, NULL, NULL, (PBYTE) Value,
&length )) {
*Value = Default;
}
}
void ReadValue( PCTSTR Valuename, PBOOLEAN Value, BOOLEAN Default = FALSE )
{
DWORD length = sizeof(DWORD);
DWORD val = (DWORD) *Value;
if( RegQueryValueEx( hKey, Valuename, NULL, NULL, (PBYTE) &val,
&length )) {
*Value = Default;
} else {
*Value = (BOOLEAN) val;
}
}
void ReadValue( PCTSTR Valuename, short *Value, short Default = 0 )
{
DWORD length = sizeof(DWORD);
DWORD val = (DWORD) *Value;
if( RegQueryValueEx( hKey, Valuename, NULL, NULL, (PBYTE) &val,
&length )) {
*Value = Default;
} else {
*Value = (short) val;
}
}
void ReadValue( PCTSTR Valuename, double *Value, double Default = 0.0 )
{
DWORD length = sizeof(double);
if( RegQueryValueEx( hKey, Valuename, NULL, NULL, (PBYTE) Value,
&length )) {
*Value = Default;
}
}
void ReadValue( PCTSTR Valuename, PTCHAR Value, DWORD Length, PCTSTR Default )
{
if( RegQueryValueEx( hKey, Valuename, NULL, NULL, (PBYTE) Value,
&Length ) && Default ) {
_tcscpy_s( Value, Length, Default );
}
}
void ReadValueBinary( PCTSTR Valuename, PBYTE Value, DWORD Length )
{
RegQueryValueEx( hKey, Valuename, NULL, NULL, Value,
&Length );
}
void ReadValueArray( PCTSTR Valuename, DWORD Number, PDWORD Entries )
{
HKEY hSubKey;
TCHAR subVal[16];
DWORD length;
if( !RegOpenKeyEx(hKey,
Valuename, 0, KEY_READ, &hSubKey )) {
for( DWORD i = 0; i < Number; i++ ) {
length = sizeof(DWORD);
_stprintf_s( subVal, _countof(subVal), _T("%d"), i );
RegQueryValueEx( hSubKey, subVal, NULL, NULL, (PBYTE) &Entries[i], &length);
}
RegCloseKey( hSubKey );
}
}
void ReadValueArray( PCTSTR Valuename, DWORD Number, PWORD Entries )
{
HKEY hSubKey;
TCHAR subVal[16];
DWORD length;
DWORD val;
if( !RegOpenKeyEx(hKey,
Valuename, 0, KEY_READ, &hSubKey )) {
for( DWORD i = 0; i < Number; i++ ) {
length = sizeof(DWORD);
_stprintf_s( subVal, _countof(subVal), _T("%d"), i );
if( !RegQueryValueEx( hSubKey, subVal, NULL, NULL, (PBYTE) &val, &length)) {
Entries[i] = (WORD) val;
}
}
RegCloseKey( hSubKey );
}
}
// Writes
void WriteValue( PCTSTR Valuename, DWORD Value )
{
RegSetValueEx( hKey, Valuename, 0, REG_DWORD, (PBYTE) &Value,
sizeof(DWORD));
}
void WriteValue( PCTSTR Valuename, short Value )
{
DWORD val = (DWORD) Value;
RegSetValueEx( hKey, Valuename, 0, REG_DWORD, (PBYTE) &val,
sizeof(DWORD));
}
void WriteValue( PCTSTR Valuename, BOOLEAN Value )
{
DWORD val = (DWORD) Value;
RegSetValueEx( hKey, Valuename, 0, REG_DWORD, (PBYTE) &val,
sizeof(DWORD));
}
void WriteValue( PCTSTR Valuename, double Value )
{
RegSetValueEx( hKey, Valuename, 0, REG_BINARY, (PBYTE) &Value,
sizeof(double));
}
void WriteValue( PCTSTR Valuename, PTCHAR Value )
{
RegSetValueEx( hKey, Valuename, 0, REG_SZ, (PBYTE) Value,
(DWORD) _tcslen( Value ) * sizeof(TCHAR));
}
void WriteValueBinary( PCTSTR Valuename, PBYTE Value, DWORD Length )
{
RegSetValueEx( hKey, Valuename, 0, REG_BINARY, Value,
Length );
}
void WriteValueArray( PCTSTR Valuename, DWORD Number, PDWORD Entries )
{
HKEY hSubKey;
TCHAR subVal[16];
if( !RegCreateKeyEx(hKey,
Valuename, NULL, NULL, 0, KEY_WRITE, NULL, &hSubKey, NULL )) {
for( DWORD i = 0; i < Number; i++ ) {
_stprintf_s( subVal, _countof(subVal), _T("%d"), i );
if( Entries[i] )
RegSetValueEx( hSubKey, subVal, 0, REG_DWORD, (PBYTE) &Entries[i], sizeof(DWORD));
else
RegDeleteValue( hSubKey, subVal );
}
RegCloseKey( hSubKey );
}
}
void WriteValueArray( PCTSTR Valuename, DWORD Number, PWORD Entries )
{
HKEY hSubKey;
TCHAR subVal[16];
DWORD val;
if( !RegCreateKeyEx(hKey,
Valuename, NULL, NULL, 0, KEY_WRITE, NULL, &hSubKey, NULL )) {
for( DWORD i = 0; i < Number; i++ ) {
_stprintf_s( subVal, _countof(subVal), _T("%d"), i );
val = (DWORD) Entries[i];
if( Entries[i] )
RegSetValueEx( hSubKey, subVal, 0, REG_DWORD, (PBYTE) &val, sizeof(DWORD));
else
RegDeleteValue( hSubKey, subVal );
}
RegCloseKey( hSubKey );
}
}
};

View File

@ -0,0 +1,269 @@
//==============================================================================
//
// Zoomit
// Sysinternals - www.sysinternals.com
//
// Class to select a recording rectangle and show it while recording
//
//==============================================================================
#include "pch.h"
#include "SelectRectangle.h"
#include "Utility.h"
#include "WindowsVersions.h"
//----------------------------------------------------------------------------
//
// SelectRectangle::Start
//
//----------------------------------------------------------------------------
bool SelectRectangle::Start( HWND ownerWindow, bool fullMonitor )
{
WNDCLASSW windowClass{};
windowClass.lpfnWndProc = []( HWND window, UINT message, WPARAM wordParam, LPARAM longParam ) -> LRESULT
{
if( message == WM_NCCREATE )
{
auto createStruct = reinterpret_cast<LPCREATESTRUCT>(longParam);
SetWindowLongPtrW( window, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(createStruct->lpCreateParams) );
return TRUE;
}
auto self = reinterpret_cast<SelectRectangle*>(GetWindowLongPtrW( window, GWLP_USERDATA ));
return self->WindowProc( window, message, wordParam, longParam );
};
windowClass.hInstance = GetModuleHandle( nullptr );
windowClass.hCursor = LoadCursorW( nullptr, IDC_CROSS );
windowClass.hbrBackground = static_cast<HBRUSH>(GetStockObject( BLACK_BRUSH ));
windowClass.lpszClassName = m_className;
if( RegisterClassW( &windowClass ) == 0 )
{
THROW_LAST_ERROR_IF( GetLastError() != ERROR_CLASS_ALREADY_EXISTS );
WNDCLASSW existingClass{};
THROW_IF_WIN32_BOOL_FALSE( GetClassInfoW( GetModuleHandle( nullptr ), m_className, &existingClass ) );
THROW_LAST_ERROR_IF( existingClass.lpfnWndProc != windowClass.lpfnWndProc );
}
m_cancel = false;
auto rect = GetMonitorRectFromCursor();
m_window = wil::unique_hwnd( CreateWindowExW( WS_EX_LAYERED | WS_EX_TOOLWINDOW | WS_EX_TOPMOST, m_className, nullptr, WS_POPUP,
rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, ownerWindow,
nullptr, nullptr, this ) );
THROW_LAST_ERROR_IF_NULL( m_window.get() );
if( fullMonitor )
{
m_selectedRect = rect;
ShowSelected();
}
else
{
SetLayeredWindowAttributes( m_window.get(), 0, Alpha(), LWA_ALPHA );
}
ShowWindow( m_window.get(), SW_SHOW );
SetForegroundWindow( m_window.get() );
if( !fullMonitor )
{
GetClipCursor( &m_oldClipRect );
ClipCursor( &rect );
m_setClip = true;
}
MSG message;
while( GetMessageW( &message, nullptr, 0, 0 ) != 0 )
{
TranslateMessage( &message );
DispatchMessageW( &message );
if( m_cancel )
{
return false;
}
if( m_selected )
{
break;
}
}
return true;
}
//----------------------------------------------------------------------------
//
// SelectRectangle::Stop
//
//----------------------------------------------------------------------------
void SelectRectangle::Stop()
{
if( m_setClip )
{
ClipCursor( &m_oldClipRect );
m_setClip = false;
}
m_window.reset();
m_selected = false;
m_selectedRect = {};
m_cancel = true;
}
//----------------------------------------------------------------------------
//
// SelectRectangle::ShowSelected
//
//----------------------------------------------------------------------------
void SelectRectangle::ShowSelected()
{
m_selected = true;
// Set the alpha to match the Windows graphics capture API yellow border
// and set the window to be transparent and disabled, so it will be skipped
// for hit testing and as a candidate for the next foreground window.
SetLayeredWindowAttributes( m_window.get(), 0, 191, LWA_ALPHA );
SetWindowLong( m_window.get(), GWL_EXSTYLE, GetWindowLong( m_window.get(), GWL_EXSTYLE ) | WS_EX_TRANSPARENT );
EnableWindow( m_window.get(), FALSE );
POINT point{ m_selectedRect.left, m_selectedRect.top };
auto rect = m_selectedRect;
OffsetRect( &rect, -rect.left, -rect.top );
int width = ScaleForDpi( 2, m_dpi );
// Draw the selection border outside the selected rectangle on builds lower
// than Windows 11 22H2 because the graphics capture API does not skip
// windows if layered, meaning this yellow border will be captured.
if( GetWindowsBuild( nullptr ) < BUILD_WINDOWS_11_22H2 )
{
InflateRect( &rect, width, width );
OffsetRect( &rect, -rect.left, -rect.top );
point.x -= width;
point.y -= width;
}
// Resize the window to the selection rectangle and translate the position.
RECT windowRect;
GetWindowRect( m_window.get(), &windowRect );
point.x += windowRect.left;
point.y += windowRect.top;
MoveWindow( m_window.get(), point.x, point.y, rect.right, rect.bottom, true );
// Use a region to keep everything but the border transparent.
wil::unique_hrgn region{CreateRectRgnIndirect( &rect )};
InflateRect( &rect, -width, -width );
wil::unique_hrgn insideRegion{CreateRectRgnIndirect( &rect )};
CombineRgn( region.get(), region.get(), insideRegion.get(), RGN_XOR );
SetWindowRgn( m_window.get(), region.release(), true );
}
//----------------------------------------------------------------------------
//
// SelectRectangle::UpdateOwner
//
//----------------------------------------------------------------------------
void SelectRectangle::UpdateOwner( HWND window )
{
if( m_window != nullptr )
{
SetWindowLongPtr( m_window.get(), GWLP_HWNDPARENT, reinterpret_cast<LONG_PTR>(window) );
SetWindowPos( m_window.get(), HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE );
}
}
//----------------------------------------------------------------------------
//
// SelectRectangle::WindowProc
//
//----------------------------------------------------------------------------
LRESULT SelectRectangle::WindowProc( HWND window, UINT message, WPARAM wordParam, LPARAM longParam )
{
switch( message )
{
case WM_CREATE:
m_dpi = GetDpiForWindowHelper( window );
SetWindowDisplayAffinity( window, WDA_EXCLUDEFROMCAPTURE );
return 0;
case WM_DESTROY:
Stop();
return 0;
case WM_LBUTTONDOWN:
{
SetCapture( window );
m_startPoint = { GET_X_LPARAM( longParam ), GET_Y_LPARAM( longParam ) };
[[fallthrough]];
}
case WM_MOUSEMOVE:
if( GetCapture() == window )
{
RECT rect;
GetClientRect( window, &rect );
POINT point{ GET_X_LPARAM( longParam ), GET_Y_LPARAM( longParam ) };
m_selectedRect = ForceRectInBounds( RectFromPointsMinSize( m_startPoint, point, MinSize() ), rect );
// Use a region to carve out the selected rectangle.
wil::unique_hrgn region{CreateRectRgnIndirect( &m_selectedRect )};
wil::unique_hrgn clientRegion{CreateRectRgnIndirect( &rect )};
CombineRgn( region.get(), region.get(), clientRegion.get(), RGN_XOR );
SetWindowRgn( window, region.release(), true );
}
return 0;
case WM_KEYDOWN:
if( wordParam == VK_ESCAPE )
{
Stop();
}
return 0;
case WM_KILLFOCUS:
if( !m_selected )
{
Stop();
}
return 0;
case WM_LBUTTONUP:
{
if( m_setClip )
{
ClipCursor( &m_oldClipRect );
m_setClip = false;
}
ReleaseCapture();
ShowSelected();
return 0;
}
case WM_NCHITTEST:
if( m_selected )
{
return HTTRANSPARENT;
}
break;
case WM_PAINT:
if( m_selected )
{
PAINTSTRUCT paint;
auto deviceContext = BeginPaint( window, &paint );
RECT rect;
GetClientRect( window, &rect );
// Draw a border matching the Windows graphics capture API border.
// The outer frame is yellow and two logical pixels wide, while the
// inner is black and 1 logical pixel wide.
wil::unique_hbrush brush{CreateSolidBrush( RGB( 255, 222, 0 ) )};
FillRect( deviceContext, &rect, brush.get() );
int width = ScaleForDpi( 1, m_dpi );
InflateRect( &rect, -width, -width );
FillRect( deviceContext, &rect, static_cast<HBRUSH>(GetStockObject( BLACK_BRUSH )) );
EndPaint( window, &paint );
return 0;
}
break;
}
return DefWindowProcW( window, message, wordParam, longParam );
}

View File

@ -0,0 +1,44 @@
//==============================================================================
//
// Zoomit
// Sysinternals - www.sysinternals.com
//
// Class to select a recording rectangle and show it while recording
//
//==============================================================================
#pragma once
#include "pch.h"
class SelectRectangle
{
public:
~SelectRectangle() { Stop(); };
void Alpha( BYTE alpha ) { m_alpha = alpha; }
BYTE Alpha() const { return m_alpha; }
void MinSize( int minSize ) { m_minSize = minSize; }
int MinSize() const { return m_minSize; }
RECT SelectedRect() const { return m_selectedRect; }
bool Start( HWND ownerWindow = nullptr, bool fullMonitor = false );
void Stop();
void UpdateOwner( HWND window );
private:
BYTE m_alpha = 176;
int m_minSize = 34;
RECT m_selectedRect{};
bool m_cancel = false;
const wchar_t* m_className = L"ZoomitSelectRectangle";
UINT m_dpi;
RECT m_oldClipRect{};
bool m_selected{ false };
bool m_setClip{ false };
POINT m_startPoint{};
wil::unique_hwnd m_window;
void ShowSelected();
LRESULT WindowProc( HWND window, UINT message, WPARAM wordParam, LPARAM longParam );
};

View File

@ -0,0 +1,145 @@
//==============================================================================
//
// Zoomit
// Sysinternals - www.sysinternals.com
//
// Utility functions
//
//==============================================================================
#include "pch.h"
#include "Utility.h"
//----------------------------------------------------------------------------
//
// ForceRectInBounds
//
//----------------------------------------------------------------------------
RECT ForceRectInBounds( RECT rect, const RECT& bounds )
{
if( rect.left < bounds.left )
{
rect.right += bounds.left - rect.left;
rect.left = bounds.left;
}
if( rect.top < bounds.top )
{
rect.bottom += bounds.top - rect.top;
rect.top = bounds.top;
}
if( rect.right > bounds.right )
{
rect.left -= rect.right - bounds.right;
rect.right = bounds.right;
}
if( rect.bottom > bounds.bottom )
{
rect.top -= rect.bottom - bounds.bottom;
rect.bottom = bounds.bottom;
}
return rect;
}
//----------------------------------------------------------------------------
//
// GetDpiForWindow
//
//----------------------------------------------------------------------------
UINT GetDpiForWindowHelper( HWND window )
{
auto function = reinterpret_cast<UINT (WINAPI *)(HWND)>(GetProcAddress( GetModuleHandleW( L"user32.dll" ), "GetDpiForWindow" ));
if( function )
{
return function( window );
}
wil::unique_hdc hdc{GetDC( nullptr )};
return static_cast<UINT>(GetDeviceCaps( hdc.get(), LOGPIXELSX ));
}
//----------------------------------------------------------------------------
//
// GetMonitorRectFromCursor
//
//----------------------------------------------------------------------------
RECT GetMonitorRectFromCursor()
{
POINT point;
GetCursorPos( &point );
MONITORINFO monitorInfo{};
monitorInfo.cbSize = sizeof( monitorInfo );
GetMonitorInfoW( MonitorFromPoint( point, MONITOR_DEFAULTTONEAREST ), &monitorInfo );
return monitorInfo.rcMonitor;
}
//----------------------------------------------------------------------------
//
// RectFromPointsMinSize
//
//----------------------------------------------------------------------------
RECT RectFromPointsMinSize( POINT a, POINT b, LONG minSize )
{
RECT rect;
if( a.x <= b.x )
{
rect.left = a.x;
rect.right = b.x + 1;
if( (rect.right - rect.left) < minSize )
{
rect.right = rect.left + minSize;
}
}
else
{
rect.left = b.x;
rect.right = a.x + 1;
if( (rect.right - rect.left) < minSize )
{
rect.left = rect.right - minSize;
}
}
if( a.y <= b.y )
{
rect.top = a.y;
rect.bottom = b.y + 1;
if( (rect.bottom - rect.top) < minSize )
{
rect.bottom = rect.top + minSize;
}
}
else
{
rect.top = b.y;
rect.bottom = a.y + 1;
if( (rect.bottom - rect.top) < minSize )
{
rect.top = rect.bottom - minSize;
}
}
return rect;
}
//----------------------------------------------------------------------------
//
// ScaleForDpi
//
//----------------------------------------------------------------------------
int ScaleForDpi( int value, UINT dpi )
{
return MulDiv( value, (int) dpi, USER_DEFAULT_SCREEN_DPI );
}
//----------------------------------------------------------------------------
//
// ScalePointInRects
//
//----------------------------------------------------------------------------
POINT ScalePointInRects( POINT point, const RECT& source, const RECT& target )
{
const SIZE sourceSize{ source.right - source.left, source.bottom - source.top };
const POINT sourceCenter{ source.left + sourceSize.cx / 2, source.top + sourceSize.cy / 2 };
const SIZE targetSize{ target.right - target.left, target.bottom - target.top };
const POINT targetCenter{ target.left + targetSize.cx / 2, target.top + targetSize.cy / 2 };
return { targetCenter.x + MulDiv( point.x - sourceCenter.x, targetSize.cx, sourceSize.cx ),
targetCenter.y + MulDiv( point.y - sourceCenter.y, targetSize.cy, sourceSize.cy ) };
}

View File

@ -0,0 +1,18 @@
//==============================================================================
//
// Zoomit
// Sysinternals - www.sysinternals.com
//
// Utility functions
//
//==============================================================================
#pragma once
#include "pch.h"
RECT ForceRectInBounds( RECT rect, const RECT& bounds );
UINT GetDpiForWindowHelper( HWND window );
RECT GetMonitorRectFromCursor();
RECT RectFromPointsMinSize( POINT a, POINT b, LONG minSize );
int ScaleForDpi( int value, UINT dpi );
POINT ScalePointInRects( POINT point, const RECT& source, const RECT& target );

View File

@ -0,0 +1,391 @@
//==============================================================================
//
// Zoomit
// Sysinternals - www.sysinternals.com
//
// Video capture code derived from https://github.com/robmikh/capturevideosample
//
//==============================================================================
#include "pch.h"
#include "VideoRecordingSession.h"
#include "CaptureFrameWait.h"
extern DWORD g_RecordScaling;
namespace winrt
{
using namespace Windows::Foundation;
using namespace Windows::Graphics;
using namespace Windows::Graphics::Capture;
using namespace Windows::Graphics::DirectX;
using namespace Windows::Graphics::DirectX::Direct3D11;
using namespace Windows::Storage;
using namespace Windows::UI::Composition;
using namespace Windows::Media::Core;
using namespace Windows::Media::Transcoding;
using namespace Windows::Media::MediaProperties;
}
namespace util
{
using namespace robmikh::common::uwp;
}
const float CLEARCOLOR[] = { 0.0f, 0.0f, 0.0f, 1.0f };
int32_t EnsureEven(int32_t value)
{
if (value % 2 == 0)
{
return value;
}
else
{
return value + 1;
}
}
//----------------------------------------------------------------------------
//
// VideoRecordingSession::VideoRecordingSession
//
//----------------------------------------------------------------------------
VideoRecordingSession::VideoRecordingSession(
winrt::IDirect3DDevice const& device,
winrt::GraphicsCaptureItem const& item,
RECT const cropRect,
uint32_t frameRate,
bool captureAudio,
winrt::Streams::IRandomAccessStream const& stream)
{
m_device = device;
m_d3dDevice = GetDXGIInterfaceFromObject<ID3D11Device>(m_device);
m_d3dDevice->GetImmediateContext(m_d3dContext.put());
m_item = item;
auto itemSize = item.Size();
auto inputWidth = EnsureEven(itemSize.Width);
auto inputHeight = EnsureEven(itemSize.Height);
m_frameWait = std::make_shared<CaptureFrameWait>(m_device, m_item, winrt::SizeInt32{ inputWidth, inputHeight });
auto weakPointer{ std::weak_ptr{ m_frameWait } };
m_itemClosed = item.Closed(winrt::auto_revoke, [weakPointer](auto&, auto&)
{
auto sharedPointer{ weakPointer.lock() };
if (sharedPointer)
{
sharedPointer->StopCapture();
}
});
// Get crop dimension
if( (cropRect.right - cropRect.left) != 0 )
{
m_rcCrop = cropRect;
m_frameWait->ShowCaptureBorder( false );
}
else
{
m_rcCrop.left = 0;
m_rcCrop.top = 0;
m_rcCrop.right = inputWidth;
m_rcCrop.bottom = inputHeight;
}
// Ensure the video is not too small and try to maintain the aspect ratio
constexpr int c_minimumSize = 34;
auto scaledWidth = MulDiv(m_rcCrop.right - m_rcCrop.left, g_RecordScaling, 100);
auto scaledHeight = MulDiv(m_rcCrop.bottom - m_rcCrop.top, g_RecordScaling, 100);
auto outputWidth = scaledWidth;
auto outputHeight = scaledHeight;
if (outputWidth < c_minimumSize)
{
outputWidth = c_minimumSize;
outputHeight = MulDiv(outputHeight, outputWidth, scaledWidth);
}
if (outputHeight < c_minimumSize)
{
outputHeight = c_minimumSize;
outputWidth = MulDiv(outputWidth, outputHeight, scaledHeight);
}
if (outputWidth > inputWidth)
{
outputWidth = inputWidth;
outputHeight = c_minimumSize, MulDiv(outputHeight, scaledWidth, outputWidth);
}
if (outputHeight > inputHeight)
{
outputHeight = inputHeight;
outputWidth = c_minimumSize, MulDiv(outputWidth, scaledHeight, outputHeight);
}
outputWidth = EnsureEven(outputWidth);
outputHeight = EnsureEven(outputHeight);
// Describe out output: H264 video with an MP4 container
m_encodingProfile = winrt::MediaEncodingProfile();
m_encodingProfile.Container().Subtype(L"MPEG4");
auto video = m_encodingProfile.Video();
video.Subtype(L"H264");
video.Width(outputWidth);
video.Height(outputHeight);
video.Bitrate(static_cast<uint32_t>(outputWidth * outputHeight * frameRate * 2 * 0.07));
video.FrameRate().Numerator(frameRate);
video.FrameRate().Denominator(1);
video.PixelAspectRatio().Numerator(1);
video.PixelAspectRatio().Denominator(1);
m_encodingProfile.Video(video);
// if audio capture, set up audio profile
if (captureAudio)
{
auto audio = m_encodingProfile.Audio();
audio = winrt::AudioEncodingProperties::CreateAac(48000, 1, 16);
m_encodingProfile.Audio(audio);
}
// Describe our input: uncompressed BGRA8 buffers
auto properties = winrt::VideoEncodingProperties::CreateUncompressed(
winrt::MediaEncodingSubtypes::Bgra8(),
static_cast<uint32_t>(m_rcCrop.right - m_rcCrop.left),
static_cast<uint32_t>(m_rcCrop.bottom - m_rcCrop.top));
m_videoDescriptor = winrt::VideoStreamDescriptor(properties);
m_stream = stream;
m_previewSwapChain = util::CreateDXGISwapChain(
m_d3dDevice,
static_cast<uint32_t>(m_rcCrop.right - m_rcCrop.left),
static_cast<uint32_t>(m_rcCrop.bottom - m_rcCrop.top),
DXGI_FORMAT_B8G8R8A8_UNORM,
2);
winrt::com_ptr<ID3D11Texture2D> backBuffer;
winrt::check_hresult(m_previewSwapChain->GetBuffer(0, winrt::guid_of<ID3D11Texture2D>(), backBuffer.put_void()));
winrt::check_hresult(m_d3dDevice->CreateRenderTargetView(backBuffer.get(), nullptr, m_renderTargetView.put()));
if( captureAudio ) {
m_audioGenerator = std::make_unique<AudioSampleGenerator>();
}
else {
m_audioGenerator = nullptr;
}
}
//----------------------------------------------------------------------------
//
// VideoRecordingSession::~VideoRecordingSession
//
//----------------------------------------------------------------------------
VideoRecordingSession::~VideoRecordingSession()
{
Close();
}
//----------------------------------------------------------------------------
//
// VideoRecordingSession::StartAsync
//
//----------------------------------------------------------------------------
winrt::IAsyncAction VideoRecordingSession::StartAsync()
{
auto expected = false;
if (m_isRecording.compare_exchange_strong(expected, true))
{
// Create our MediaStreamSource
if(m_audioGenerator) {
co_await m_audioGenerator->InitializeAsync();
m_streamSource = winrt::MediaStreamSource(m_videoDescriptor, winrt::AudioStreamDescriptor(m_audioGenerator->GetEncodingProperties()));
}
else {
m_streamSource = winrt::MediaStreamSource(m_videoDescriptor);
}
m_streamSource.BufferTime(std::chrono::seconds(0));
m_streamSource.Starting({ this, &VideoRecordingSession::OnMediaStreamSourceStarting });
m_streamSource.SampleRequested({ this, &VideoRecordingSession::OnMediaStreamSourceSampleRequested });
// Create our transcoder
m_transcoder = winrt::MediaTranscoder();
m_transcoder.HardwareAccelerationEnabled(true);
auto self = shared_from_this();
// Start encoding
auto transcode = co_await m_transcoder.PrepareMediaStreamSourceTranscodeAsync(m_streamSource, m_stream, m_encodingProfile);
co_await transcode.TranscodeAsync();
}
co_return;
}
//----------------------------------------------------------------------------
//
// VideoRecordingSession::Close
//
//----------------------------------------------------------------------------
void VideoRecordingSession::Close()
{
auto expected = false;
if (m_closed.compare_exchange_strong(expected, true))
{
expected = true;
if (!m_isRecording.compare_exchange_strong(expected, false))
{
CloseInternal();
}
else
{
m_frameWait->StopCapture();
}
}
}
//----------------------------------------------------------------------------
//
// VideoRecordingSession::CloseInternal
//
//----------------------------------------------------------------------------
void VideoRecordingSession::CloseInternal()
{
if(m_audioGenerator) {
m_audioGenerator->Stop();
}
m_frameWait->StopCapture();
m_itemClosed.revoke();
}
//----------------------------------------------------------------------------
//
// VideoRecordingSession::OnMediaStreamSourceStarting
//
//----------------------------------------------------------------------------
void VideoRecordingSession::OnMediaStreamSourceStarting(
winrt::MediaStreamSource const&,
winrt::MediaStreamSourceStartingEventArgs const& args)
{
auto frame = m_frameWait->TryGetNextFrame();
if (frame) {
args.Request().SetActualStartPosition(frame->SystemRelativeTime);
if (m_audioGenerator) {
m_audioGenerator->Start();
}
}
}
//----------------------------------------------------------------------------
//
// VideoRecordingSession::Create
//
//----------------------------------------------------------------------------
std::shared_ptr<VideoRecordingSession> VideoRecordingSession::Create(
winrt::IDirect3DDevice const& device,
winrt::GraphicsCaptureItem const& item,
RECT const& crop,
uint32_t frameRate,
bool captureAudio,
winrt::Streams::IRandomAccessStream const& stream)
{
return std::shared_ptr<VideoRecordingSession>(new VideoRecordingSession(device, item, crop, frameRate, captureAudio, stream));
}
//----------------------------------------------------------------------------
//
// VideoRecordingSession::OnMediaStreamSourceSampleRequested
//
//----------------------------------------------------------------------------
void VideoRecordingSession::OnMediaStreamSourceSampleRequested(
winrt::MediaStreamSource const&,
winrt::MediaStreamSourceSampleRequestedEventArgs const& args)
{
auto request = args.Request();
auto streamDescriptor = request.StreamDescriptor();
if (auto videoStreamDescriptor = streamDescriptor.try_as<winrt::VideoStreamDescriptor>())
{
if (auto frame = m_frameWait->TryGetNextFrame())
{
try
{
auto timeStamp = frame->SystemRelativeTime;
auto contentSize = frame->ContentSize;
auto frameTexture = GetDXGIInterfaceFromObject<ID3D11Texture2D>(frame->FrameTexture);
D3D11_TEXTURE2D_DESC desc = {};
frameTexture->GetDesc(&desc);
winrt::com_ptr<ID3D11Texture2D> backBuffer;
winrt::check_hresult(m_previewSwapChain->GetBuffer(0, winrt::guid_of<ID3D11Texture2D>(), backBuffer.put_void()));
// Use the smaller of the crop size or content size. The content
// size can change while recording, for example by resizing the
// window. This ensures that only valid content is copied.
auto width = min(m_rcCrop.right - m_rcCrop.left, contentSize.Width);
auto height = min(m_rcCrop.bottom - m_rcCrop.top, contentSize.Height);
// Set the content region to copy and clamp the coordinates to the
// texture surface.
D3D11_BOX region = {};
region.left = std::clamp(m_rcCrop.left, static_cast<LONG>(0), static_cast<LONG>(desc.Width));
region.right = std::clamp(m_rcCrop.left + width, static_cast<LONG>(0), static_cast<LONG>(desc.Width));
region.top = std::clamp(m_rcCrop.top, static_cast<LONG>(0), static_cast<LONG>(desc.Height));
region.bottom = std::clamp(m_rcCrop.top + height, static_cast<LONG>(0), static_cast<LONG>(desc.Height));
region.back = 1;
m_d3dContext->ClearRenderTargetView(m_renderTargetView.get(), CLEARCOLOR);
m_d3dContext->CopySubresourceRegion(
backBuffer.get(),
0,
0, 0, 0,
frameTexture.get(),
0,
&region);
desc = {};
backBuffer->GetDesc(&desc);
desc.Usage = D3D11_USAGE_DEFAULT;
desc.BindFlags = D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET;
desc.CPUAccessFlags = 0;
desc.MiscFlags = 0;
winrt::com_ptr<ID3D11Texture2D> sampleTexture;
winrt::check_hresult(m_d3dDevice->CreateTexture2D(&desc, nullptr, sampleTexture.put()));
m_d3dContext->CopyResource(sampleTexture.get(), backBuffer.get());
auto dxgiSurface = sampleTexture.as<IDXGISurface>();
auto sampleSurface = CreateDirect3DSurface(dxgiSurface.get());
DXGI_PRESENT_PARAMETERS presentParameters{};
winrt::check_hresult(m_previewSwapChain->Present1(0, 0, &presentParameters));
auto sample = winrt::MediaStreamSample::CreateFromDirect3D11Surface(sampleSurface, timeStamp);
request.Sample(sample);
}
catch (winrt::hresult_error const& error)
{
OutputDebugStringW(error.message().c_str());
request.Sample(nullptr);
CloseInternal();
return;
}
}
else
{
request.Sample(nullptr);
CloseInternal();
}
}
else if (auto audioStreamDescriptor = streamDescriptor.try_as<winrt::AudioStreamDescriptor>())
{
if (auto sample = m_audioGenerator->TryGetNextSample())
{
request.Sample(sample.value());
}
else
{
request.Sample(nullptr);
}
}
}

View File

@ -0,0 +1,71 @@
//==============================================================================
//
// Zoomit
// Sysinternals - www.sysinternals.com
//
// Video capture code derived from https://github.com/robmikh/capturevideosample
//
//==============================================================================
#pragma once
#include "CaptureFrameWait.h"
#include "AudioSampleGenerator.h"
#include <d3d11_4.h>
class VideoRecordingSession : public std::enable_shared_from_this<VideoRecordingSession>
{
public:
[[nodiscard]] static std::shared_ptr<VideoRecordingSession> Create(
winrt::Direct3D11::IDirect3DDevice const& device,
winrt::GraphicsCaptureItem const& item,
RECT const& cropRect,
uint32_t frameRate,
bool captureAudio,
winrt::Streams::IRandomAccessStream const& stream);
~VideoRecordingSession();
winrt::IAsyncAction StartAsync();
void EnableCursorCapture(bool enable = true) { m_frameWait->EnableCursorCapture(enable); }
void Close();
private:
VideoRecordingSession(
winrt::Direct3D11::IDirect3DDevice const& device,
winrt::Capture::GraphicsCaptureItem const& item,
RECT const cropRect,
uint32_t frameRate,
bool captureAudio,
winrt::Streams::IRandomAccessStream const& stream);
void CloseInternal();
void OnMediaStreamSourceStarting(
winrt::MediaStreamSource const& sender,
winrt::MediaStreamSourceStartingEventArgs const& args);
void OnMediaStreamSourceSampleRequested(
winrt::MediaStreamSource const& sender,
winrt::MediaStreamSourceSampleRequestedEventArgs const& args);
private:
winrt::Direct3D11::IDirect3DDevice m_device{ nullptr };
winrt::com_ptr<ID3D11Device> m_d3dDevice;
winrt::com_ptr<ID3D11DeviceContext> m_d3dContext;
RECT m_rcCrop;
winrt::GraphicsCaptureItem m_item{ nullptr };
winrt::GraphicsCaptureItem::Closed_revoker m_itemClosed;
std::shared_ptr<CaptureFrameWait> m_frameWait;
winrt::Streams::IRandomAccessStream m_stream{ nullptr };
winrt::MediaEncodingProfile m_encodingProfile{ nullptr };
winrt::VideoStreamDescriptor m_videoDescriptor{ nullptr };
winrt::MediaStreamSource m_streamSource{ nullptr };
winrt::MediaTranscoder m_transcoder{ nullptr };
std::unique_ptr<AudioSampleGenerator> m_audioGenerator;
winrt::com_ptr<IDXGISwapChain1> m_previewSwapChain;
winrt::com_ptr<ID3D11RenderTargetView> m_renderTargetView;
std::atomic<bool> m_isRecording = false;
std::atomic<bool> m_closed = false;
};

View File

@ -0,0 +1,218 @@
//============================================================================
//
// Zoomit
// Copyright (C) Mark Russinovich
// Sysinternals - www.sysinternals.com
//
// Screen zoom and annotation tool.
//
//============================================================================
// Ignore getversion deprecation warning
#pragma warning( disable: 4996 )
typedef HRESULT (__stdcall * type_pEnableThemeDialogTexture)(
HWND hwnd,
DWORD dwFlags
);
type_pEnableThemeDialogTexture pEnableThemeDialogTexture;
// For testing anti-aliased bitmap stretching
#define SCALE_GDIPLUS 0
#define SCALE_HALFTONE 0
// sent in mouse message when coming from tablet pen
#define MI_WP_SIGNATURE 0xFF515700
#define ZOOMLEVEL_MIN 1
#define ZOOMLEVEL_INIT 2
#define ZOOMLEVEL_STEPIN ((float) 1.1)
#define ZOOMLEVEL_STEPOUT ((float) 0.8)
#define ZOOMLEVEL_MAX 32
#define ZOOMLEVEL_STEPTIME 20
#define LIVEZOOM_MOVEREGIONS 8
#define WIN7_VERSION 0x106
#define WIN10_VERSION 0x206
// Time that we'll cache live zoom window to avoid flicker
// of live zooming on Vista/ws2k8
#define LIVEZOOM_WINDOW_TIMEOUT 2*3600*1000
#define MAX_UNDO_HISTORY 32
#define PEN_WIDTH 5
#define MIN_PENWIDTH 2
#define MAX_PENWIDTH 40
#define MAX_LIVEPENWIDTH 600
#define APPNAME L"ZoomIt"
#define WM_USER_TRAYACTIVATE WM_USER+100
#define WM_USER_TYPINGOFF WM_USER+101
#define WM_USER_GETZOOMLEVEL WM_USER+102
#define WM_USER_GETSOURCERECT WM_USER+103
#define WM_USER_SETZOOM WM_USER+104
#define WM_USER_STOPRECORDING WM_USER+105
#define WM_USER_SAVECURSOR WM_USER+106
#define WM_USER_RESTORECURSOR WM_USER+107
#define WM_USER_MAGNIFYCURSOR WM_USER+108
#define WM_USER_EXITMODE WM_USER+109
typedef struct _TYPED_KEY {
RECT rc;
struct _TYPED_KEY *Next;
} TYPED_KEY, *PTYPED_KEY;
typedef struct _DRAW_UNDO {
HDC hDc;
HBITMAP hBitmap;
struct _DRAW_UNDO *Next;
} DRAW_UNDO, *PDRAW_UNDO;
typedef struct {
TCHAR TabTitle[64];
HWND hPage;
} OPTION_TABS, *POPTIONS_TABS;
#define COLOR_RED RGB(255, 0, 0)
#define COLOR_GREEN RGB(0, 255, 0)
#define COLOR_BLUE RGB(0, 0, 255)
#define COLOR_ORANGE RGB(255,128,0)
#define COLOR_YELLOW RGB(255, 255, 0 )
#define COLOR_PINK RGB(255,128,255)
#define COLOR_BLUR RGB(112,112,112)
#define DRAW_RECTANGLE 1
#define DRAW_ELLIPSE 2
#define DRAW_LINE 3
#define DRAW_ARROW 4
#define SHALLOW_ZOOM 1
#define SHALLOW_DESTROY 2
#define PEN_COLOR_HIGHLIGHT(Pencolor) (Pencolor >> 24) != 0xFF
typedef BOOL (__stdcall *type_pGetMonitorInfo)(
HMONITOR hMonitor, // handle to display monitor
LPMONITORINFO lpmi // display monitor information
);
typedef HMONITOR (__stdcall *type_MonitorFromPoint)(
POINT pt, // point
DWORD dwFlags // determine return value
);
typedef HRESULT (__stdcall *type_pSHAutoComplete)(
HWND hwndEdit,
DWORD dwFlags
);
// DPI awareness
typedef BOOL (__stdcall *type_pSetProcessDPIAware)(void);
// Live zoom
typedef BOOL (__stdcall *type_pMagSetWindowSource)(HWND hwnd,
RECT rect
);
typedef BOOL (__stdcall *type_pMagSetWindowTransform)(HWND hwnd,
PMAGTRANSFORM pTransform
);
typedef BOOL(__stdcall* type_pMagSetFullscreenTransform)(
float magLevel,
int xOffset,
int yOffset
);
typedef BOOL(__stdcall* type_pMagSetInputTransform)(
BOOL fEnabled,
const LPRECT pRectSource,
const LPRECT pRectDest
);
typedef BOOL (__stdcall *type_pMagShowSystemCursor)(
BOOL fShowCursor
);
typedef BOOL(__stdcall *type_pMagSetWindowFilterList)(
HWND hwnd,
DWORD dwFilterMode,
int count,
HWND* pHWND
);
typedef BOOL (__stdcall *type_pMagInitialize)(VOID);
typedef BOOL(__stdcall *type_pGetPointerType)(
_In_ UINT32 pointerId,
_Out_ POINTER_INPUT_TYPE *pointerType
);
typedef BOOL(__stdcall *type_pGetPointerPenInfo)(
_In_ UINT32 pointerId,
_Out_ POINTER_PEN_INFO *penInfo
);
typedef HRESULT (__stdcall *type_pDwmIsCompositionEnabled)(
BOOL *pfEnabled
);
// opacity
typedef BOOL (__stdcall *type_pSetLayeredWindowAttributes)(
HWND hwnd, // handle to the layered window
COLORREF crKey, // specifies the color key
BYTE bAlpha, // value for the blend function
DWORD dwFlags // action
);
// Presentation mode check
typedef HRESULT (__stdcall *type_pSHQueryUserNotificationState)(
QUERY_USER_NOTIFICATION_STATE *pquns
);
typedef BOOL (__stdcall *type_pSystemParametersInfoForDpi)(
UINT uiAction,
UINT uiParam,
PVOID pvParam,
UINT fWinIni,
UINT dpi
);
typedef UINT (__stdcall *type_pGetDpiForWindow)(
HWND hwnd
);
class CGraphicsInit
{
ULONG_PTR m_Token;
public:
CGraphicsInit()
{
Gdiplus::GdiplusStartupOutput startupOut;
Gdiplus::GdiplusStartupInput startupIn;
Gdiplus::GdiplusStartup( &m_Token, &startupIn, &startupOut );
}
~CGraphicsInit()
{
Gdiplus::GdiplusShutdown( m_Token );
}
};
// Direct3D
typedef HRESULT (__stdcall *type_pCreateDirect3D11DeviceFromDXGIDevice)(
IDXGIDevice *dxgiDevice,
IInspectable **graphicsDevice
);
typedef HRESULT (__stdcall *type_pCreateDirect3D11SurfaceFromDXGISurface)(
IDXGISurface *dgxiSurface,
IInspectable **graphicsSurface
);
typedef HRESULT (__stdcall *type_pD3D11CreateDevice)(
IDXGIAdapter *pAdapter,
D3D_DRIVER_TYPE DriverType,
HMODULE Software,
UINT Flags,
const D3D_FEATURE_LEVEL *pFeatureLevels,
UINT FeatureLevels,
UINT SDKVersion,
ID3D11Device **ppDevice,
D3D_FEATURE_LEVEL *pFeatureLevel,
ID3D11DeviceContext **ppImmediateContext
);

View File

@ -0,0 +1 @@
<Configurations active="Default"><Configuration name="Default"><Command val=""></Command><RunMode val="a host path through a shared folder"></RunMode><ShareFolders val=""></ShareFolders><RemoteDebugMonitor val="C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\Remote Debugger\x86\msvsmon.exe"></RemoteDebugMonitor><MonitorName val="VMDebug"></MonitorName><VirtualMachine val=""></VirtualMachine><StartMode val="No"></StartMode><TerminationMode val="No operation"></TerminationMode><CopyFiles val=""></CopyFiles><PreCommandLine val=""></PreCommandLine><PostCommandLine val=""></PostCommandLine></Configuration></Configurations>

View File

@ -0,0 +1,476 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (United States) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"#include ""binres.rc""\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Cursor
//
NULLCURSOR CURSOR "cursor1.cur"
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
APPICON ICON "appicon.ico"
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 8,1,0,0
PRODUCTVERSION 8,1,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "Sysinternals - www.sysinternals.com"
VALUE "FileDescription", "Sysinternals Screen Magnifier"
VALUE "FileVersion", "8.01"
VALUE "InternalName", "ZoomIt"
VALUE "LegalCopyright", "Copyright © 2006-2024 Mark Russinovich"
VALUE "OriginalFilename", "ZoomIt.exe"
VALUE "ProductName", "Sysinternals ZoomIt"
VALUE "ProductVersion", "8.01"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
OPTIONS DIALOGEX 0, 0, 279, 325
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CLIPSIBLINGS | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_CONTROLPARENT
CAPTION "ZoomIt - Sysinternals: www.sysinternals.com"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
DEFPUSHBUTTON "OK",IDOK,166,306,50,14
PUSHBUTTON "Cancel",IDCANCEL,223,306,50,14
LTEXT "ZoomIt v8.01",IDC_TITLE,42,7,73,10
LTEXT "Copyright © 2006-2024 Mark Russinovich",IDC_STATIC,42,17,166,8
CONTROL "<a HREF=""https://www.sysinternals.com"">Sysinternals - www.sysinternals.com</a>",IDC_LINK,
"SysLink",WS_TABSTOP,42,26,150,9
ICON "APPICON",IDC_STATIC,12,9,20,20
CONTROL "Show tray icon",IDC_SHOWTRAYICON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,295,105,10
CONTROL "",IDC_TAB,"SysTabControl32",TCS_MULTILINE | WS_TABSTOP,8,46,265,245
CONTROL "Run ZoomIt when Windows starts",IDC_AUTOSTART,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,309,122,10
END
ADVANCEDBREAK DIALOGEX 0, 0, 209, 219
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Advanced Break Options"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
CONTROL "Play Sound on Expiration:",IDC_CHECKSOUNDFILE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,3,11,98,10,WS_EX_RIGHT
EDITTEXT IDC_SOUNDFILE,61,38,125,12,ES_AUTOHSCROLL | ES_READONLY
PUSHBUTTON "&...",IDC_SOUNDBROWSE,187,38,13,11
COMBOBOX IDC_OPACITY,62,58,38,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "",IDC_TIMERPOS1,"Button",BS_AUTORADIOBUTTON,63,78,10,10
CONTROL "",IDC_TIMERPOS2,"Button",BS_AUTORADIOBUTTON,79,78,10,10
CONTROL "",IDC_TIMERPOS3,"Button",BS_AUTORADIOBUTTON,97,78,10,10
CONTROL "",IDC_TIMERPOS4,"Button",BS_AUTORADIOBUTTON,63,93,10,10
CONTROL "",IDC_TIMERPOS5,"Button",BS_AUTORADIOBUTTON,79,93,10,10
CONTROL "",IDC_TIMERPOS6,"Button",BS_AUTORADIOBUTTON,97,93,10,10
CONTROL "",IDC_TIMERPOS7,"Button",BS_AUTORADIOBUTTON,63,108,10,10
CONTROL "",IDC_TIMERPOS8,"Button",BS_AUTORADIOBUTTON,79,108,10,10
CONTROL "",IDC_TIMERPOS9,"Button",BS_AUTORADIOBUTTON,97,108,10,10
CONTROL "Show background bitmap:",IDC_CHECKBACKGROUNDFILE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,3,122,99,10,WS_EX_RIGHT
CONTROL "Use faded desktop as background",IDC_STATIC_DESKTOPBACKGROUND,
"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,46,135,125,10
CONTROL "Use image file as background",IDC_STATIC_BACKROUNDFILE,
"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,46,149,109,10
EDITTEXT IDC_BACKROUNDFILE,62,164,125,12,ES_AUTOHSCROLL | ES_READONLY
PUSHBUTTON "&...",IDC_BACKGROUNDBROWSE,188,164,13,11
CONTROL "Scale to screen:",IDC_CHECKBACKGROUNDSTRETCH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,58,180,67,10,WS_EX_RIGHT
DEFPUSHBUTTON "OK",IDOK,97,201,50,14
PUSHBUTTON "Cancel",IDCANCEL,150,201,50,14
LTEXT "Alarm Sound File:",IDC_STATIC_SOUNDFILE,61,26,56,8
LTEXT "Timer Opacity:",IDC_STATIC,8,59,48,8
LTEXT "Timer Position:",IDC_STATIC,8,77,48,8
CONTROL "",IDC_STATIC,"Static",SS_BLACKFRAME | SS_SUNKEN,7,196,193,1,WS_EX_CLIENTEDGE
END
ZOOM DIALOGEX 0, 0, 260, 158
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_CLIPSIBLINGS | WS_SYSMENU
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
CONTROL "",IDC_HOTKEY,"msctls_hotkey32",WS_BORDER | WS_TABSTOP,59,57,80,12
LTEXT "After toggling ZoomIt you can zoom in with the mouse wheel or up and down arrow keys. Exit zoom mode with Escape or by pressing the right mouse button.",IDC_STATIC,7,6,246,26
LTEXT "Zoom Toggle:",IDC_STATIC,7,59,51,8
CONTROL "",IDC_ZOOMSLIDER,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,53,104,150,15,WS_EX_TRANSPARENT
LTEXT "Specify the initial level of magnification when zooming in:",IDC_STATIC,7,91,215,10
LTEXT "1.25",IDC_STATIC,52,122,16,8
LTEXT "1.5",IDC_STATIC,82,122,12,8
LTEXT "1.75",IDC_STATIC,108,122,16,8
LTEXT "2.0",IDC_STATIC,138,122,12,8
LTEXT "3.0",IDC_STATIC,164,122,12,8
LTEXT "4.0",IDC_STATIC,190,122,12,8
CONTROL "Animate zoom in and zoom out:",IDC_ANIMATE_ZOOM,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,7,74,116,10
LTEXT "Copy a zoomed screen with Ctrl+C or save it by typing Ctrl+S. Crop the copy or save region by entering Ctrl+Shift instead of Ctrl.",IDC_STATIC,7,34,246,17
END
DRAW DIALOGEX 0, 0, 260, 228
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_SYSMENU
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
LTEXT "Once zoomed, toggle drawing mode by pressing the left mouse button. Undo with Ctrl+Z and all drawing by pressing E. Center the cursor with the space bar. Exit drawing mode by pressing the right mouse button.",IDC_STATIC,7,7,246,24
LTEXT "Pen Control ",IDC_PENCONTROL,7,38,40,8
LTEXT "Change the pen width by pressing left Ctrl and using the mouse wheel or the up and down arrow keys.",IDC_STATIC,19,48,233,16
LTEXT "Colors",IDC_COLORS,7,70,21,8
LTEXT "Change the pen color by pressing R (red), G (green), B (blue),\nO (orange), Y (yellow) or P (pink).",IDC_STATIC,19,80,233,16
LTEXT "Highlight and Blur",IDC_HIGHLIGHTANDBLUR,7,102,58,8
LTEXT "Hold Shift while pressing a color key for a translucent highlighter color. Press X for blur or Shift+X for a stronger blur.",IDC_STATIC,19,113,233,16
LTEXT "Shapes",IDC_SHAPES,7,134,23,8
LTEXT "Draw a line by holding down the Shift key, a rectangle with the Ctrl key, an ellipse with the Tab key and an arrow with Shift+Ctrl.",IDC_STATIC,19,144,233,16
LTEXT "Screen",IDC_SCREEN,7,166,22,8
LTEXT "Clear the screen for a sketch pad by pressing W (white) or K (black). Copy a zoomed screen with Ctrl+C or save it by typing Ctrl+S. Crop the copy or save region by entering Ctrl+Shift instead of Ctrl.",IDC_STATIC,19,176,233,24
CONTROL "",IDC_DRAWHOTKEY,"msctls_hotkey32",WS_BORDER | WS_TABSTOP,73,207,80,12
LTEXT "Draw w/out Zoom:",IDC_STATIC,7,210,63,11
END
TYPE DIALOGEX 0, 0, 260, 104
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_SYSMENU
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
LTEXT "Once in drawing mode, type 't' to enter typing mode or shift+'t' to enter typing mode with right-aligned input. Exit typing mode by pressing escape or the left mouse button. Use the mouse wheel or up and down arrow keys to change the font size.",IDC_STATIC,7,7,246,32
LTEXT "The text color is the current drawing color.",IDC_STATIC,7,47,211,9
PUSHBUTTON "&Font",IDC_FONT,112,69,41,14
GROUPBOX "Text Font",IDC_TEXTFONT,8,61,99,28
END
BREAK DIALOGEX 0, 0, 260, 123
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_SYSMENU
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
CONTROL "",IDC_BREAKHOTKEY,"msctls_hotkey32",WS_BORDER | WS_TABSTOP,52,67,80,12
EDITTEXT IDC_TIMER,31,86,31,13,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER
CONTROL "",IDC_SPINTIMER,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,45,86,11,12
LTEXT "minutes",IDC_STATIC,67,88,25,8
PUSHBUTTON "&Advanced",IDC_ADVANCEDBREAK,212,102,41,14
LTEXT "Enter timer mode by using the ZoomIt tray icon's Break menu item. Increase and decrease time with the arrow keys. If you Alt-Tab away from the timer window, reactivate it by left-clicking on the ZoomIt tray icon. Exit timer mode with Escape. ",IDC_STATIC,7,7,246,33
LTEXT "Start Timer:",IDC_STATIC,7,70,39,8
LTEXT "Timer:",IDC_STATIC,7,88,20,8
LTEXT "Change the break timer color using the same keys that the drawing color. The break timer font is the same as text font.",IDC_STATIC,7,45,219,20
CONTROL "Show Time Elapsed After Expiration:",IDC_CHECK_SHOWEXPIRED,
"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,8,104,132,10
END
1543 DIALOGEX 100, 50, 216, 131
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "ZoomIt Font"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
LTEXT "&Font:",1088,6,0,40,9
COMBOBOX 1136,6,10,94,64,CBS_SIMPLE | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | CBS_DISABLENOSCROLL | WS_VSCROLL | WS_TABSTOP
LTEXT "Font St&yle:",1089,108,0,44,9
COMBOBOX 1137,108,10,64,64,CBS_SIMPLE | CBS_DISABLENOSCROLL | WS_VSCROLL | WS_TABSTOP
LTEXT "&Size:",1090,179,0,30,9
COMBOBOX 1138,179,10,32,64,CBS_SIMPLE | CBS_OWNERDRAWFIXED | CBS_SORT | CBS_HASSTRINGS | CBS_DISABLENOSCROLL | WS_VSCROLL | WS_TABSTOP
DEFPUSHBUTTON "OK",IDOK,166,94,45,14,WS_GROUP
PUSHBUTTON "Cancel",IDCANCEL,166,111,45,14,WS_GROUP
GROUPBOX "Sample",1073,7,75,143,51,WS_GROUP
CTEXT "AaBbYyZz",1092,16,88,127,31,SS_NOPREFIX | NOT WS_VISIBLE
END
LIVEZOOM DIALOGEX 0, 0, 260, 108
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_SYSMENU
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
CONTROL "",IDC_LIVEHOTKEY,"msctls_hotkey32",WS_BORDER | WS_TABSTOP,69,76,80,12
LTEXT "LiveZoom mode is supported on Windows 7 and higher where window updates show while zoomed. ",IDC_STATIC,7,7,246,18
LTEXT "LiveZoom Toggle:",IDC_STATIC,7,79,62,8
LTEXT "To enter and exit LiveZoom, enter the hotkey specified below.",IDC_STATIC,7,63,218,13
LTEXT "Note that in LiveZoom you must use Ctrl+Up and Ctrl+Down to control the zoom level. To enter drawing mode, use the standard zoom-without-draw hotkey and then escape to go back to LiveZoom.",IDC_STATIC,7,29,246,34
END
RECORD DIALOGEX 0, 0, 260, 169
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_SYSMENU
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
CONTROL "",IDC_RECORDHOTKEY,"msctls_hotkey32",WS_BORDER | WS_TABSTOP,61,96,80,12
LTEXT "Record Toggle:",IDC_STATIC,7,98,54,8
LTEXT "Record video of the unzoomed live screen or a static zoomed session by entering the recording hot key and finish the recording by entering it again. ",IDC_STATIC,7,7,246,28
LTEXT "Note: Recording is only available on Windows 10 (version 1903) and higher.",IDC_STATIC,7,77,246,19
LTEXT "Scaling:",IDC_STATIC,30,115,26,8
COMBOBOX IDC_RECORDSCALING,61,114,26,30,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | CBS_OEMCONVERT | CBS_SORT | WS_VSCROLL | WS_TABSTOP
LTEXT "Frame Rate:",IDC_STATIC,119,115,44,8,NOT WS_VISIBLE
COMBOBOX IDC_RECORDFRAMERATE,166,114,42,30,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | CBS_OEMCONVERT | CBS_SORT | NOT WS_VISIBLE | WS_VSCROLL | WS_TABSTOP
LTEXT "To crop the portion of the screen that will be recorded, enter the hotkey with the Shift key in the opposite mode. ",IDC_STATIC,7,32,246,19
LTEXT "To record a specific window, enter the hotkey with the Alt key in the opposite mode.",IDC_STATIC,7,55,246,19
CONTROL "&Capture audio input:",IDC_CAPTUREAUDIO,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,7,137,83,10
COMBOBOX IDC_MICROPHONE,81,152,172,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
LTEXT "Microphone:",IDC_STATIC,32,154,47,8
END
SNIP DIALOGEX 0, 0, 260, 68
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_CLIPSIBLINGS | WS_SYSMENU
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
CONTROL "",IDC_SNIPHOTKEY,"msctls_hotkey32",WS_BORDER | WS_TABSTOP,55,32,80,12
LTEXT "Snip Toggle:",IDC_STATIC,7,33,45,8
LTEXT "Copy a region of the screen to the clipboard or enter the hotkey with the Shift key in the opposite mode to save it to a file. ",IDC_STATIC,7,7,246,19
END
DEMOTYPE DIALOGEX 0, 0, 259, 249
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_CLIPSIBLINGS | WS_SYSMENU
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
CONTROL "",IDC_DEMOTYPEHOTKEY,"msctls_hotkey32",WS_BORDER | WS_TABSTOP,74,154,80,12
LTEXT "DemoType toggle:",IDC_STATIC,7,157,63,8
PUSHBUTTON "&...",IDC_DEMOTYPEBROWSE,231,137,16,13
CONTROL "",IDC_DEMOTYPESPEEDSLIDER,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,52,202,150,11,WS_EX_TRANSPARENT
CONTROL "Drive input with typing:",IDC_DEMOTYPEUSERDRIVEN,"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,7,173,88,10
LTEXT "DemoType typing speed:",IDC_STATIC,7,189,215,10
LTEXT "Slow",IDC_DEMOTYPESTATIC1,51,213,18,8
LTEXT "Fast",IDC_DEMOTYPESTATIC2,186,213,17,8
EDITTEXT IDC_DEMOTYPEFILE,44,137,187,12,ES_AUTOHSCROLL | ES_READONLY
LTEXT "Input file:",IDC_STATIC,7,139,32,8
LTEXT "When you reach the end of the file, ZoomIt will reload the file and start at the beggining. Enter the hotkey with the Shift key in the opposite mode to step back to the last [end].",IDC_STATIC,7,108,248,24
LTEXT "DemoType has ZoomIt type text specified in the input file when you enter the DemoType toggle. Simply separate snippets with the [end] keyword, or you can insert text from the clipboard if it is prefixed with the [start].",IDC_STATIC,7,7,248,24
LTEXT " - Insert pauses with the [pause:n] keyword where 'n' is seconds. ",IDC_STATIC,19,34,212,11
LTEXT "You can have ZoomIt send text automatically, or select the option to drive input with typing. ZoomIt will block keyboard input while sending output.",IDC_STATIC,7,68,248,16
LTEXT "When driving input, hit the space bar to unblock keyboard input at the end of a snippet. In auto mode, control will be returned upon completion.",IDC_STATIC,7,88,248,16
LTEXT "- Send text via the clipboard with [paste] and [/paste]. ",IDC_STATIC,23,45,178,8
LTEXT "- Send keystrokes with [enter], [up], [down], [left], and [right].",IDC_STATIC,23,56,211,8
END
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO
BEGIN
"OPTIONS", DIALOG
BEGIN
RIGHTMARGIN, 273
BOTTOMMARGIN, 320
END
"ADVANCEDBREAK", DIALOG
BEGIN
RIGHTMARGIN, 207
BOTTOMMARGIN, 215
END
"ZOOM", DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 253
TOPMARGIN, 7
BOTTOMMARGIN, 151
END
"DRAW", DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 253
TOPMARGIN, 7
BOTTOMMARGIN, 221
END
"TYPE", DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 253
TOPMARGIN, 7
BOTTOMMARGIN, 97
END
"BREAK", DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 253
TOPMARGIN, 7
BOTTOMMARGIN, 116
END
1543, DIALOG
BEGIN
RIGHTMARGIN, 211
BOTTOMMARGIN, 127
END
"LIVEZOOM", DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 253
TOPMARGIN, 7
BOTTOMMARGIN, 101
END
"RECORD", DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 253
TOPMARGIN, 7
BOTTOMMARGIN, 164
END
"SNIP", DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 253
TOPMARGIN, 7
BOTTOMMARGIN, 61
END
"DEMOTYPE", DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 255
TOPMARGIN, 7
BOTTOMMARGIN, 205
END
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Accelerator
//
ACCELERATORS ACCELERATORS
BEGIN
"C", IDC_COPY, VIRTKEY, CONTROL, NOINVERT
"S", IDC_SAVE, VIRTKEY, CONTROL, NOINVERT
"C", IDC_COPYCROP, VIRTKEY, SHIFT, CONTROL, NOINVERT
"S", IDC_SAVECROP, VIRTKEY, SHIFT, CONTROL, NOINVERT
END
/////////////////////////////////////////////////////////////////////////////
//
// AFX_DIALOG_LAYOUT
//
OPTIONS AFX_DIALOG_LAYOUT
BEGIN
0
END
LIVEZOOM AFX_DIALOG_LAYOUT
BEGIN
0
END
DRAW AFX_DIALOG_LAYOUT
BEGIN
0
END
RECORD AFX_DIALOG_LAYOUT
BEGIN
0
END
TYPE AFX_DIALOG_LAYOUT
BEGIN
0
END
ZOOM AFX_DIALOG_LAYOUT
BEGIN
0
END
SNIP AFX_DIALOG_LAYOUT
BEGIN
0
END
BREAK AFX_DIALOG_LAYOUT
BEGIN
0
END
DEMOTYPE AFX_DIALOG_LAYOUT
BEGIN
0
END
#endif // English (United States) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
#include "binres.rc"
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View File

@ -0,0 +1,37 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28307.271
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZoomIt", "ZoomIt.vcxproj", "{0A84F764-3A88-44CD-AA96-41BDBD48627B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM64 = Debug|ARM64
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|ARM64 = Release|ARM64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0A84F764-3A88-44CD-AA96-41BDBD48627B}.Debug|ARM64.ActiveCfg = Debug|ARM64
{0A84F764-3A88-44CD-AA96-41BDBD48627B}.Debug|ARM64.Build.0 = Debug|ARM64
{0A84F764-3A88-44CD-AA96-41BDBD48627B}.Debug|Win32.ActiveCfg = Debug|Win32
{0A84F764-3A88-44CD-AA96-41BDBD48627B}.Debug|Win32.Build.0 = Debug|Win32
{0A84F764-3A88-44CD-AA96-41BDBD48627B}.Debug|x64.ActiveCfg = Debug|x64
{0A84F764-3A88-44CD-AA96-41BDBD48627B}.Debug|x64.Build.0 = Debug|x64
{0A84F764-3A88-44CD-AA96-41BDBD48627B}.Release|ARM64.ActiveCfg = Release|ARM64
{0A84F764-3A88-44CD-AA96-41BDBD48627B}.Release|ARM64.Build.0 = Release|ARM64
{0A84F764-3A88-44CD-AA96-41BDBD48627B}.Release|Win32.ActiveCfg = Release|Win32
{0A84F764-3A88-44CD-AA96-41BDBD48627B}.Release|Win32.Build.0 = Release|Win32
{0A84F764-3A88-44CD-AA96-41BDBD48627B}.Release|x64.ActiveCfg = Release|x64
{0A84F764-3A88-44CD-AA96-41BDBD48627B}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9DD749A9-1354-48BC-8392-E01440AE3714}
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,381 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="packages\Microsoft.Windows.CppWinRT.2.0.230225.1\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('packages\Microsoft.Windows.CppWinRT.2.0.230225.1\build\native\Microsoft.Windows.CppWinRT.props')" />
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{0A84F764-3A88-44CD-AA96-41BDBD48627B}</ProjectGuid>
<RootNamespace>ZoomIt</RootNamespace>
<CppWinRTRootNamespaceAutoMerge>true</CppWinRTRootNamespaceAutoMerge>
<CppWinRTOptimized>true</CppWinRTOptimized>
<CppWinRTGenerateWindowsMetadata>true</CppWinRTGenerateWindowsMetadata>
</PropertyGroup>
<Import Project="modules\Build\Sysinternals.Cpp.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<UseOfMfc>false</UseOfMfc>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<UseOfMfc>false</UseOfMfc>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<UseOfMfc>false</UseOfMfc>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
<UseOfMfc>false</UseOfMfc>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<UseOfMfc>false</UseOfMfc>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
<UseOfMfc>false</UseOfMfc>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<GenerateManifest>false</GenerateManifest>
<InterPlatformDir>$(ProjectDir)$(Configuration)\InterPlatform\</InterPlatformDir>
<SignTarget>true</SignTarget>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<GenerateManifest>false</GenerateManifest>
<InterPlatformDir>$(ProjectDir)$(Configuration)\InterPlatform\</InterPlatformDir>
<BinaryDependencyName>RCZOOMIT</BinaryDependencyName>
<SignTarget>true</SignTarget>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<GenerateManifest>false</GenerateManifest>
<BinaryDependencyName>RCZOOMIT</BinaryDependencyName>
<SignTarget>true</SignTarget>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<GenerateManifest>false</GenerateManifest>
<InterPlatformDir>$(ProjectDir)$(Configuration)\InterPlatform\</InterPlatformDir>
<SignTarget>true</SignTarget>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<GenerateManifest>false</GenerateManifest>
<InterPlatformDir>$(ProjectDir)$(Configuration)\InterPlatform\</InterPlatformDir>
<BinaryDependencyName>RCZOOMIT</BinaryDependencyName>
<SignTarget>true</SignTarget>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<GenerateManifest>false</GenerateManifest>
<BinaryDependencyName>RCZOOMIT</BinaryDependencyName>
<SignTarget>true</SignTarget>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<PreprocessorDefinitions>_UNICODE;UNICODE;WINVER=0x602;NDEBUG;_WIN32_WINNT=0x602;_WIN32_WINDOWS=0x501;WIN32;_WINDOWS;MSVC6=1;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<DisableSpecificWarnings>4100;4091</DisableSpecificWarnings>
<AdditionalIncludeDirectories>.\modules\Common</AdditionalIncludeDirectories>
<PrecompiledHeader>Create</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;_M_IX86;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
<AdditionalIncludeDirectories>$(InterPlatformDir)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
<AdditionalDependencies>comctl32.lib;odbc32.lib;odbccp32.lib;Winmm.lib;gdiplus.lib;Msimg32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<RandomizedBaseAddress>true</RandomizedBaseAddress>
<DataExecutionPrevention>true</DataExecutionPrevention>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<PreprocessorDefinitions>_UNICODE;UNICODE;WINVER=0x602;NDEBUG;_WIN32_WINNT=0x602;_WIN32_WINDOWS=0x501;WIN32;_WINDOWS;MSVC6=1;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<DisableSpecificWarnings>4100;4091</DisableSpecificWarnings>
<AdditionalIncludeDirectories>.\modules\Common</AdditionalIncludeDirectories>
<PrecompiledHeader>Create</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;_M_X64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
<AdditionalDependencies>comctl32.lib;odbc32.lib;odbccp32.lib;Winmm.lib;gdiplus.lib;Msimg32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<RandomizedBaseAddress>true</RandomizedBaseAddress>
<FixedBaseAddress />
<DataExecutionPrevention>true</DataExecutionPrevention>
<TargetMachine>MachineX64</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<PreprocessorDefinitions>_UNICODE;UNICODE;WINVER=0x602;NDEBUG;_WIN32_WINNT=0x602;_WIN32_WINDOWS=0x501;WIN32;_WINDOWS;MSVC6=1;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<DisableSpecificWarnings>4100;4091</DisableSpecificWarnings>
<AdditionalIncludeDirectories>.\modules\Common</AdditionalIncludeDirectories>
<PrecompiledHeader>Create</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;_M_ARM64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
<AdditionalDependencies>comctl32.lib;odbc32.lib;odbccp32.lib;Winmm.lib;gdiplus.lib;Msimg32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<FixedBaseAddress>
</FixedBaseAddress>
<DataExecutionPrevention>true</DataExecutionPrevention>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_UNICODE;UNICODE;WINVER=0x0602;_DEBUG;_WIN32_WINNT=0x602.MSVC6;_WIN32_WINDOWS=0x600;WIN32;_WINDOWS;_WIN32_WINNT=0x602;MSVC6=1;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<DisableSpecificWarnings>4100;4091</DisableSpecificWarnings>
<AdditionalIncludeDirectories>.\modules\Common</AdditionalIncludeDirectories>
<PrecompiledHeader>Create</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;_M_IX86;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
<AdditionalIncludeDirectories>$(InterPlatformDir)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
<AdditionalDependencies>comctl32.lib;odbc32.lib;odbccp32.lib;Winmm.lib;gdiplus.lib;Msimg32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention />
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_UNICODE;UNICODE;WINVER=0x0602;_DEBUG;_WIN32_WINNT=0x602.MSVC6;_WIN32_WINDOWS=0x600;WIN32;_WINDOWS;_WIN32_WINNT=0x602;MSVC6=1;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<DisableSpecificWarnings>4100;4091</DisableSpecificWarnings>
<AdditionalIncludeDirectories>.\modules\Common</AdditionalIncludeDirectories>
<PrecompiledHeader>Create</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;_M_X64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
<AdditionalDependencies>comctl32.lib;odbc32.lib;odbccp32.lib;Winmm.lib;gdiplus.lib;Msimg32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<UACUIAccess>true</UACUIAccess>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention />
<TargetMachine>MachineX64</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_UNICODE;UNICODE;WINVER=0x0602;_DEBUG;_WIN32_WINNT=0x602.MSVC6;_WIN32_WINDOWS=0x600;WIN32;_WINDOWS;_WIN32_WINNT=0x602;MSVC6=1;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<DisableSpecificWarnings>4100;4091</DisableSpecificWarnings>
<AdditionalIncludeDirectories>.\modules\Common</AdditionalIncludeDirectories>
<PrecompiledHeader>Create</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;_M_ARM64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
<AdditionalDependencies>comctl32.lib;odbc32.lib;odbccp32.lib;Winmm.lib;gdiplus.lib;Msimg32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<UACUIAccess>true</UACUIAccess>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<DataExecutionPrevention>
</DataExecutionPrevention>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="AudioSampleGenerator.cpp">
<MultiProcessorCompilation Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</MultiProcessorCompilation>
<MultiProcessorCompilation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</MultiProcessorCompilation>
<MultiProcessorCompilation Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">false</MultiProcessorCompilation>
<MultiProcessorCompilation Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">false</MultiProcessorCompilation>
<MultiProcessorCompilation Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</MultiProcessorCompilation>
<MultiProcessorCompilation Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</MultiProcessorCompilation>
</ClCompile>
<ClCompile Include="modules\Common\dll.c">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="modules\Common\Eula\eula.c">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="modules\Common\WindowsVersions.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="pch.cpp" />
<ClCompile Include="SelectRectangle.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Use</PrecompiledHeader>
</ClCompile>
<ClCompile Include="Utility.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Use</PrecompiledHeader>
</ClCompile>
<ClCompile Include="DemoType.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Use</PrecompiledHeader>
</ClCompile>
<ClCompile Include="Zoomit.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Use</PrecompiledHeader>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="AudioSampleGenerator.h" />
<ClInclude Include="modules\Common\Eula\Eula.h" />
<ClInclude Include="pch.h" />
<ClInclude Include="Registry.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="SelectRectangle.h" />
<ClInclude Include="Utility.h" />
<ClInclude Include="DemoType.h" />
<ClInclude Include="ZoomIt.h" />
</ItemGroup>
<ItemGroup>
<Image Include="appicon.ico" />
<Image Include="icon1.ico" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="CaptureFrameWait.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Use</PrecompiledHeader>
</ClCompile>
<None Include="CaptureFrameWait.h" />
<None Include="cursor1.cur" />
<None Include="hand.cur" />
<None Include="packages.config" />
<None Include="VideoRecordingSession.h" />
<ClCompile Include="VideoRecordingSession.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Use</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Use</PrecompiledHeader>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="binres.rc">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild>
</ResourceCompile>
<ResourceCompile Include="ZoomIt.rc" />
</ItemGroup>
<ItemGroup>
<Content Include="publish_config.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<Import Project="modules\Build\Sysinternals.Cpp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('packages\robmikh.common.0.0.7-beta\build\native\robmikh.common.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\robmikh.common.0.0.7-beta\build\native\robmikh.common.targets'))" />
<Error Condition="!Exists('packages\Microsoft.Windows.CppWinRT.2.0.230225.1\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.Windows.CppWinRT.2.0.230225.1\build\native\Microsoft.Windows.CppWinRT.props'))" />
<Error Condition="!Exists('packages\Microsoft.Windows.CppWinRT.2.0.230225.1\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.Windows.CppWinRT.2.0.230225.1\build\native\Microsoft.Windows.CppWinRT.targets'))" />
<Error Condition="!Exists('packages\Microsoft.Windows.ImplementationLibrary.1.0.230411.1\build\native\Microsoft.Windows.ImplementationLibrary.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.Windows.ImplementationLibrary.1.0.230411.1\build\native\Microsoft.Windows.ImplementationLibrary.targets'))" />
</Target>
<Import Project="packages\robmikh.common.0.0.7-beta\build\native\robmikh.common.targets" Condition="Exists('packages\robmikh.common.0.0.7-beta\build\native\robmikh.common.targets')" />
<Import Project="packages\Microsoft.Windows.CppWinRT.2.0.230225.1\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('packages\Microsoft.Windows.CppWinRT.2.0.230225.1\build\native\Microsoft.Windows.CppWinRT.targets')" />
<Import Project="packages\Microsoft.Windows.ImplementationLibrary.1.0.230411.1\build\native\Microsoft.Windows.ImplementationLibrary.targets" Condition="Exists('packages\Microsoft.Windows.ImplementationLibrary.1.0.230411.1\build\native\Microsoft.Windows.ImplementationLibrary.targets')" />
</Project>

View File

@ -0,0 +1,115 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{73afce48-6609-48fb-86f2-db7b72a1c1ec}</UniqueIdentifier>
<Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{db948f16-61f7-47ab-96c8-57914076a38a}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{e1fa606f-a2e6-40c8-8779-8ca1813d9f01}</UniqueIdentifier>
<Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Zoomit.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="modules\Common\dll.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="modules\Common\Eula\eula.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="VideoRecordingSession.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="CaptureFrameWait.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="pch.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="modules\Common\WindowsVersions.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="SelectRectangle.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Utility.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="AudioSampleGenerator.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="DemoType.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Registry.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="resource.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="ZoomIt.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="modules\Common\Eula\Eula.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="pch.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="SelectRectangle.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Utility.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="AudioSampleGenerator.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="DemoType.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Image Include="appicon.ico">
<Filter>Resource Files</Filter>
</Image>
<Image Include="icon1.ico">
<Filter>Resource Files</Filter>
</Image>
</ItemGroup>
<ItemGroup>
<None Include="cursor1.cur">
<Filter>Resource Files</Filter>
</None>
<None Include="hand.cur">
<Filter>Resource Files</Filter>
</None>
<None Include="VideoRecordingSession.h">
<Filter>Header Files</Filter>
</None>
<None Include="CaptureFrameWait.h">
<Filter>Header Files</Filter>
</None>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="ZoomIt.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
<ResourceCompile Include="binres.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<Natvis Include="$(MSBuildThisFileDirectory)..\..\natvis\wil.natvis" />
</ItemGroup>
</Project>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly
xmlns="urn:schemas-microsoft-com:asm.v1"
manifestVersion="1.0">
<assemblyIdentity
name="ZoomIt"
version="1.0.0.0"
type="win32"
processorArchitecture="*"/>
<description>Sysinternals Zoomit</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
type="win32"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"/>
</dependentAssembly>
</dependency>
<trustInfo>
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="asInvoker" />
</requestedPrivileges>
</security>
</trustInfo>
<application>
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">per monitor</dpiAware>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
</windowsSettings>
</application>
</assembly>

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

View File

@ -0,0 +1,38 @@
resources:
repositories:
- repository: templates
type: git
name: Pipelines
ref: refs/heads/amihaiuc/1b
- repository: oneBranchPipelines
type: git
name: OneBranch.Pipelines/GovernedTemplates
ref: refs/heads/main
variables:
- template: templates/variables.yml@templates
- name: ToolName
value: 'ZoomIt'
- name: ToolBasePath
value: '' # Generally leave empty for non-PSTools
trigger:
- main
extends:
template: ${{ variables.originalTemplate }}
parameters:
globalSdl:
tsa:
enabled: false
stages:
- stage: build
displayName: 'Build and Sign'
jobs:
- template: jobs/build-and-sign-cpp.yml@templates
- stage: deploy_internal
displayName: 'Deploy Internal'
dependsOn: build
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
jobs:
- template: templates/deploy-tool.yml@templates

View File

@ -0,0 +1,18 @@
//
// This file allows for CPU architecture dependencies
#ifdef _M_IX86
//
// x86
//
// To prevent Visual Studio dependency tracking logic from assuming that the x64 .res depend on the .exe that contain them, trick it with the macros
// The .rc's included below will be touched every time any of the .exe's mentioned in them is rebuilt thus guaranteeing the Win32 .rc will be recompiled too
#include "Dependency-x64.rc"
RCZOOMIT64 BINRES MOVEABLE PURE RCZOOMIT_x64_path
#endif
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "ZoomIt.exe.manifest"

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

View File

@ -0,0 +1,58 @@
# Microsoft Developer Studio Generated NMAKE File, Based on procmon.dsp
!IF "$(CFG)" == ""
CFG=release
!MESSAGE No configuration specified. Defaulting to procmon - Release.
!ENDIF
!IF "$(CFG)" != "release" && "$(CFG)" != "debug"
!MESSAGE Invalid configuration "$(CFG)" specified.
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE CFG="release"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "release"
!MESSAGE "debug"
!MESSAGE
!ERROR An invalid configuration is specified.
!ENDIF
!IF "$(OS)" == "Windows_NT"
NULL=
!ELSE
NULL=nul
!ENDIF
!IF "$(CFG)" == "release"
ALL : SUBMODULEUPDATE ZOOMITX64 ZOOMIT64A ZOOMIT32
ZOOMITX64:
msbuild.exe -m ZoomIt.sln /p:Configuration=Release /p:Platform=x64
ZOOMIT64A:
msbuild.exe -m ZoomIt.sln /p:Configuration=Release /p:Platform=ARM64
ZOOMIT32:
msbuild.exe -m ZoomIt.sln /p:Configuration=Release /p:Platform=Win32
!ELSEIF "$(CFG)" == "debug"
ALL : SUBMODULEUPDATE ZOOMITX64 ZOOMIT64A ZOOMIT32
ZOOMITX64:
msbuild.exe -m ZoomIt.sln /p:Configuration=Debug /p:Platform=x64
ZOOMIT64A:
msbuild.exe -m ZoomIt.sln /p:Configuration=Debug /p:Platform=ARM64
ZOOMIT32:
msbuild.exe -m ZoomIt.sln /p:Configuration=Debug /p:Platform=Win32
!ENDIF
SUBMODULEUPDATE:
if not exist modules\Build\.git call modules\update.cmd

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Windows.CppWinRT" version="2.0.230225.1" targetFramework="native" />
<package id="Microsoft.Windows.ImplementationLibrary" version="1.0.230411.1" targetFramework="native" />
<package id="robmikh.common" version="0.0.7-beta" targetFramework="native" />
</packages>

View File

@ -0,0 +1 @@
#include "pch.h"

View File

@ -0,0 +1,96 @@
#pragma once
#include <windows.h>
#include <windowsx.h>
#include <commctrl.h>
#include <WinUser.h>
#include <shlobj.h>
#include <tchar.h>
#include <wincodec.h>
#include <magnification.h>
#include <uxtheme.h>
#include <math.h>
#include <shellapi.h>
#include <shlwapi.h>
#include <stdio.h>
#include "Eula/eula.h"
#include "registry.h"
#include "resource.h"
#include "dll.h"
#define GDIPVER 0x0110
#include <gdiplus.h>
// Must come before C++/WinRT
#include <wil/cppwinrt.h>
#include <wincodec.h>
// WinRT
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.Foundation.Collections.h>
#include <winrt/Windows.Foundation.Metadata.h>
#include <winrt/Windows.Foundation.Numerics.h>
#include <winrt/Windows.System.h>
#include <winrt/Windows.UI.h>
#include <winrt/Windows.UI.Composition.h>
#include <winrt/Windows.UI.Composition.Desktop.h>
#include <winrt/Windows.UI.Popups.h>
#include <winrt/Windows.Graphics.Capture.h>
#include <winrt/Windows.Graphics.Imaging.h>
#include <winrt/Windows.Graphics.DirectX.h>
#include <winrt/Windows.Graphics.DirectX.Direct3d11.h>
#include <winrt/Windows.Media.h>
#include <winrt/Windows.Media.Core.h>
#include <winrt/Windows.Media.Transcoding.h>
#include <winrt/Windows.Media.MediaProperties.h>
#include <winrt/Windows.Media.Devices.h>
#include <winrt/Windows.Storage.h>
#include <winrt/Windows.Storage.Streams.h>
#include <winrt/Windows.Storage.Pickers.h>
#include <winrt/Windows.Devices.Enumeration.h>
#include <filesystem>
// Direct3D wrappers to avoid implicitly linking to d3d11.dll; must come before declaration
#define CreateDirect3D11DeviceFromDXGIDevice WrapCreateDirect3D11DeviceFromDXGIDevice
#define CreateDirect3D11SurfaceFromDXGISurface WrapCreateDirect3D11SurfaceFromDXGISurface
#define D3D11CreateDevice WrapD3D11CreateDevice
#include "VideoRecordingSession.h"
#include "SelectRectangle.h"
#include "DemoType.h"
// WIL
#include <wil/com.h>
#include <wil/resource.h>
// DirectX
#include <d3d11_4.h>
#include <dxgi1_6.h>
#include <d2d1_3.h>
// STL
#include <vector>
#include <string>
#include <list>
#include <atomic>
#include <memory>
#include <algorithm>
#include <filesystem>
#include <future>
#include <regex>
#include <fstream>
#include <sstream>
// robmikh.common
#include <robmikh.common/composition.interop.h>
#include <robmikh.common/direct3d11.interop.h>
#include <robmikh.common/d3dHelpers.h>
#include <robmikh.common/graphics.interop.h>
#include <robmikh.common/dispatcherqueue.desktop.interop.h>
#include <robmikh.common/d3dHelpers.desktop.h>
#include <robmikh.common/composition.desktop.interop.h>
#include <robmikh.common/hwnd.interop.h>
#include <robmikh.common/capture.desktop.interop.h>
#include <robmikh.common/DesktopWindow.h>

View File

@ -0,0 +1,21 @@
{
"packageName": "ZoomIt.zip",
"files": [
{
"name": "ZoomIt.exe",
"platform": "Win32",
"configuration": "Release"
},
{
"name": "ZoomIt64.exe",
"platform": "x64",
"configuration": "Release"
},
{
"name": "ZoomIt64a.exe",
"platform": "ARM64",
"configuration": "Release",
"skus": ["ARM64"]
}
]
}

View File

@ -0,0 +1,104 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by ZoomIt.rc
//
#define IDC_AUDIO 117
#define IDC_LINK 1000
#define IDC_ALT 1001
#define IDC_CTRL 1002
#define IDC_TOGGLE 1003
#define IDC_OPTIONS 1004
#define IDC_COLORPICK 1005
#define IDC_COLOR 1006
#define IDC_DRAW 1007
#define IDC_TITLE 1008
#define IDC_ZOOM 1009
#define IDC_DRAWING 1010
#define IDC_BREAK 1011
#define IDC_HOTKEY 1014
#define IDC_DRAWHOTKEY 1015
#define IDC_HOTKEY2 1015
#define IDC_LIVEHOTKEY 1015
#define IDC_BREAKHOTKEY 1016
#define IDC_SOUNDFILE 1017
#define IDC_BACKROUNDFILE 1018
#define IDC_SPIN 1022
#define IDC_SPINTIMER 1023
#define IDC_SOUNDBROWSE 1025
#define IDC_OPACITY 1026
#define IDC_CHECK1 1027
#define IDC_ADVANCEDBREAK 1027
#define IDC_CHECKSOUNDFILE 1027
#define IDC_CHECKBACKGROUNDFILE 1028
#define IDC_BACKGROUNDBROWSE 1029
#define IDC_TIMERPOS1 1030
#define IDC_TIMERPOS2 1031
#define IDC_TIMERPOS3 1032
#define IDC_TIMERPOS4 1033
#define IDC_TIMERPOS5 1034
#define IDC_TIMERPOS6 1035
#define IDC_TIMERPOS7 1036
#define IDC_TIMERPOS8 1037
#define IDC_TIMERPOS9 1038
#define IDC_STATIC_SOUNDFILE 1039
#define IDC_EDIT1 1040
#define IDC_STATIC_BACKROUNDFILE 1040
#define IDC_TYPE 1041
#define IDC_CHECK2 1042
#define IDC_CHECK_SHOWEXPIRED 1042
#define IDC_TRYICON 1042
#define IDC_HIDETRAYICON 1042
#define IDC_SHOWTRAYICON 1042
#define IDC_AUTOSTART 1043
#define IDC_CHECKBACKGROUNDSTRETCH 1046
#define IDC_STATIC_DESKTOP_BACKGROUND 1047
#define IDC_STATIC_DESKTOPBACKGROUND 1047
#define IDC_TAB 1050
#define IDC_FONT 1051
#define IDC_ZOOMSPINTIMER 1052
#define IDC_ZOOMSPIN 1052
#define IDC_ZOOMLEVEL 1053
#define IDC_TEXTFONT 1054
#define IDC_ZOOMSLIDER 1056
#define IDC_ANIMATE_ZOOM 1057
#define IDC_COMBO1 1058
#define IDC_RECORDFRAMERATE 1058
#define IDC_SPIN1 1059
#define IDC_RECORDFRAMERATE2 1059
#define IDC_RECORDSCALING 1059
#define IDC_SNIPHOTKEY 1060
#define IDC_CAPTUREAUDIO 1061
#define IDC_MICROPHONE 1062
#define IDC_PENCONTROL 1063
#define IDC_COLORS 1064
#define IDC_HIGHLIGHTANDBLUR 1065
#define IDC_SHAPES 1066
#define IDC_SCREEN 1067
#define IDC_DEMOTYPETEXT 1068
#define IDC_DEMOTYPEBROWSE 1069
#define IDC_DEMOTYPEFILE 1070
#define IDC_DEMOTYPESPEEDSLIDER 1071
#define IDC_DEMOTYPEUSERDRIVEN 1072
#define IDC_DEMOTYPESTATIC1 1073
#define IDC_DEMOTYPESLIDER2 1074
#define IDC_DEMOTYPESTATIC2 1074
#define IDC_PENWIDTH 1105
#define IDC_TIMER 1106
#define IDC_SAVE 40002
#define IDC_COPY 40004
#define IDC_RECORD 40006
#define IDC_RECORDHOTKEY 40007
#define IDC_COPYCROP 40008
#define IDC_SAVECROP 40009
#define IDC_DEMOTYPEHOTKEY 40011
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 118
#define _APS_NEXT_COMMAND_VALUE 40013
#define _APS_NEXT_CONTROL_VALUE 1075
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif