Skip to content

Instantly share code, notes, and snippets.

@kumatti1
kumatti1 / Module1.bas
Created December 26, 2015 22:13
弱参照用API
Option Explicit
Private Type GUID
Data1 As Long
Data2 As Integer
Data3 As Integer
Data4(0 To 7) As Byte
End Type
Private Declare PtrSafe _
@kumatti1
kumatti1 / hoge.cpp
Last active December 24, 2015 22:23
Edgeでスタイルシート調整
//#define UNICODE
#include <stdio.h>
#include <windows.h>
#include <Oleacc.h>
#include <stdio.h>
#include <Shlwapi.h>
#include <shobjidl.h>
#import <mshtml.tlb>
@kumatti1
kumatti1 / hoge.cpp
Created December 6, 2015 02:43
Edge制御
//http://www.ka-net.org/blog/?p=6033
//Microsoft Edgeを操作するVBAマクロ(DOM編) | 初心者備忘録
#define UNICODE
#include <stdio.h>
#include <windows.h>
#include <Oleacc.h>
#include <stdio.h>
#import <mshtml.tlb>
@kumatti1
kumatti1 / hoge.cpp
Created November 28, 2015 22:39
APIフック?
#define UNICODE
#include <stdio.h>
#include <windows.h>
typedef FARPROC (WINAPI *DelayLoadFailureHook)
( _In_ LPCSTR pszDllName,
_In_ LPCSTR pszProcName
);
@kumatti1
kumatti1 / hoge.cpp
Last active April 29, 2019 09:02
メモ帳のウィンドウ制御
#include <stdio.h>
#include <windows.h>
void hoge()
{
HWND hwnd = FindWindowW( L"Notepad", L"無題 - メモ帳");
if(!hwnd){
MessageBoxW(0, L"", L"メモ帳未起動!", MB_OK);
_wsystem(L"c:\\windows\\system32\\notepad.exe");
@kumatti1
kumatti1 / Module1.bas
Created November 16, 2015 05:42
個別ページのaセレクタ変更
Sub hoge()
Const url = "https://twitter.com/ユーザー名
Dim IE
Set IE = CreateObject("Shell.Application").Windows.findwindowSW(url, Empty, 1, 0, 1)
If IE Is Nothing Then Exit Sub
Dim e As IHTMLStyleSheetsCollection
@kumatti1
kumatti1 / hoge.vbs
Last active November 17, 2015 03:26
Twitter背景変更
Option Explicit
Call hoge
Sub hoge()
Const url = "https://twitter.com/"
Dim IE
Option Explicit
Private Const PAGE_EXECUTE_READWRITE = &H40
Private Declare Sub MoveMemory Lib "kernel32" Alias "RtlMoveMemory" _
(Destination As Long, Source As Long, ByVal Length As Long)
Private Declare Function VirtualProtect Lib "kernel32" (lpAddress As Long, _
ByVal dwSize As Long, ByVal flNewProtect As Long, lpflOldProtect As Long) As Long
Private Declare Function GetModuleHandleA Lib "kernel32" (ByVal lpModuleName As String) As Long
Private Declare Function GetProcAddress Lib "kernel32" (ByVal hModule As Long, _
ByVal lpProcName As String) As Long
Private Declare Function DialogBoxParam Lib "user32" Alias "DialogBoxParamA" (ByVal hInstance As Long, _
#define UNICODE
#include <windows.h>
#include <stdio.h>
DWORD OldProtect;
void Proto2(DWORD *Addr)
{
MessageBoxW(0, L"", L"Proto", MB_OK);
@kumatti1
kumatti1 / hoge.cpp
Created September 27, 2015 03:17
APIフック
#define UNICODE
#include <windows.h>
#include <stdio.h>
__declspec(naked) void Proto2(DWORD *Addr)
{
_asm {
pop eax
pop ecx