This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <winrt/Windows.System.h> | |
#include <winrt/Windows.UI.Composition.Desktop.h> | |
#include <windows.ui.composition.interop.h> | |
#include <DispatcherQueue.h> | |
extern "C" IMAGE_DOS_HEADER __ImageBase; | |
using namespace winrt; | |
using namespace Windows::UI; | |
using namespace Windows::UI::Composition; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "winrt/Windows.System.Profile.SystemManufacturers.h" | |
using namespace winrt::Windows::System::Profile::SystemManufacturers; | |
int main() | |
{ | |
winrt::init_apartment(); | |
printf("Serial number = %ls\n", SmbiosInformation::SerialNumber().c_str()); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "winrt/base.h" | |
#include <set> | |
using namespace winrt; | |
using namespace Windows::Foundation; | |
using namespace std::chrono_literals; | |
extern "C" | |
{ | |
HRESULT __stdcall OS_RoGetActivationFactory(HSTRING classId, GUID const& iid, void** factory); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// cl /EHsc /std:c++17 /O2 gclip.cpp | |
// Requires VS 2017 15.6+ and the RS4 Windows SDK. | |
#pragma comment(lib, "windowsapp") | |
#pragma comment(lib, "ole32") | |
#include <winrt/Windows.ApplicationModel.DataTransfer.h> | |
#include <windows.h> | |
using namespace winrt; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "winrt/base.h" | |
#include <Windows.h> | |
using namespace winrt; | |
using namespace Windows::Foundation; | |
using namespace std::chrono; | |
template <typename...Async> | |
void wait_for_any(Async&&... async) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <winrt/Windows.System.h> | |
#include <ShellScalingAPI.h> | |
#include <DispatcherQueue.h> | |
using namespace std::literals; | |
using namespace winrt; | |
using namespace Windows::Foundation; | |
using namespace Windows::System; | |
auto CreateDispatcherQueueController() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <winrt/base.h> | |
#include <windows.h> | |
template <typename T> | |
struct completion_source | |
{ | |
completion_source() | |
{ | |
m_signal.attach(CreateEvent(nullptr, true, false, nullptr)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <unknwn.h> | |
#include "winrt/Windows.Storage.Streams.h" | |
using namespace winrt; | |
using namespace Windows::Foundation; | |
using namespace Windows::Storage::Streams; | |
struct __declspec(uuid("905a0fef-bc53-11df-8c49-001e4fc686da")) IBufferByteAccess : ::IUnknown | |
{ | |
virtual HRESULT __stdcall Buffer(uint8_t** value) noexcept = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <windows.h> | |
#include "winrt/Windows.ApplicationModel.Core.h" | |
#include "winrt/Windows.UI.Core.h" | |
using namespace winrt; | |
using namespace Windows::ApplicationModel::Core; | |
using namespace Windows::UI::Core; | |
struct App : implements<App, IFrameworkViewSource, IFrameworkView> | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string_view> | |
#include <exception> | |
#include <assert.h> | |
using namespace std::literals; | |
struct guid | |
{ | |
uint32_t Data1; | |
uint16_t Data2; |