Skip to content

Instantly share code, notes, and snippets.

@kumatti1
kumatti1 / Module1.bas
Created March 22, 2014 22:57
SetTimer
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 / Module2.bas
Created March 28, 2014 09:29
エクスプローラ検索
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 / Mese.cpp
Created April 9, 2014 23:09
(Ctrl+c)キー送信した際の挙動
#include <windows.h>
int CALLBACK WinMain(
_In_ HINSTANCE hInstance,
_In_ HINSTANCE hPrevInstance,
_In_ LPSTR lpCmdLine,
_In_ int nCmdShow
)
{
MessageBoxA(nullptr, "A", "A", MB_OK);
@kumatti1
kumatti1 / xp_IPropertyStore.cpp
Created April 21, 2014 23:04
XPでIPropertyStore
#define Microsoft_Office_Metadata_Handler L"{993BE281-6695-4BA5-8A2A-7AACBFAAB69E}"
#define Microsoft_Office_Thumbnail_Handler L"{C41662BB-1FA0-4CE0-8DC5-9B7F8279FF97}"
#define FilePath L"実際のパス"
#include <windows.h>
#include <ObjIdl.h>
#include <Propsys.h>
#include <Shlwapi.h>
#include <comdef.h>
#include <Propvarutil.h>
@kumatti1
kumatti1 / unDocmented.cpp
Created April 22, 2014 23:22
pSHStgOpenStorageW
#define FilePath L"実際のパス"
#include <windows.h>
#include <ObjIdl.h>
#include <Propsys.h>
#include <Shlwapi.h>
#include <comdef.h>
#include <Propvarutil.h>
_COM_SMARTPTR_TYPEDEF(IPersistFile, __uuidof(IPersistFile));
@kumatti1
kumatti1 / CRT.DEF
Last active August 29, 2015 14:01
文字列連結
LIBRARY CRT
EXPORTS
CRTfunc
@kumatti1
kumatti1 / Module2.bas
Last active August 29, 2015 14:01
検索ボックスにセット
Option Explicit
Sub hoge2()
Dim Shl As Shell32.Shell
Dim Win As InternetExplorer
Const StrPath As String = "C:\Temp"
Set Shl = New Shell32.Shell
For Each Win In Shl.Windows
If Win.FullName Like "*\Explorer.EXE" Then
If Win.document.Folder.Self.Path = (StrPath) Then
@kumatti1
kumatti1 / exp_.cpp
Created May 18, 2014 23:26
エクスプローラ制御
#include <Windows.h>
#include <Shlwapi.h>
#include <Shlobj.h>
#include <Shobjidl.h>
#include <Propkey.h>
#include <comdef.h>
_COM_SMARTPTR_TYPEDEF(IFolderView, __uuidof(IFolderView));
_COM_SMARTPTR_TYPEDEF(IFolderView2, __uuidof(IFolderView2));
_COM_SMARTPTR_TYPEDEF(IShellWindows, __uuidof(IShellWindows));
int CALLBACK WinMain(
@kumatti1
kumatti1 / Module4.bas
Created May 19, 2014 22:34
エクスプローラでのパス列挙
Option Explicit
Sub hoge3()
Dim o As Shell32.FolderItems3
Dim v As Shell32.FolderItem2
Dim Shl As Shell32.Shell
Dim Win As InternetExplorer
Const StrPath As String = "C:\Temp"
Set Shl = New Shell32.Shell
For Each Win In Shl.Windows
If Win.FullName Like "*\Explorer.EXE" Then
Option Explicit
Private WithEvents d As Shell32.ShellFolderViewOC
Private WithEvents ie As SHDocVw.InternetExplorer
Private flg As Boolean
Private Sub d_EnumDone()
flg = True
Debug.Print "d_EnumDone"
End Sub
Private Sub ie_DocumentComplete(ByVal pDisp As Object, URL As Variant)