Skip to content

Instantly share code, notes, and snippets.

@kumatti1
kumatti1 / Module1.bas
Created October 19, 2019 22:11
VBAでXHR2
View Module1.bas
Option Explicit
Private Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub Main()
Dim ie As Object
Set ie = CreateObject("InternetExplorer.application")
ie.Visible = True
ie.navigate "https://www.google.co.jp/"
@kumatti1
kumatti1 / Module1.bas
Created July 22, 2019 22:35
現行のEdgeさん
View Module1.bas
Option Explicit
Private Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Sub hoge()
Dim doc As Object
Set doc = CreateObject("htmlfile")
With doc
.parentWindow.navigate "https://www.yahoo.co.jp/"
While .readystate <> "complete"
@kumatti1
kumatti1 / Module1.bas
Last active May 27, 2019 22:42
諸般の事情により、久し振りにVBAを使ったなー。
View Module1.bas
Option Explicit
Declare PtrSafe Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As LongPtr
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
Sub hoge()
Dim hWnd&: hWnd = FindWindow("Notepad", vbNullString)
SendMessage hWnd, &H111, 4, ByVal 0&
View F12.cpp
//#define UNICODE
#include <stdio.h>
#include <windows.h>
#include <Oleacc.h>
#include <stdio.h>
#include <Shlwapi.h>
#include <shobjidl.h>
#import <mshtml.tlb>
#pragma comment(lib, "shlwapi.lib")
View Gist.cpp
//#define UNICODE
#include <stdio.h>
#include <windows.h>
#include <Oleacc.h>
#include <stdio.h>
#include <Shlwapi.h>
#include <shobjidl.h>
#import <mshtml.tlb>
#pragma comment(lib, "shlwapi.lib")
@kumatti1
kumatti1 / Module1.bas
Created March 26, 2017 22:45
0x80004005
View Module1.bas
Option Explicit
Private Type GUID
Data1 As Long
Data2 As Integer
Data3 As Integer
Data4(0 To 7) As Byte
End Type
Const IID_IDownloadManager = "{988934A4-064B-11D3-BB80-00104B35E7F9}"
@kumatti1
kumatti1 / Module1.bas
Created March 23, 2017 22:49
TaskDialogIndirect
View Module1.bas
Option Explicit
Enum ICONS
TD_WARNING_ICON = 65535
TD_ERROR_ICON = 65534
TD_INFORMATION_ICON = 65533
TD_SHIELD_ICON = 65532
End Enum
Enum TASKDIALOG_FLAGS
@kumatti1
kumatti1 / Module1.bas
Created March 23, 2017 03:33
メモ帳のダイアログを閉じる
View Module1.bas
Option Explicit
'参照設定 UIAutomationClient
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
Sub hoge()
Dim o As IUIAutomation
Dim e As IUIAutomationElement
Set o = New CUIAutomation
Dim h As LongPtr
@kumatti1
kumatti1 / Module1.bas
Created March 16, 2017 22:33
ファイル指定で、任意の右クリックメニュー呼び出し
View Module1.bas
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 March 16, 2017 03:20
ファイル指定で既定の右クリック呼び出し
View Module1.bas
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 _