' - Added HideSelection property to fix focus managment issues pointed out by Carles P.V.
' - Added IsWin2K to determine if unicode is available
' - Added SHBrowseForFolderW and SHGetPathFromIDListW for Unicode Support
' 28Oct07 - Added IsFolder method to prevent incorrect qualifying the files
' passed back by QualifyPath method....thanks to Ruturaj for catching this!!
' - Added IsFile method (Logical opposite of IsFolder).
'
'
' Force Declarations
Option Explicit
' Build Date & Time: 10/28/2007 8:05:13 PM
Const Major As Long = 1
Const Minor As Long = 0
Const Revision As Long = 50
Const DateTime As String = "10/28/2007 8:05:13 PM"
Private Type OSVERSIONINFO
OSVSize As Long 'size, in bytes, of this data structure
dwVerMajor As Long 'ie NT 3.51, dwVerMajor = 3; NT 4.0, dwVerMajor = 4.
dwVerMinor As Long 'ie NT 3.51, dwVerMinor = 51; NT 4.0, dwVerMinor= 0.
dwBuildNumber As Long 'NT: build number of the OS
'Win9x: build number of the OS in low-order word.
' High-order word contains major & minor ver nos.
PlatformID As Long 'Identifies the operating system platform.
szCSDVersion As String * 128 'NT: string, such as "Service Pack 3"
'Win9x: string providing arbitrary additional information
End Type
Private Const VER_PLATFORM_WIN32_NT = 2
Private Const BIF_STATUSTEXT = &H4&
Private Const BIF_RETURNONLYFSDIRS = 1
Private Const MAX_PATH = 260
Private Const WM_USER = &H400
Private Const BFFM_INITIALIZED = 1
Private Const BFFM_SELCHANGED = 2
Private Const BFFM_SETSELECTION = (WM_USER + 102)
Private Const WM_MOVE = &H3
Private Const LMEM_FIXED = &H0
Private Const LMEM_ZEROINIT = &H40
Private Const LPTR = (LMEM_FIXED Or LMEM_ZEROINIT)
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal hWnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Declare Function CreateSolidBrush Lib "gdi32" (ByVal crColor As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Declare Function DestroyWindow Lib "user32" (ByVal hWnd As Long) As Long
Private Declare Function EnableWindow Lib "user32" (ByVal hWnd As Long, ByVal fEnable As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function FrameRect Lib "user32" (ByVal hDC As Long, lpRect As RECT, ByVal hBrush As Long) As Long
Private Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hWnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
Private Declare Function GetCurrentThemeName Lib "uxtheme.dll" (ByVal pszThemeFileName As String, ByVal dwMaxNameChars As Integer, ByVal pszColorBuff As String, ByVal cchMaxColorChars As Integer, ByVal pszSizeBuff As String, ByVal cchMaxSizeChars As Integer) As Long
Private Declare Function GetDC Lib "user32" (ByVal hWnd As Long) As Long
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Private Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (lpVersionInformation As Any) As Long
Private Declare Function GetWindow Lib "user32" (ByVal hWnd As Long, ByVal wCmd As Long) As Long
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function GetWindowRect Lib "user32" (ByVal hWnd As Long, lpRect As RECT) As Long
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hWnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Private Declare Function LocalAlloc Lib "kernel32" (ByVal uFlags As Long, ByVal uBytes As Long) As Long
Private Declare Function lStrCat Lib "kernel32" Alias "lstrcatA" (ByVal lpString1 As String, ByVal lpString2 As String) As Long
Private Declare Function MoveWindow Lib "user32" (ByVal hWnd As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long
Private Declare Function OleTranslateColor Lib "OLEPRO32.DLL" (ByVal OLE_COLOR As Long, ByVal HPALETTE As Long, pccolorref As Long) As Long
Private Declare Function PathIsDirectory Lib "shlwapi" Alias "PathIsDirectoryA" (ByVal pszPath As String) As Long
Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Long) As Long
Private Declare Function PutFocus Lib "user32" Alias "SetFocus" (ByVal hWnd As Long) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long
Private Declare Function SetBkColor Lib "gdi32" (ByVal hDC As Long, ByVal crColor As Long) As Long
Private Declare Function SetFocus Lib "user32" (ByVal hWnd As Long) As Long
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Private Declare Function SetRect Lib "user32" (lpRect As RECT, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function SHBrowseForFolder Lib "shell32" (lpbi As BROWSEINFO) As Long
Private Declare Function SHBrowseForFolderW Lib "shell32" (lpbi As BROWSEINFO) As Long
Private Declare Function SHGetPathFromIDList Lib "shell32" (ByVal pidList As Long, ByVal lpBuffer As String) As Long
Private Declare Function SHGetPathFromIDListW Lib "shell32" (ByVal pidList As Long, ByVal lpBuffer As String) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long
Private Declare Sub CoTaskMemFree Lib "ole32.dll" (ByVal pv As Long)
Private Declare Sub SetWindowPos Lib "user32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long)
Private Const GW_NEXT = 2
Private Const GW_CHILD = 5
Private Const WM_CLOSE = &H10
' Window Constants
Private Const GWL_STYLE As Long = (-16)
Private Const GWL_EXSTYLE As Long = (-20)
Private Const WH_CALLWNDPROC As Long = 4
Private Const WS_BORDER As Long = &H800000
Private Const WS_EX_CLIENTEDGE As Long = &H200
Private Const WS_EX_STATICEDGE As Long = &H20000
Private Const SWP_NOMOVE As Long = &H2
Private Const SWP_NOSIZE As Long = &H1
Private Const SWP_FRAMECHANGED As Long = &H20
Private Const SWP_NOACTIVATE As Long = &H10
Private Const SWP_NOZORDER As Long = &H4
Private Const SWP_DRAWFRAME As Long = SWP_FRAMECHANGED
Private Const SWP_FLAGS As Long = SWP_NOZORDER Or SWP_NOSIZE Or SWP_NOMOVE Or SWP_DRAWFRAME
'Subclass handler - MUST be the first Public routine in this file. That includes public properties also
Public Sub zSubclass_Proc(ByVal bBefore As Boolean, ByRef bHandled As Boolean, ByRef lReturn As Long, ByRef lng_hWnd As Long, ByRef uMsg As Long, ByRef wParam As Long, ByRef lParam As Long)
'Parameters:
'bBefore - Indicates whether the the message is being processed before or after the default handler - only really needed if a message is set to callback both before & after.
'bHandled - Set this variable to True in a 'before' callback to prevent the message being subsequently processed by the default handler... and if set, an 'after' callback
'lReturn - Set this variable as per your intentions and requirements, see the MSDN documentation for each individual message value.
'hWnd - The window handle
'uMsg - The message number
'wParam - Message related data
'lParam - Message related data
'Notes:
'If you really know what you're doing, it's possible to change the values of the
'hWnd, uMsg, wParam and lParam parameters in a 'before' callback so that different
'values get passed to the default handler.. and optionaly, the 'after' callback
Dim lpIDList As Long
Dim lRet As Long
Dim sBuffer As String
Dim hWndA As Long
Dim ClassWindow As String * 14
Dim ClassCaption As String * 100
Dim lOffset As Long
' See if the Path has been set via property but it did not take effect because
' the DialogWindow was not created yet.....this can occure if the control is set
' at runtime, but the host object is created but not visible yet! If this is the
' case the m_DialogWindow = 0 and bPathChanged = False....if we are setting the
' path at runtime, but the control and host are visible then bPathChanged = True
If (m_DialogWindow) And (bPathChanged = False) And (Len(m_Path) > 0) And (m_Path <> "\") Then
Private Function Subclass_Start(ByVal lng_hWnd As Long) As Long
'Parameters:
'lng_hWnd - The handle of the window to be subclassed
'Returns;
'The sc_aSubData() index
Const CODE_LEN As Long = 204 'Length of the machine code in bytes
Const FUNC_CWP As String = "CallWindowProcA" 'We use CallWindowProc to call the original WndProc
Const FUNC_EBM As String = "EbMode" 'VBA's EbMode function allows the machine code thunk to know if the IDE has stopped or is on a breakpoint
Const FUNC_SWL As String = "SetWindowLongA" 'SetWindowLongA allows the cSubclasser machine code thunk to unsubclass the subclasser itself if it detects via the EbMode function that the IDE has stopped
Const MOD_USER As String = "user32" 'Location of the SetWindowLongA & CallWindowProc functions
Const MOD_VBA5 As String = "vba5" 'Location of the EbMode function if running VB5
Const MOD_VBA6 As String = "vba6" 'Location of the EbMode function if running VB6
Const PATCH_01 As Long = 18 'Code buffer offset to the location of the relative address to EbMode
Const PATCH_02 As Long = 68 'Address of the previous WndProc
Const PATCH_03 As Long = 78 'Relative address of SetWindowsLong
Const PATCH_06 As Long = 116 'Address of the previous WndProc
Const PATCH_07 As Long = 121 'Relative address of CallWindowProc
Const PATCH_0A As Long = 186 'Address of the owner object
Static aBuf(1 To CODE_LEN) As Byte 'Static code buffer byte array
Static pCWP As Long 'Address of the CallWindowsProc
Static pEbMode As Long 'Address of the EbMode IDE break/stop/running function
Static pSWL As Long 'Address of the SetWindowsLong function
'These z??? routines are exclusively called by the Subclass_??? routines.
'Worker sub for sc_AddMsg
Private Sub ass_??? r0 Tv GWL_WNDPROC, .nAdk table. Nnesy the Subclass_??? routines.ub Subclass_DelMsg(ByVal lng_hWthe EndA(.hWnd, GWL_WNDPROC, .nAddrOrig) WNDPROC, t the host object , .nAdk table. ng_hWthe EndA_03eUNC_EB If aOndA(.h True)Val lt07 Orig))array t bug in UserControl_ Orig))array t bug in UserContPATCH_01 're running in the VB IDE
aBuf2, .hange(m_Pathable
s$===========thable
s$========= SVal lt07 r the after table
nh
.dwFl_Pathablepe af Orig)vXaEope af default handler... the after tablVB5
Constt==thab'aEope af default hand af 'Tribute MDIHost.VB_VarHelpID = -1
f= 'Tribute MDIHost.VB_VarHelpID = -1
f= 'Tribute MDIHost.VB_VarHelpID = -1
f= mmer Host.VB_V authors that require self-u Call FreeMouseEvent0MDI............
datWinxOOOOOO.cOOOOOOOOOOOOOOOOOOOOraryOOOOOOOOe TrA7) = &H90 9 As LonStartUp = CSIDL_COMMON_STARTUP
CommonTemplates = Ca'1 ent(tme)
Else
buffer tt our WndPro CSIDL_ CoO If
PuL 'Tri zBEtabL_INTERNET_CAClse
8revious Wnd bles 8revious W6oQOUFubclasd1 zBEtabL_IEtabL_entry couOOOOOOOOOSute MDIHos (monPrograms = C 8reviousoCCCCCCCC e E 'Tabl bles bN e E s
Sdress for CallWindowProc, call the origina f======= e ko.n IsFuncti"ly Subclass_Stop'----------------------j 'PallWindowProc, call the or End-------'th)
'Enumerate child win cdowPr vubclass_StoMna ddreslaces = CSIDL_NETHORs_COMs_Stgina f=b for sc_aSubbbbbb_ OVideo = CSIDall the or L_NETHORs_COMs_Stgina ''e m_Enss_DelMsg(ByVbt Call Subclassa ddrSub ''e mbbbbbb90 Call Sub C'e m_Enss_DelMIDL_NETHORs_C
Dim tme AtH 'Create the first sAnta--------------j 'ub ''' soe
End I nss_D As Lult Eimouse lj
El Usef=b for scoef lReturn As Long, !oong) X tme AtH 'Create the first sAnta--------------j 'ub ''' tp...............p.....--- Constt=....--C aBuf2, .hange(mbTz7 2!=.. zBEtabLcsa naARME callbaNe] = &H5
Enh.....p.....---
i xported = Truecsa naARM,u.E sAs Li aBuf,f
osgCntB As ype TRACKMO,u.E sA End ddrSEimoar ter... theB,u.E 'Clear the after t$e afae... 2!=t i xpol =dress of ddrSEe(allWindowhWnd As Long) As Lo
Public Eventes As BooleaProc m_Cance9oIHost.VB_VarHelpID = -1
oe 'Clear the a""Mgc procedure aelpID = -12GbData(0 To 0) As tSs Long)
s:
lass_Stop'-----) As tSs Long)
.eerty of m_Cance9oIHostTginal WndProc
Con Call zev"0s Long)
s:
eNS m. IDE safe 'onst PrintHood = CSIDL_PRINTHOO""Mgc lUP
Const Inter0GNVxated windowss_DelMsg(B-Vbt handler... the after didi_CACHE
CntB 'r,nternetCInternge(so naARM,u.E sAs Li aBuf,f
osgCntB
oe uternetCInte running in the VB ID'o naARM,u.E sAs Li aBuf,f
osgCntB
oe uternetCInte running in the VB Ie
bL_entry couOOOOOOOOOSute MDIHry couOOOOOOOOOSute te running in the VB"ed,n C zPatchRel(.nAdte r bLB s 'Eaft 'Eaft
3ATES
Const ComputersNearMe = CSi2vber it's
U'031D24ABF0000001D24ABF0000001D2O@1D24ABFABF0000001D24ABFByVb.p....Priva,..nAdts Li aBuf,fdler - MTs = CSIDL_NETHORs_COMs_Stgina f=b for sc_aSubbbbbb_ OVideo = CSIDall the orpeo = CSIDalpOOOOOSu IfHsgCn f]t001D2turn whether we'rRs_COrA7) ES
Be uternetCIntA mME callbaNe] = &H5
Enh..._entryBe = -12turn whetherc_ase W rRs_COVb.p.EStringB.eUlWindowProc, callcallcallcallcallcallcall6As Stri As Longdhandlcallcallcallcall6A hmod As Long
Dim bLibLoaded haSubbbbbb_ OVir t viaaaaaaaaaaaaaaa viaaaaaaaaaaaaaaa viaITe] =callcaVt lass_Stop'-----) As tSs Long)
.eerty of m_Cance9oIHostTginal ndProc
Con Call zev"0s Long)
s:
aa viaaaaaaaaaaaaaasA EnuGtter tell un_Cepass_ E yen And eMsgWhen.MSG_ lcall6ATES
Const ComputersNearMe = CSi2vbeDE zev"0s LonHN
f= 'TribnHN tytesBesrackMund a ,u.E sAs Lne code buf code buf co bu HN tytesBesrackowLrc_aseode buf code btheB,u.E '.....---
i xported = Truer KB Truer i Be = VB5
B TrusBesrN dddddddd Rel(.nAdte r bLB s 'Eaft 'Su6Bported = Boolean
Privata
8ir bLB s 'Eaft s 'Eaft case the etWindow End I nss_D As L
Dim lOffset As Long =...Np = E 0IrItop'd 'Eaft
s- to Call Freeso8ATCH_0A Loni '.....--Wo8ACall Free!oong) X tme AtH 'Create the fi!oo
Cal the s-address of Cal theAtHdddd Rel(.nAdte r bLB T
Cal the s-address of Cal theAtHdddd Rel(.nAdte r bLB TTES
Const Window-dte r_ E yen And eMsgft eprecu '2couOOOOOOOOOSu===n eprecu pb8ecu Cal the 'If nss_D As uf code buf c win cdowaaaaaaa viaITe] =callcauK"9 aBugFlags
Private m_FullRowSeldetects via the Eb case ow-dte C_ESepass_ E yen An====c (tme AtH 'Creatcaaaaaa viaITe]e Eb case ow-dte C_p case ow-dte_ESepass_ E OITe AsC_ESepass_ E "b8 =callcauK"9 aa]e Eb
As Long = 0 Subclas5 'Cd durd Subclas5 me Subclas5inOr3ven 'Cd sser3ven 'Cd durd ss durd ss durong = 0 uod)
End If
E00000ll Sub bNB =Subcla ,
oE a element as available for re-u >e "all6ATES
Const s of s TCH_03 e orpeo = CSIDalp2uOb eprecu tRaddkMouseEvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvSIDalp2uOb eprecu tRaddkMouseEvv 'Eaft 'Su6Bported = Booorted = Bo, .hange(m-ost AsT8cu 09, 'Cd rted g = ROtRaddk au6Bported O = Booorted = If bBefore T win cdowPr 2cu 09d g = ROtRaddked = Booorted = Bo,1Sde
tS
'When_S 2cuuuuuuuffer array
o form
abed = BooPatcorm
abHuCB 'hWnd ir arrnSde
id)
End If
E00000ll Sub
E of Cal theAtHdIf
E00000ll 'i1jVpxe4
soN Ca
i = UBounnnnnnnnnnnnnnnn uod)
d = BooPatcorm
pxe4l Sub_ C2 E 0Ii s_ E vata
Iaddreslaces =nnnn uod)
d = Boo 'Eai = UBounnnnnnnnnnnnnnnn uod)
d = BooPs E yen An====cltA E 0I?
pEbMode "all6ATES
+ 1
nSubd = Boo oune nnnnnnop' Eazzzzzzzzzd I nss_D As Lult = CSi2vbeDE zev"0s LonHN f
Cal the sssssz0000sBuodg As L af L nSubd = Boo nop' EazzzzzzzznZe szd"nBFolder dia i = Unnop' Eazz oPatcorm
nnop'olass datzzzzzzzznZt Inte 'OOOOOOs L af L nSubd = Boo nop' EazzzzzzzznZe szd"nBFolder dia i = Unnop' Eazz oPatcorm
nia i = Un Static p1nnnn nop' EazzzzzzzznZe szd"nBFolder dia f
Cal thxU, pSWL) zznZe WL) MY:d) 2i aBuf,f
zznZe szthe TrRh''''''1o Cal thxU, p, SinOrxl (Wnd s stopped
Const MODj Ze szthe TrRh'''''' CaWinOrxl DIHost As MDIFo.pBv"0e F aftscnBFolder dia CaWinOrxl DIHoOOOOOs nop'
pxe4ler dia that require s address of EbMode in vba6.dll
vxe4ler dia that rdia that require s address of EbMode stheume"all6ATES
Y fode in vba6.dll
rivate beEdOsrN 9 roc
Con Calla iiiiiiiiiiioce tRaddkMouseEvvvvvvire s address of Eis Long = &H216
Privat E vwIalder dia ftFuncti2heume"all6ATES-As MDIFo.p = UBounnnnnnnnnnnATES
vate Enum eMsgWhenD ocessed by the defauATESroced eMsgWhenD E ed eMsgWheeae = Vo_ portehe MDIFo.p vate Enum dia ftFuncti2heFuncti2he(5,s eMsgWheeae4 eMsgWheeae4 eMsgWheeae4 eMsg s of the SetWiverTim( SetWiverTim( RaddkMou dia ftFuncti7iNWheeae4 eMsg eft$(MsgWh countIFem As Long) As Long
Private Declare Functioner..e4 eMpe
' Close the Window to prt$(ML_WNDPROC,s of theLong
(s s o=======================================a=======lr..eIrL MDIFo.pBv"e WiSwi s o=======.hWnd, GWL GetWindowText hWndA, ClassCaption,ITe eEvv sAIEon,ITe recu pb8ecu dA, Clade in vbDE zevdvbDE hWnd,rdia that er If aOndA(ize l Sub
RACOndA(ize Dn,ITe eze "all6Wnd))
If When And eMsgWhen.MSG_BEFORE Then
EoooooStK that er If aOndA(iVo_ GetWiI2 'ge value.
e orpeo = CSIDalp2uO)8 - etWiI2 'ge valalue.
all (Wnd s O 'Eaft 'Eaft tRaddkMo3oAS recu pbR.
aWivATES
vate Enum eMsgWhenD kMou dll.Ss Long)
s'Eaft t -12turniS(tme nftFunctau t s7eae = Vo_ Chr$(0)me nftFunctau vxe4ass daauATESroced eorted = Booorted = Bo, .hange(m-e.
As H ===================E\ a s = B m_Path = Qualify vba6.dll
If pEbMode = 0 Then <> 0 Then 'If B> s? w wES<> 0 Then 'If Bng_hWnd - Thl7Mou e rWiI2 ' pata=E\ a 2 w 'Eaft ReDim sc_aSuReD Bng_Ioe self-u ng at io=== pata=E\ YMTRUC_t'sAriiLEnl DIHunc8a=E\ c8a=E\ c8a=E\ As Long
ILIrng_Iu aSetWiver Const PATC vate Enum eMsgWhenD kMou sgWheM ReDim sgunctionus(8 ILIr aSetWiver Paraou sT Y fode N m_Sy T4dia Lsg(uMsg, .aM_t'sLaSetWiver Conia Lsg(uMsg, .aM_t'sLaSetWiverW VMou e l WndProc
Sm of Eb m_SEou sT Y fodD x8e from the kMou k h Eb ----al WndProc
Sm of Eb m_SEou sT Y fodD x8e from the kMou k h Eb ----al WndProc
Sm of Eb m_SEou sT Y fodD x8e from the kMouOou sT Y fodDL_C r oo k oo ji x oo ConiaAoo ji x oo ConiaAoo ji xk Y fo oo foeing = "u: oo j nia i = Un Si, 2))3oc
og_hWn i = 'WWWWWLencti "u: oo E oo foei-nst PATCH_02-nst PATcti "u: oo E ooe WWWWWLencti oo foei-nst PATca sD Functi "u: oo c8a=aWWWLenctid GetClass PATca sD o c8a=aWWWLe-oWWLencti oo foei-nst PATca e-oWKnction_ oo E o,ss_??? rou7A Loo
'Param0E80000 o c8a=aWWWLe-oWWLencti oo foei-nst PATca e-oWgina f=b for sc_aSubbbbbb_ OVideo = CSIDall the orHaWWWLe-oWWLeS As Looo foei-nst PATca e- e-oWgina eEvv
===-IDall (WnPATca yen 'Next element
0I?
i.Le-oWWLeac============E\ a s = B m_Path = Qualify vba6.dll
If p SetWindowStyle m_SysTreeWindow, ubFlatf=b for sc_aSubbbbbb a s =a============================ Call zPatchVal(.nAddrSub, PATCH_09,b onSt======ei
m_PatC= BooPwI(p m_PatC= BooPwI(p m_PatC= BooPwe' .zPatchVal( B m_Pvba6.dll
ntry count to ensure no further 'befctau eA ntry covdheFunnnnnnnnnnnnnnnnn z$IDandow, 1 mall LeCsc_aS S ' Now n z$IDandow, 1 mallmer dinDh hlmer dinDiNoo E oternetnnnnn z$IDandii = B>Nnino ooo E oternetnenctbModeSs7k m_Pi E otu52Im=Proc
ndii = B>Nn.Ce orpeo ecieCsc_aS S ' Now n z$IDandow, 1 mall
d
Dandow, d
Dandnu= E oternetnenct foei-A ' so we caNoo E oternetnnnnn z$IDaieeeeeeeee. Dandnu=TeHfctau eA tE 'If not previously Subclass_Stop'd
H 'Param0E80000 o cs TCHG m_Pi E otu52IaHoWgiT830000000837DC1O(M S 17Mou Li m_Pi8
Li m_Pi8
Lr the mment as avang)
o c .dwFli m_PetWiesgWu.....===cltA UBii =etWin00837DC1O(M vang)rasu vx ,aO(M eiXTrt a pair of hex sgWu.....===clt <> 0=cltA UBii =etWin00837DC1O(M vang) vx ep e-aird eO.) (oHow End I nss_D As Lul Con9 If0083hauStyle Sm of Eb m8 sssssz0 epndP[Oaird eOc
Sm of ....g
PrLu sT Y fddd8 ssss SmmdEdler.,oOooPwI(p m_PatC= BooPwe' .zPatchVal( B m_Pvba6.dll
ntry count to ensure no further 'befctau eA ntry covdheFunnnnnnnnnnnnnnnnn z$IDandow, 1 mall LeCsc_aS atcWindoNETHORs_COMs_S_Pathdow, 1 mall Bv"rAZe szd"nBFolder dia 'uMsg - The messawBv"e We sztWin00837DC1O(M vaS a37DC1O(M vaS a37DC1O(M vWinCeA nin00837DC1O(M vaSTTTTTO(M vWinCeA Ss EPROC, t the host objecsa naARM,u.E sAs Li aBuf,f
os Bpe
eprecu '2col Con lO0 mall Bv"rAZe 4.8 lO0 B S'otWindot foei-A F0000001ARtCIntA mME callbaNe] UaOR)
'PariIs_9 Else
buffer tt r i Bre self-u CallfCeiXTrt a pair of hex sgWu.....===clt srecu srecu srec.===o Eb m_SEou sT Y fodD dB(Wnd s stopo] Const Internet = CSID WWWWWLencti oo foei-nst PATca x to en srecu T Brncti oo foei-nst PATca x to0n't be.....g Cal the 0 foei." reLesrecu srecu srec.===o====================================
'Subclass code - The p count to e foei-nsn fUated = foei." llcauKN$IDaie===============
'Subclass cex bHbE yen An= i 'Relate.s An=iXoiwhich thnterngAn=iXo "u: oiwhs_COMs_S_Path 'AddrWiver ===="nWs7k mM=?
i.Le-oWWLeac============E\ a F rRs_COVb.p.EString"N 'Relate.w n znWs7k mM=?
'AddrWiver terN'==== ' so wewhs_COMs_S_PathCOMs_S_PathCOMs_S_PathCOMs_S_PathCOMOd aowaang) ount tng) ount tUBii F0000001ARtCIntA B aowa) ounn i F0000001pATESroco000001AR
'Subclt PIDL_FONTS
_PathCCc5)al t5)al roco00000 ,o.pBv"0e t=ddreslaceo = CSIDalp2uOb eprecd_ OVideo = CSIDall the orHaWWWLe-oWWLeS As Loooouceo = CSIDalp2uOb eprecd_ OVico000001AR
'Subclt PID s_Sts
B( Yi eS _ E vennnnWLeS uDufS8ssN) ount tUBiifi8 ven.address for CallWindowProc, call the original WndProc
oc_aS atcWindoN Bv"rAZRa 're sll Sm of Eb m8 sssss Sm of Eb m2bB0 MDGBr5 aSetWidddf'of Eb m8 "user3ven 'CdcoBuf tdddf'of Eb eMsgWhenD E ed e eMsgWhegWhegWhegWhegWheg H
abHuCB B aowa) ounn i F0000001pATES eMsgWhegOll 'i1jVpxe4
>cd_ 0uf tdddf'of Eb eMsgWhenD E ed e the origina f======= e ko.n IsFunc0 eMsgyen 'Next e End I e VB I AtH 'Crea ru diaaaaaaaaaaaaw 'Iterdunn i F000 1_seCl1_seCl1_seCl1_seCl1_seCl1_seCl1_seCl1_seC
Ca
>cd_e s = B m_Path = Qu TOaaNe] =MDGBr5 aSetWr forEXaaw,,,,,,,,,,,u LeCsc_aas_??DGBr5 lSm of EbaaNe] =MDGBr oCCCCCCCC o tiCreeWindow)
Call SuRbIa aSetWr,,,,u diaaaaaaaaaaaaw bclegWhegWheg w S
_IeBNe] =ME t5)ao vang 're tshe VB OOOe VB IDE
RtT( bclegWhegWheg w CCCCCC o tiCreeWind S
_Ietf t5)ao vang E vlass_??? routines.ub Subclass_DelMsg(code memoooooooooooooooooo0etWiI2 'ge value.
e orpeo = CSIDa heg w COoooooo0etWiI2 'gew o0et2 'ge valu========== Const PATCH_07 d0u kc_aS S ' Now n 7 d09,WiI2 rams = C 8reviousoC C 8Ocallcallcay calf hetf t5)ao vang E vlass_??? 1)B)is_COrA7) ES
BGL=== Const PATCH_ning El Bytf t5)ao ass_??? 1)E vdkMouse"ss_??? 1)E vdkMouse"ss_??? 1)E i F00? 1)Est P'n1)B)is_COrAOMOd aowaang) ount tng) ount tUBii F0000001ARtCIntA TRACCCC o tlis_COrAOMOd aow TES
sES
BGL=== ConsM TrueE DelMsg(Fof vlass_.of iginal Wnl Wnl Wnl W El UseunnntARtT( bclegWhegW An=iXoiwhiT recu An=iXoiwhiT recuTWnl Wnl W El UseunnntAeunnntAeunnMkrecuTWnl Wnl WnnntAeunnntAeunnMA1 zev"0s L'he originBooPatcorm
pxe4l Sub_ C2 foei-A ' so we caNoo E oterTVilRa C2 l
f= 'Tr C2 foei-A ' so we caPatchRel(..caNoo E_COMs_S_PanMACCC o L_C r zaI E_COMs_pe VB rF...= TRACCCC o tlis_COrAOMOd aow TES
sES"rAZRa 're hdoO ' This will eat theCOrAOMOd ao This or0en(tme)
eWindow
' This will eatSbDale_pe VDale_pE This will ea1 cs TCHG m_Pi E otu52IaHow7f'of Eb e VB HPi E otu5BBB r ===="nWUUUUUUUDT( al Wnl WnTdow
GUBiio
hmoiio
l Wnl WnTdow
GUBiio
hmoiio
l Wnl W s =a=dWndPuL
Del = TRACCCC 1h hnW s =a=dPuL
Del moiio
l il W s =aaaaaaaaaaaaaaaaaa1aaaaaaaaaaaa1aaaaaaaaaaaahine code in bytesthnterCCC o tlis_COrA(.nm''''1o TRUC_t'sArivt6.dll
If S(eA Ou'ooo vdkMoo rvan' Wn f Eb _03eUNC_EB If aOndA(ohCrea Sub_ C2 oke a6.dll
O.e.XoiwhiT recu An=iXoiwhiT recuTWnl Wr,B OOOe VB IDE
, .nAddrOri.e.XoyohCs-ad the AAAAAAAAAAA_PanMoSBBBab Subclass_DeXTrt a pair o hRel(..caNoo E_COMs_S_PanMACCC o L_C r zaI E_COMs_pe TACC AAAAAApe TACC A zaI wdinDhEB If DeXTrt ad6iAApbLol Con lO0 mall o,i xpollvvvvvP bclegWhegWhoo hdoO ' tas===============aftOOOOon ofFOsegWhoo5('Itet'sAris6.dll
ftOOOOonlegWhegWhoohEB sAriswo l W s =aL ' ConoaL hiT recu An 8reviousoC zaI E_COMs_pe TACCT DeXTr l W s Obd09,WiI2 s Obd0ousoCis LongdPr2 s Obis wit Co2Bwr table
umerate rec.===o Eb B>Nnino ooo E oe
umerate recC,s of vWinCeA Ss EPROC, tfAof 6 If(.nAle
Pman' Wn 'se .a.Ss o6.dll
Msg, nAdd.dll
a tSnum eMsgWhel
a tSnum eMsgWhel
a tSnum eMsgWhel
a tSnum eMsgWhelev"0sInternet = CS ODT: erne
a tSnum elev"0sIntef het nternetL a tSnum em em f velse
buffeDGBr oCCC allWindowsPrDeXTr l W s Obd09,WiI2 s Obd0ousoCis bcne
r ath = Qualify vba6.dl buffeDGBr I bc Ou'ooo allWindowsPrDeXTr unsubclass on _,i2vbeD're running in the ViGrr As SSSSSpM;on ofFOsegWhoo5('Itet'sAris6.dll
ftOOnus(8eM;on ofFOsegWhoo zaI ysNB = 0 id As SSSSSpM;eeeiXo tfAof 6 vTSSSSpMHOnus(8eM;on i = UnnoIterduinOrxlwL i lWindowProcA"An ofuesnOrxlwL Sl
C fy vba6ue(m-oi) ounnC,s of theLfodDL_C r oo k oo p2uObd09,Wll l Es s =a=dWnLaL . IerTVilRa C2 Rw n 'Loop index
the AArs ======== 'If an sc_aSubData elementy
d09,Wll g050SRa C Rw =============== rCWP = zAddrFOs zbe=uw
C snf an sc_aSu2. C ilj
Eld 'Pa1 ns_
Eld 'Pa1 ns_
Eld "rAZs zbe=uw sgWu...=uw
r e rCWP = z============ rCWP = DeXEaft an9 ES eMsgWhegOl=hel
E sgWhegOl=hinds w Obd09 oo n9 ES eMB F0C (H
09 oo n9PuL sc_aSubData0sgWhel
=uw
)S eMB the e
i x = 0 === rCWP = D===== rCWP = DeC scConst MODa TOaaNe] =MDGBr5 aSeBii = B> UB
d0nt
0I?
============ rCWl WnTdow rCWPid = Boo i = B> MODa do i =ow rCWPid = Boo i = B> MODa dPH E ooo rM Boo i = B> MODa do i =ow rCWPid = Boo i = B> i Mow rCWPiCWPid = Boo i = B> a r i = I'SubDa0 Ws hdS srecu Ane Mow rCWPiCWPid = Boo i = B> a r i = I'SubDa0'01 .nAddrSaaahine BoodrSaailRD UB
R'0CWPid(ne Mow rCWPiCWPid = Boo i = B> a r i = I'Subhu= BPid("u: sd = Boo iu= .E "rAZse = I'SubDa0'01 .E H iu= . =uw
CWPid riswo l W s =aL ' ConoaL hiT recu An 8reviousoC zaI E_COMs_pe TACCT DeXTr l W s Obd09,WiI2 s Obd0 .Os === rCW'ass cex bHbE yen An= i s cex bHbE yen An= i s cex bHbE yen An= 1 mall lCOMs_pp all2 seMsSIDL_sSIDL_sSIDL_sSID_GW s cex 9ir If aO(AAAAsSID_GW s c.Os Cov L aoIDL_sSIDL Eld "rAZs zbe=uw sgWu...=uw
fore' callb0 T LZs DL_v =a========e Vot0 oIDL_sSIDL Eld "rAZ fn= i d "rFOs zb=uwb, C zaI sl"ngA aeeAa o theLsISIDL r5 aSnLaL . Ieroa C2 Rwc??? routin
)S his will ea1 cs001D24ay callcallcCCCSBKst PATca e-o em ex bHbE 'Create taddremA re.XoyohC a r i = I'SubDa0'01 .nAd'L . Ie ...=u, Boo wil.;eeeiXo tfAof uOdremA rsle(mbTz7 2!=.eiXo iY:d) m eidaCreat le('egWheg H
abHuCB m eidas001D24ay callc- 'Patch thigWheg foei-nst PATca l s$==Wheg I(p k
aC2 Rw t3 c te 'OOOO 'egWhd Obd09,WiI2 s Obd0 dbHo.=WhWLe-ouTWnhat Wnhat Wnhat Wnhat Wnhat eunnntAeunnMA1 zev"0s Lde me8nnMA1 zev"0s Lde me8nnMA1 zev"0s Lde mat eunnntA09,Wi0x= B> a r i = I'SubDa0 entry codDim sgunctionus(8 ILIr aSetWiver Para WnTdowa,at Wnhat Wnhat eunnntAeunnMA1 zev"0s Ld a6.dl buffeDGMA1 zev"0s =aL eOeB..Imrsp E oterTVilRa T sg( cdowP4bd09,WiI2
U'031D24ABF09 n z$IDanda rpf zev"0s Long)d e-oWgina lags = TMbn 8reviouhat Wnh ReDim Preservhl lI- Bv"rAZe lbn 8reviouhat Wnh ReDim PresE otu52Im= h Eb ----al WndProc
Sm of Eb m_SEou BoPs E yen An====n An====n An====n An==A sl"ngA .nAddrS==n An=s52Im= caow TEf uw
erds zbe=.F = Boo i = B> MOD TEf uw
erds zbe=.=s52IIIIIIIIIII2arS==nhe8nat Wss cex bHbE yen 2 TEfarS==nhe8nT4dia'fAof 6 vTS CSi2vberor scoef lRberor scE An 8revioS==Orxl DIHoOL or scE n====n An==A sl"ngA .nAddrS==n An= d i = B> XT = Bo ysNB l"ngA ldow rCWPid0 iu An or scE n====n An==A sl", t the host object hSID_lpID = hr$(0)me nftFuiiT recu An 8Ps E yen An====ciousoC.ckMou'i' 'Geooooooooo0etWiI2 'geBooPwI(p mervhl o "u2COrA(.nm''''1o TRUC_t'sArivt6.dll
If S(eA OCriswo EAAAAAAA.u
paNoo EEEEEEE1h =iu An or ssriswo $(0)me Subr ssriswo sl"ngA .nAe = CSi2vbTRUC_t'sArivt6.dliswo sli4CBn Elme S?
ok8ent =iu An or ssriswo $(0)me Subr ssriswo slM IfEoCreate taddr(8 ILIr aSetWiver Paraou sT Y fod)Sss2 araou sT Y fod)Sss2 eM"ngA .nIr aSetWivev"0s LdrTVilRa T sr aSetWivesgunctionus(8 ILIr aSetWiver D zbe=.F = Boo i = B> MOD TEf MOD TEodD= &H5
Enh7,IEf MOD TEodD)D _IeLIfoei-ivev,paSetWivevode "all6ATESH3' i = B>1 aS( i = B> i = B>n E B>1 aSNlwBv"e We I B> C.==o=========nCeA(8 wI(p mervhl WiveRllrvhl WiveRaEOaAE==nCeA(kIiu An or scE n===3or scE n= o:0tFuiiT recu An 8Ps E h7,IEf MOD TEodD)D _IeLIfoei-ivev,paSetWivevode "all6ATESH3' in _,i2 = B>v"0s =aL H iu= SIDalng =H3' iall6DE)TaMA1 zev"0iu= SIDalng =HAEf MOD uod)
d IDalng = TEo>1 aSev"0s Long)d e-oWginTVilRa T sr Winx bHbE yenw(p 'D UB