Skip to content

Instantly share code, notes, and snippets.

View ADeltaX's full-sized avatar

ADeltaX ADeltaX

View GitHub Profile
@ADeltaX
ADeltaX / dispatcherqueue.cpp
Last active November 30, 2024 04:59
C++/WinRT snippet for creating or getting a DispatcherQueue (15063+)
#include <winrt/Windows.System.h>
winrt::Windows::System::DispatcherQueue CreateDispatcherQueue()
{
auto coreMsgLib = LoadLibrary(L"CoreMessaging.dll");
typedef HRESULT(WINAPI* CreateDispatcherQueueForCurrentThread)(
_Deref_out_ ABI::Windows::System::IDispatcherQueue** dispatcherQueueController);
auto pCreateDispatcherQueueForCurrentThread =
@ADeltaX
ADeltaX / main.cpp
Created June 18, 2021 11:46
DWM Thumbnail/VirtualDesktop USING Windows.UI.Composition
#include <Unknwn.h>
#include <Windows.h>
#include <wrl\implements.h>
#include <comutil.h>
#include <dcomp.h>
#include <dwmapi.h>
#include <dxgi1_3.h>
#include <d3d11_2.h>
#include <d2d1_2.h>
#include <d2d1_2helper.h>