Skip to content

Instantly share code, notes, and snippets.

@kumatti1
kumatti1 / gist:1726828
Created Feb 3, 2012
VBAでのTaskDialogIndirect(Win7SP1)
View gist:1726828
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 / gist:1856305
Created Feb 17, 2012
VBAでモニタ名を得る
View gist:1856305
Option Explicit
Enum MONITORS
MONITOR_DEFAULTTONULL
MONITOR_DEFAULTTOPRIMARY
MONITOR_DEFAULTTONEAREST
End Enum
Const PHYSICAL_MONITOR_DESCRIPTION_SIZE = 128 - 1
View gist:2165098
Option Explicit
'http://www.ka-net.org/office/of12.html
'Microsoft HTML Object Library
Private d As MSHTML.HTMLDocument
Private w As MSHTML.IHTMLWindow2
Private TimerId As Long
@kumatti1
kumatti1 / Module1.bas
Created Mar 1, 2014
Excel 2013 x64/Win8.1用SetWindowSubclassのサブクラス化VBAコード
View Module1.bas
Option Explicit
Declare PtrSafe Function FindWindowEx Lib "user32" Alias "FindWindowExW" (ByVal hWnd1 As LongPtr, ByVal hWnd2 As LongPtr, ByVal lpsz1 As LongPtr, ByVal lpsz2 As LongPtr) As LongPtr
Private Declare PtrSafe Function VirtualProtect Lib "kernel32" (ByVal lpAddress As Any, _
ByVal dwSize As LongLong, _
ByVal flNewProtect As Long, _
lpflOldProtect As Long) As Long
Const PAGE_EXECUTE_READ = &H20&
Const PAGE_EXECUTE = &H10
Private Declare PtrSafe Function SetWindowSubclass Lib "C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.9600.16384_none_62475f7becb72503\comctl32.dll" (ByVal hWnd As LongPtr, ByVal pfnSubclass As LongPtr, ByVal uIdSubclass As LongPtr, ByVal dwRefData As LongPtr) As Long
Private Declare PtrSafe Function RemoveWindowSubclass Lib "C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.9600.16384_none_62475f7becb72503\comctl32.dll" (ByVal hWnd As LongPtr, ByVal pfnSubclass As LongPtr, ByVal uIdSubclass As Lon
@kumatti1
kumatti1 / UserForm1.frm
Created Mar 21, 2014
IEで同期オブジェクト
View UserForm1.frm
Option Explicit
Private Type SECURITY_ATTRIBUTES
nLength As Long
lpSecurityDescriptor As LongPtr
bInheritHandle As Long
End Type
Private Declare Function MsgWaitForMultipleObjects Lib "user32" _
(ByVal nCount As Long, pHandles As Long, _
ByVal fWaitAll As Long, ByVal dwMilliseconds As Long, _
ByVal dwWakeMask As Long) As Long
@kumatti1
kumatti1 / Module2.bas
Created Mar 28, 2014
エクスプローラ検索
View Module2.bas
Option Explicit
Declare Function ILCreateFromPathW& Lib "Shell32.dll" (ByVal pszPath&)
Declare Sub MoveMemory Lib "kernel32" Alias "RtlMoveMemory" _
(Destination As Any, Source As Any, ByVal Length As Long)
Declare Sub ILFree Lib "Shell32.dll" (ByVal pidl&)
Declare Function ILGetSize& Lib "Shell32.dll" (ByVal pidl&)
Private Declare _
Function InitVariantFromBuffer Lib "propsys.dll" ( _
ByVal pv As LongPtr, _
@kumatti1
kumatti1 / Module1.bas
Created Mar 21, 2014
SetTimerで同期オブジェクト
View Module1.bas
Option Explicit
Private Type SECURITY_ATTRIBUTES
nLength As Long
lpSecurityDescriptor As LongPtr
bInheritHandle As Long
End Type
Private Declare Function MsgWaitForMultipleObjects Lib "user32" _
(ByVal nCount As Long, pHandles As Long, _
ByVal fWaitAll As Long, ByVal dwMilliseconds As Long, _
View Module1.bas
Option Explicit
Private Type SECURITY_ATTRIBUTES
nLength As Long
lpSecurityDescriptor As LongPtr
bInheritHandle As Long
End Type
Private Declare Function MsgWaitForMultipleObjects Lib "user32" _
(ByVal nCount As Long, pHandles As Long, _
ByVal fWaitAll As Long, ByVal dwMilliseconds As Long, _
@kumatti1
kumatti1 / Module1.bas
Created May 30, 2014
ドロップダウンリスト開く
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 / Class1.cls
Last active Jan 8, 2021
ConnectToConnectionPointでDocumentCompleteイベント
View Class1.cls
Option Explicit
Private Type GUID
Data1 As Long
Data2 As Integer
Data3 As Integer
Data4(0 To 7) As Byte
End Type