Skip to content

Instantly share code, notes, and snippets.

@kumatti1
kumatti1 / hoge.cpp
Created March 6, 2015 23:31
FindFirstFileTransacted
#define UNICODE
#include <windows.h>
#include <KtmW32.h>
#pragma comment(lib, "KtmW32.lib")
int CALLBACK WinMain(
_In_ HINSTANCE hInstance,
_In_ HINSTANCE hPrevInstance,
_In_ LPSTR lpCmdLine,
@kumatti1
kumatti1 / Module1.bas
Last active January 8, 2021 04:19
FindFirstFileExWでFindExSearchLimitToDirectories、やっぱり使えないわな
Option Explicit
Const FIND_FIRST_EX_LARGE_FETCH = 2& 'Win7以降
Const FindExInfoStandard = 0&
Const FindExInfoBasic = 1& 'Win7以降
Const FindExSearchLimitToDirectories = 1&
Private Declare PtrSafe Function FindFirstFileExW Lib "kernel32" _
(ByVal lpFileName As LongPtr, _
@kumatti1
kumatti1 / hoge.cpp
Created March 2, 2015 03:28
iGPU色調整
#include <windows.h>
#using <C:\\Windows\\System32\\gfxSrvc.dll>
#using <System.Windows.Forms.dll>
using namespace System;
using namespace System::Windows::Forms;
using namespace System::Reflection;
using namespace System::Runtime::InteropServices;
@kumatti1
kumatti1 / hoge.cpp
Last active August 29, 2015 14:16
IHTMLDocument2からのSystem::Windows::Forms::HtmlDocument変換
#include <Exdisp.h>
#import <shdocvw.dll>
#import <mshtml.tlb>
#using <System.Windows.Forms.dll>
using namespace System;
using namespace System::Windows::Forms;
using namespace System::Reflection;
using namespace System::Runtime::InteropServices;
@kumatti1
kumatti1 / Module1.bas
Created January 11, 2015 23:57
Yahoo!
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 / Module1.bas
Created December 28, 2014 23:26
VBA_Test
Option Explicit
Declare PtrSafe Function DispInvoke Lib "OleAut32" _
(ByVal arg1 As LongPtr, _
ByVal arg2 As LongPtr, _
ByVal arg3 As Long, _
ByVal arg4 As Integer, _
arg5 As Any, _
arg6 As Variant, _
arg7 As Any, _
@kumatti1
kumatti1 / Module1.bas
Created December 24, 2014 22:25
CoGetApartmentType
Option Explicit
Private Declare PtrSafe Function CoGetApartmentType Lib "Ole32" (pAptType As Long, pAptQualifier As Long) As Long
Sub hoge()
Dim arg1&, arg2&, hr&
hr = CoGetApartmentType(arg1, arg2)
Debug.Print Hex$(hr), arg1, arg2
@kumatti1
kumatti1 / hoge.cpp
Last active August 29, 2015 14:10
Google検索
#include <Exdisp.h>
#import <shdocvw.dll>
#import <mshtml.tlb>
#define URL L"https://www.google.co.jp/?gws_rd=ssl"
HRESULT test()
{
HRESULT hr = S_OK;
try{
@kumatti1
kumatti1 / CIE.cls
Created November 26, 2014 22:41
OKWave
'YU-TAMG氏のコード改
'https://gist.github.com/1619670
' 要・Microsoft Internet Controls 参照設定
Option Explicit
Option Explicit
Declare PtrSafe Function CLSIDFromString Lib "Ole32" (ByVal lpsz As LongPtr, pclsid As Any) As Long
Declare PtrSafe Function GetActiveObject Lib "OleAut32" (rclsid As Any, ByVal pvReserved As LongPtr, ppunk As Any) As Long
Declare PtrSafe Function RegisterActiveObject Lib "OleAut32" (ByVal pUnk As IUnknown, rclsid As Any, ByVal dwFlags As Long, pdwRegister As Long) As Long
Private cls As Class1
Sub Main()
Set cls = New Class1