Sorry für die späte Antwort.
Da der externe Link leider inzwischen offline ist, hier noch mal die Version 0.41:
Code: Select all
; TC_CD-PopUpDialog.ahk V0.41 (W) StatusQuo 2008
;
; pops up a dialog every time a directory is changed,
; optionally only for network paths + network drives
;
; http://ghisler.ch/board/viewtopic.php?t=19065
#SingleInstance force
#Persistent
Debug := 0
boNetPathsOnly := 1
sMsgBoxText := "Verzeichnis gewechselt nach:"
iMaxMsgPath := 20 ; maximum number of sMsgPath-variables
sMsgPath1 := "u:\"
sMsgPath2 := "w:\tmp\"
sMsgPath3 := ""
sMsgPath4 := ""
sMsgPath5 := ""
sMsgPath6 := ""
sMsgPath7 := ""
sMsgPath8 := ""
sMsgPath9 := ""
sMsgPath10 := ""
boPopupRestrictDirFound := "0"
Loop, %iMaxMsgPath%
{
if (sMsgPath%A_Index% <> "")
{
boPopupRestrictDirFound := "1"
boNetPathsOnly := "0" ; deactivate limiting to net-paths when limiting to specified dirs (prevent interfering)
Break
}
}
SetTitleMatchMode, 1
SetTimer, l_PopupCheck, 100
Return
l_PopupCheck:
f_PopupCheck()
Return
f_PopupCheck()
{
IfWinNotActive, ahk_class TTOTAL_CMD
Return
global sLastPathLeft, sLastPathRight, sLastTitle
, sActPathLeft, sActPathRight
, sMsgBoxText, iMaxMsgPath
, boNetPathsOnly, boPopupRestrictDirFound
, Debug
; === get active paths from TC window
DetectHiddenText, Off
sActPathLeft := ""
sActPathRight := ""
WinGetText , sWinText , ahk_class TTOTAL_CMD
Loop, Parse, sWinText , `n
{
; === find + store path from TC window text
if not ( (SubStr( A_LoopField, 1, 2 ) = "\\")
or (SubStr( A_LoopField, 2, 2 ) = ":\") )
Continue
if (sActPathLeft = "")
{
sActPathLeft := A_LoopField
Continue
}
sActPathRight := A_LoopField
Break
}
; === TC multiple instances: no MsgBox after switching to another TC instance
WinGetTitle, sActTitle, ahk_class TTOTAL_CMD
if (not (sLastTitle = sActTitle))
{
sLastTitle := sActTitle
sLastPathLeft := sActPathLeft
sLastPathRight := sActPathRight
Return
}
sTcPanel[1] := "Right"
sTcPanel[2] := "Left"
Loop, 2 ; TC left + right panel
{
sTcPanel := sTcPanel[%A_Index%]
; === MsgBox only for specified paths
iLoopCount := "0"
Loop, %iMaxMsgPath%
{
; sometimes popups on the left are deactivated, as long as on the right a local/unwatched path is displayed
; not 100% reproducible yet
if (sMsgPath%A_Index% <> "")
{
boPopupRestrictDirFound := "1"
boNetPathsOnly := "0" ; deactivate limiting to net-paths when limiting to specified dirs (prevent interfering)
; if ( (InStr(sLastPath%sTcPanel%, sMsgPath%A_Index%) > 0)
; or (InStr( sActPath%sTcPanel%, sMsgPath%A_Index%) > 0) )
; IfInString,
sTmp := sMsgPath%A_Index%
if ( (InStr(sLastPath%sTcPanel%, sTmp) > 0)
or (InStr( sActPath%sTcPanel%, sTmp) > 0) )
{
Break
}
}
iLoopCount := A_Index
}
if (iLoopCount = iMaxMsgPath) and ( boPopupRestrictDirFound <> "" ) ; Popup restrict dirlist is specified, but doesn't contain active/last dirs
{
Continue
}
; identifying general network drives does NOT work with user defined filter, only while displaying *.*
DriveGet, tActDriveType, type, % SubStr( sActPath%sTcPanel%, 1, InStr( sActPath%sTcPanel%, "\*.*")-1)
DriveGet, tLastDriveType, type, % SubStr(sLastPath%sTcPanel%, 1, InStr(sLastPath%sTcPanel%, "\*.*")-1)
if ( (SubStr( sActPath%sTcPanel%, 1, 2 ) = "\\")
or (SubStr( sLastPath%sTcPanel%, 1, 2 ) = "\\") ) ; only show if a network path is involved (UNC)
or ( ( tActDriveType = "Network")
or (tLastDriveType = "Network") ) ; only show if a network path is involved (mapped/universal)
or ( boPopupRestrictDirFound )
or not ( boNetPathsOnly )
{
if not (sLastPath%sTcPanel% = sActPath%sTcPanel%) ; path was changed - show MsgBox
{
sLastPath%sTcPanel% := sActPath%sTcPanel%
if (InStr(sActPath%sTcPanel%, "\*.*")) ; remove suffix "*.*" in displayed string
sPathDisplay := SubStr(sActPath%sTcPanel%, 1, InStr(sActPath%sTcPanel%, "\*.*"))
else
sPathDisplay := sActPath%sTcPanel%
MsgBox, %sMsgBoxText%`n`n%sPathDisplay%
Continue
}
}
}
}