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 <pathcch.h> | |
#include <string> | |
#pragma comment(lib, "pathcch") | |
namespace impl | |
{ | |
void check(HRESULT const result) | |
{ |
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
#pragma comment(lib, "windowsapp") | |
#include "winrt/Windows.Networking.Connectivity.h" | |
using namespace winrt; | |
using namespace Windows::Networking; | |
using namespace Windows::Networking::Connectivity; | |
int main() | |
{ | |
initialize(); |
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.Foundation.h" | |
struct __declspec(uuid("5b0d3235-4dba-4d44-865e-8f1d0e4fd04d")) __declspec(novtable) IMemoryBufferByteAccess : ::IUnknown | |
{ | |
virtual HRESULT __stdcall GetBuffer(uint8_t** value, uint32_t* capacity) = 0; | |
}; | |
using namespace winrt; | |
using namespace Windows::Foundation; |
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"Precompiled.h" | |
static char const Constant_LinkExpression[] = ">([^<]+)<A HREF=\"([^\"]+)\">"; | |
static char const Constant_DefaultUrl[] = "http://live.sysinternals.com/"; | |
static char const Constant_DefaultIgnore[] = "*.sys;*.html;*.cnt;*.scr;*.hlp;*.txt;*.asp;*.aspx"; | |
static char const Constant_Banner[] = "SyncTools for Sysinternals. Copyright (c) 2013 Kenny Kerr\n\n"; | |
static char const Constant_SyncStatus[] = ".SyncStatus"; | |
static char const Constant_SyncIgnore[] = ".SyncIgnore"; | |
static UINT const Constant_SyncStatusFormat = 2; |
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
using namespace Windows::Foundation::Collections; | |
template <typename T> | |
struct observable_vector : implements<observable_vector<T>, | |
IObservableVector<T>, | |
IVector<T>, | |
IVectorView<T>, | |
IIterable<T>> | |
{ | |
event_token VectorChanged(VectorChangedEventHandler<T> const& handler) |
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
template <typename T> | |
T^ to_cx(winrt::Windows::Foundation::IUnknown const& from) | |
{ | |
return safe_cast<T^>(reinterpret_cast<Platform::Object^>(winrt::get_abi(from))); | |
} | |
template <typename T> | |
T from_cx(Platform::Object^ from) | |
{ | |
T to{ 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
struct __declspec(uuid("905a0fef-bc53-11df-8c49-001e4fc686da")) IBufferByteAccess : ::IUnknown | |
{ | |
virtual HRESULT __stdcall Buffer(uint8_t** value) = 0; | |
}; | |
struct CustomBuffer : implements<CustomBuffer, IBuffer, IBufferByteAccess> | |
{ | |
std::vector<uint8_t> m_buffer; | |
uint32_t m_length{}; |
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.graphics.directx.direct3d11.h> | |
extern "C" | |
{ | |
HRESULT __stdcall CreateDirect3D11DeviceFromDXGIDevice(::IDXGIDevice* dxgiDevice, | |
::IInspectable** graphicsDevice); | |
HRESULT __stdcall CreateDirect3D11SurfaceFromDXGISurface(::IDXGISurface* dgxiSurface, | |
::IInspectable** graphicsSurface); | |
} |
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
runtimeclass Events; | |
[version(1.0), uuid(da38922c-3d3a-404f-8477-de9c104c4f34)] | |
delegate HRESULT CustomDelegate([in] int value); | |
[version(1.0), uuid(6ac35d2c-b2cf-4c36-995c-a9c0764636c9), exclusiveto(Events)] | |
interface IEvents : IInspectable | |
{ | |
[eventadd] HRESULT CustomEvent([in] CustomDelegate* handler, [out][retval] EventRegistrationToken* cookie); | |
[eventremove] HRESULT CustomEvent([in] EventRegistrationToken cookie); |
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.UI.Core.h> | |
namespace winrt | |
{ | |
struct resume_foreground | |
{ | |
explicit resume_foreground(Windows::UI::Core::CoreDispatcher&& dispatcher, Windows::UI::Core::CoreDispatcherPriority const priority = Windows::UI::Core::CoreDispatcherPriority::Normal) : | |
m_dispatcher(std::move(dispatcher)), | |
m_priority(priority) | |
{ |