Skip to content

Instantly share code, notes, and snippets.

View KubaO's full-sized avatar

Kuba Sunderland-Ober KubaO

View GitHub Profile
@valinet
valinet / toast2.c
Last active September 22, 2024 08:38
Send a toast notification in Windows 10/11 using plain C including COM activator
#include <initguid.h>
#include <Windows.h>
#include <roapi.h>
#include <Windows.ui.notifications.h>
#include <notificationactivationcallback.h>
#include <tchar.h>
#include <stdio.h>
#pragma comment(lib, "runtimeobject.lib")
DWORD dwMainThreadId = 0;
@valinet
valinet / toast1.c
Created December 21, 2020 19:22
Send a toast notification in Windows 10 using plain C
// Send toast notifications in Windows 10, using Windows Runtime,
// without any language projection, in PLAIN C
// Copyright (c) 2021 Valentin - Gabriel Radu
//
// MIT License
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this softwareand associated documentation files(the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and /or sell
// copies of the Software, and to permit persons to whom the Software is
anonymous
anonymous / gist:a67ba4695c223a905ff108ed8b9a342f
Created July 8, 2017 10:22
Abusing co_await for optionals in C++
// Changed awaiter to not leak memory on suspension thanks to /u/Enemii.
#include <experimental/coroutine>
#include <iostream>
#include <memory>
#include <optional>
#include <utility>
template<typename T>
class shared_optional {
@fincs
fincs / main.cpp
Created May 19, 2012 22:37
Fully native C++ WinRT (Metro-style) app
//
// Fully native C++ WinRT application example
// Programmed by fincs
//
#include <windows.h>
#include <roapi.h>
#include <wchar.h>
#include <stdio.h>
#include <stdlib.h>