Skip to content

Instantly share code, notes, and snippets.

@kumatti1
kumatti1 / Module1.bas
Created August 13, 2014 22:03
HTML5のドラッグ&ドロップ試行
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 / Class1.cls
Created August 26, 2014 23:01
IEでクリックされた要素を調べる
Option Explicit
'PublicNotCreatable
Public Sub htmlEvent()
Attribute hoge.VB_UserMemID = 0
'IHTMLEventObj
Dim Win2 As MSHTML.IHTMLWindow2
Set Win2 = IE.document.parentWindow
@kumatti1
kumatti1 / Module1.bas
Created September 6, 2014 23:37
64Bit_VBA_TEST
Declare PtrSafe Function printf Lib _
"msvcr100.dll" _
(ByVal s As String, ByVal tmp As LongPtr, _
ptr As LongPtr) As Long
Declare PtrSafe Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As LongPtr)
Sub hoge()
@kumatti1
kumatti1 / Module1.bas
Last active August 29, 2015 14:08
TwitterPost
Option Explicit
Private Declare PtrSafe Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As LongPtr
Private Declare PtrSafe Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As LongPtr, ByVal wMsg As Long, ByVal wParam As LongPtr, lParam As Any) As LongPtr
Private Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Declare PtrSafe Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As LongPtr, ByVal hWnd2 As LongPtr, ByVal lpsz1 As String, ByVal lpsz2 As String) As LongPtr
Private Declare PtrSafe Function IsWindowVisible Lib "user32" (ByVal hwnd As LongPtr) As Long
Const WM_SETTEXT = &HC
Const BM_CLICK = &HF5
@kumatti1
kumatti1 / GetPoint.cpp
Last active August 29, 2015 14:08
GetPoint
#include <windows.h>
#include <oleacc.h>
#include <Shlwapi.h>
#include <stdio.h>
#import <shdocvw.dll>
#import <mshtml.tlb>
#undef GetFreeSpace
#import "scrrun.dll" auto_rename
#define FullPath L"フルパス"
@kumatti1
kumatti1 / Module1.bas
Last active August 29, 2015 14:09
moug
'目的の要素を選択
Sub Main()
Application.OnTime Now + TimeSerial(0, 0, 2), "GetSub"
End Sub
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
@kumatti1
kumatti1 / CIE.cls
Created November 26, 2014 22:41
OKWave
'YU-TAMG氏のコード改
'https://gist.github.com/1619670
' 要・Microsoft Internet Controls 参照設定
Option Explicit
@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 / 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