Skip to content

Instantly share code, notes, and snippets.

@kumatti1
kumatti1 / Module1.bas
Last active January 8, 2021 02:28
Explorerのファイル選択
Option Explicit
Private Declare Function ILCreateFromPathW& Lib "Shell32.dll" (ByVal pszPath&)
Private Declare Sub ILFree Lib "Shell32.dll" (ByVal pidl&)
Private Declare Function ILGetSize& Lib "Shell32.dll" (ByVal pidl&)
Private Declare _
Function InitVariantFromBuffer Lib "propsys.dll" ( _
ByVal pv As LongPtr, _
ByVal cb As Long, _
ByRef pvar As Variant _
@kumatti1
kumatti1 / Module1.bas
Created January 23, 2016 04:12
Explorer検索
Option Explicit
Declare Function ILCreateFromPathW& Lib "Shell32.dll" (ByVal pszPath&)
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, _
ByVal cb As Long, _
ByRef pvar As Variant _
@kumatti1
kumatti1 / UserForm1.frm
Created January 7, 2016 08:08
WebBrowser1透過失敗
Option Explicit
Private Declare PtrSafe _
Function SetWindowCompositionAttribute Lib "user32.dll" ( _
ByVal hwnd As LongPtr, _
st As Any _
) As Long
Private Declare PtrSafe _
@kumatti1
kumatti1 / UserForm1.frm
Created January 7, 2016 08:06
WebBrowser非表示
Option Explicit
Private Declare PtrSafe _
Function WindowFromAccessibleObject Lib "oleacc.dll" ( _
ByVal pacc As IAccessible, _
hwnd As Any _
) As Long
Private Declare PtrSafe _
Function ShowWindow Lib "user32.dll" ( _
@kumatti1
kumatti1 / hoge.cpp
Created January 5, 2016 23:00
ウィザード起動
#include <windows.h>
#include <stdio.h>
#include <comdef.h>
#pragma comment(lib,"ole32.lib")
#pragma comment(lib,"user32.lib")
#define ss L"Microsoft.Display"
interface IUnk : public IUnknown
{
@kumatti1
kumatti1 / Module1.bas
Created January 2, 2016 23:09
DPI取得
Option Explicit
Private Declare PtrSafe _
Function GetWindowDPI Lib "user32.dll" ( _
ByVal hwnd As LongPtr _
) As Long
Sub hoge()
@kumatti1
kumatti1 / hoge.cpp
Created January 2, 2016 22:01
GetProcessHandleFromHwndは、Hookから。
#include <windows.h>
#include <Shlobj.h>
#include <Exdisp.h>
#pragma comment(lib,"oleacc.lib")//自前
#pragma comment(lib,"ole32.lib")
#pragma comment(lib,"user32.lib")
#pragma comment(lib,"shell32.lib")
#pragma comment(lib,"shdocvw.Lib")//自前
@kumatti1
kumatti1 / hoge.cpp
Created January 1, 2016 23:44
リンク出来た(`・ω・´)ゞ
#include <windows.h>
#include <Shlobj.h>
#pragma comment(lib,"ole32.lib")
#pragma comment(lib,"user32.lib")
#pragma comment(lib,"shell32.lib")
#pragma comment(lib,"shdocvw.Lib")
extern "C" HRESULT __stdcall SHGetIDispatchForFolder(
ITEMIDLIST *pidl,
@kumatti1
kumatti1 / Module2.bas
Created December 31, 2015 08:28
エクスプローラ起動
Option Explicit
Private Declare PtrSafe Function ILCreateFromPathW Lib "Shell32.dll" (ByVal pszPath As LongPtr) As Long
Private Declare PtrSafe Function SHGetIDispatchForFolder Lib "shdocvw.dll" (ByVal pidl As Long, arg2 As Any) As Long
Private Declare PtrSafe Sub ILFree Lib "Shell32.dll" (ByVal pidl As Long)
Private Declare PtrSafe Function SHGetSpecialFolderLocation Lib "Shell32" (ByVal hwndOwner As LongPtr, ByVal nFolder As Long, ppidl As Any) As Long
Const CSIDL_PERSONAL = &H5
Sub hoge()
@kumatti1
kumatti1 / Module1.bas
Created December 30, 2015 22:46
ダイアログ出します(`・ω・´)ゞ
Option Explicit
Private Declare PtrSafe Function DoFileDownload Lib "ieframe.dll" (ByVal arg1 As LongPtr) As Long
Sub hoge()
DoFileDownload StrPtr("http://k.yimg.jp/images/top/sp2/cmn/logo-ns-131205.png")
End Sub