Created
September 13, 2012 22:17
-
-
Save kumatti1/3718117 to your computer and use it in GitHub Desktop.
起動済みExplorerの検索
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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&) | |
Sub hoge() | |
Dim IE As Object | |
Dim tmp&, pidl&, v, strPath$ | |
Dim Size& | |
Dim byt() As Byte | |
strPath = "C:\" | |
pidl = ILCreateFromPathW(StrPtr(strPath)) | |
Size = ILGetSize(pidl) | |
ReDim byt(0 To Size - 1) | |
MoveMemory byt(0), ByVal pidl, Size | |
v = byt | |
'SWC_EXPLORER = 0x0, | |
'SWC_BROWSER = 0x00000001, | |
'SWFO_NEEDDISPATCH = 0x00000001, | |
Set IE = CreateObject("Shell.Application").Windows.findwindowSW(v, Empty, 1&, tmp, 1&) | |
Debug.Print Not IE Is Nothing | |
ILFree pidl | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment