Если под ним не папка - ничего не покажет.
Add(MainForm,2953706,1050,497)
{
Width=624
Height=543
Position=1
}
Add(WinTools,8069714,462,273)
{
Point(FileName)
link(Handle,1256701:Var2,[])
}
Add(Hub,13023499,182,392)
{
OutCount=3
link(onEvent1,3172031:In,[])
link(onEvent2,13905471:In,[])
link(onEvent3,5463590:doEnum,[])
}
Add(LineBreak,12462570,1134,266)
{
Primary=[3172031,-924,126]
}
Add(WinEnum,5463590,252,406)
{
Point(ClassName)
link(onFindWindow,15752195:doWinInfo,[])
}
Add(LineBreak,7389359,252,497)
{
Type=1
link(Data,9131568:Var2,[])
Primary=[13533433,210,-266]
}
Add(FormatStr,7761820,462,406)
{
DataCount=3
Mask="%1 - %2 - %3"
link(onFString,12787633:doEvent,[])
link(Str1,8069714:CaptionText,[])
link(Str2,4295966:Var,[])
link(Str3,5931055:Var2,[])
}
Add(GetDataEx,1256701,462,252)
{
link(Data,13533433:Var,[])
}
Add(LineBreak,790752,259,462)
{
Type=1
link(Data,11236176:Var2,[])
Primary=[4295966,210,-84]
}
Add(Application,4921680,392,427)
{
}
Add(IndexToChanel,12787633,560,406)
{
Point(Index)
link(onEvent2,13426269:doCompare,[])
link(Index,7756955:State,[])
}
Add(Switch,7756955,560,364)
{
DataOn=Integer(1)
DataOff=Integer(0)
Point(doOn)
Point(State)
}
Add(LineBreak,11254744,518,371)
{
Caption="0"
link(Out,7756955:doReset,[])
Primary=[13905471,-308,28]
}
Add(If_else,9788105,392,497)
{
link(onTrue,13377399:In,[])
link(Op1,4921680:AppFileName,[])
link(Op2,3050565:Var,[])
}
Add(LineBreak,3605892,469,329)
{
Type=1
link(Data,5590406:Var2,[])
Primary=[3050565,-70,140]
}
Add(Hub,2571492,350,406)
{
link(onEvent1,7761820:doString,[])
link(onEvent2,9788105:doCompare,[(378,419)(378,503)])
}
Add(LineBreak,7889114,518,378)
{
Caption="1"
link(Out,7756955:doOn,[])
Primary=[13377399,-84,119]
}
Add(If_else,13426269,616,413)
{
Type=5
link(onTrue,3135501:doEvent,[])
link(Op1,5590406:Var3,[(622,320)])
link(Op2,766673:AppFileName,[])
}
Add(Application,766673,623,364)
{
}
Add(GetDataEx,5590406,469,315)
{
link(Data,8069714:FileName,[])
}
Add(InlineCode,16564328,917,420)
{
@Hint=#52:Некоторая работа с открытыми окнами Windows Explorer|37:Автор: 3042. Версия 1.0 от 2.10.2020.|
WorkPoints=#84:doEnum=Перечисляет открытые папки Windows Explorer, выдавая сведения на нижние точки|99:doGetDataByHandle=Получает сведения об открытой папке по идентификатору, выдавая их на нижние точки|89:doNavigate=Открывает в папке с идентификатором dtHandle адрес dtAddress (типа C:\Windows)|
EventPoints=#106:onEnum=Происходит всякий раз при нахождении очередного открытого окна Windows Explorer, выдавая его handle|
VarPoints=#36:varLocationURL=Путь к открытой папке|38:varHandle=Идентификатор открытой папки|
DataPoints=#22:dtHandle=Идентификатор|15:dtAddress=Адрес|
Code=#54://Некоторая работа с открытыми окнами Windows Explorer|39://Автор: 3042. Версия 1.0 от 2.10.2020.|15:unit HiAsmUnit;|0:|9:interface|0:|48:uses kol,Share,Debug,KOLSHDocVw,ActiveX,windows;|0:|74:const CLASS_ShellWindows:TGUID = '{9BA05972-F6A8-11CF-A442-00A0C90A8F39}';|73: IID_IShellWindows:TGUID = '{85CB6900-4D95-11CF-960C-0080C7F4EE85}';|0:|4:type|37: IShellWindows = interface(IDispatch)|46: ['{85CB6900-4D95-11CF-960C-0080C7F4EE85}']|43: function Get_Count: Integer; safecall;|60: function Item(index: OleVariant ): IDispatch; safecall;|43: function _NewEnum: IUnknown; safecall;|110: procedure Register(const pid: IDispatch; HWND: Integer; swClass: SYSINT; out plCookie: Integer); safecall;|74: procedure RegisterPending(lThreadId: Integer; var pvarloc: OleVariant;|109: var pvarlocRoot: OleVariant; swClass: SYSINT; out plCookie: Integer); safecall;|49: procedure Revoke(lCookie: Integer); safecall;|78: procedure OnNavigate(lCookie: Integer; var pvarloc: OleVariant); safecall;|73: procedure OnActivated(lCookie: Integer; fActive: WordBool); safecall;|95: function FindWindow(var pvarloc: OleVariant; var pvarlocRoot: OleVariant; swClass: SYSINT;|87: out pHWND: Integer; swfwOptions: SYSINT): IDispatch; safecall;|74: procedure OnCreated(lCookie: Integer; const punk: IUnknown); safecall;|63: procedure ProcessAttachDetach(fAttach: WordBool); safecall;|43: property Count: Integer read Get_Count;|6: end;|28: THiAsmClass = class(TDebug)|10: private|27: FStrLocationURL:string;|21: FIntHWND:integer;|31: ShellWindows:IShellWindows;|25: CurrWin:IWebBrowser2;|26: EmptyParam:OleVariant;|9: public|23: dtHandle:THI_Event;|24: dtAddress:THI_Event;|21: onEnum:THI_Event;|0:|23: constructor Create;|47: procedure doEnum(var dt:TData; index:word);|58: procedure doGetDataByHandle(var dt:TData; index:word);|51: procedure doNavigate(var dt:TData; index:word);|55: procedure varLocationURL(var dt:TData; index:word);|50: procedure varHandle(var dt:TData; index:word);|5: end;|0:|14:implementation|0:|31:constructor THiAsmClass.Create;|5:begin|18: inherited Create;|34: FStrLocationURL:=''; FIntHWND:=0;|4:end;|0:|71://----------------------------Внешние точки----------------------------|29:procedure THiAsmClass.doEnum;|14:var i:integer;|5:begin|35: FStrLocationURL:=''; FIntHWND:=0;|97: CoCreateInstance(CLASS_ShellWindows, nil, 1+2+4 {CLSCTX_ALL}, IID_IShellWindows, ShellWindows);|43: for i:=0 to ShellWindows.Count-1 do begin|51: CurrWin := ShellWindows.Item(i) as IWebBrowser2;|96: if LowerCase(Copy(CurrWin.FullName,Length(CurrWin.FullName)-11,12))='explorer.exe' then begin|43: FStrLocationURL := CurrWin.LocationURL;|29: FIntHWND := CurrWin.HWND;|37: _hi_OnEvent(onEnum,CurrWin.HWND);|7: end;|6: end;|32: //_debug(CurrWin.LocationURL);|19: //CurrWin.GoBack;|28: //CurrWin.Visible := true;|4:end;|0:|33:procedure THiAsmClass.doNavigate;|16:var i,h:integer;|13: s:string;|5:begin|35: FStrLocationURL:=''; FIntHWND:=0;|32: h := ReadInteger(dt,dtHandle);|32: s := ReadString(dt,dtAddress);|38: if not DirectoryExists(s) then exit;|97: CoCreateInstance(CLASS_ShellWindows, nil, 1+2+4 {CLSCTX_ALL}, IID_IShellWindows, ShellWindows);|43: for i:=0 to ShellWindows.Count-1 do begin|51: CurrWin := ShellWindows.Item(i) as IWebBrowser2;|121: if (LowerCase(Copy(CurrWin.FullName,Length(CurrWin.FullName)-11,12))='explorer.exe') and (CurrWin.HWND = h) then begin|68: CurrWin.Navigate(s,EmptyParam,EmptyParam,EmptyParam,EmptyParam);|10: break;|7: end;|6: end;|4:end;|0:|40:procedure THiAsmClass.doGetDataByHandle;|16:var i,h:integer;|5:begin|35: FStrLocationURL:=''; FIntHWND:=0;|32: h := ReadInteger(dt,dtHandle);|97: CoCreateInstance(CLASS_ShellWindows, nil, 1+2+4 {CLSCTX_ALL}, IID_IShellWindows, ShellWindows);|43: for i:=0 to ShellWindows.Count-1 do begin|51: CurrWin := ShellWindows.Item(i) as IWebBrowser2;|121: if (LowerCase(Copy(CurrWin.FullName,Length(CurrWin.FullName)-11,12))='explorer.exe') and (CurrWin.HWND = h) then begin|43: FStrLocationURL := CurrWin.LocationURL;|29: FIntHWND := CurrWin.HWND;|6: //|10: break;|7: end;|6: end;|4:end;|0:|0:|37:procedure THiAsmClass.varLocationURL;|5:begin|31: dtString(dt, FStrLocationURL);|4:end;|0:|32:procedure THiAsmClass.varHandle;|5:begin|25: dtInteger(dt, FIntHWND);|4:end;|0:|4:end.|
link(dtHandle,5931055:Var3,[(923,257)])
}
Add(Hub,9118271,714,420)
{
InCount=2
link(onEvent1,11409832:In,[])
link(onEvent2,12426505:doModify,[])
}
Add(LineBreak,10383592,210,420)
{
link(Out,5463590:doStop,[])
Primary=[11409832,532,0]
}
Add(GetDataEx,5931055,476,252)
{
Angle=3
link(Data,1256701:Var3,[])
}
Add(Replace,12507234,917,497)
{
SubStr="file:///"
link(onReplace,6766780:doCharset,[])
link(Str,16564328:varLocationURL,[])
link(Dest,16449787:Text,[])
}
Add(VisualStrings,16449787,931,462)
{
}
Add(Charset,6766780,959,497)
{
Type=11
link(onCharset,1496919:doReplace,[])
}
Add(Replace,1496919,1001,497)
{
SubStr="/"
DestStr="\"
link(onReplace,2953706:doCaption,[])
}
Add(Timer,4837248,133,392)
{
Interval=100
AutoStop=1
link(onTimer,13023499:doEvent1,[])
}
Add(WinInfo,15752195,301,406)
{
Point(IsZoomed)
link(onWinInfo,2571492:doEvent1,[])
link(Handle,4832204:Var,[])
}
Add(If_else,12610835,833,427)
{
Op2=String(cabinetwclass)
link(onTrue,7328468:doEvent1,[])
AddHint(-38,-51,92,13,Op2)
}
Add(LineBreak,15607647,266,497)
{
Type=1
link(Data,9131568:Var3,[(272,488)])
Primary=[4832204,35,-119]
}
Add(GetDataEx,9131568,252,483)
{
link(Data,5463590:Handle,[])
}
Add(LineBreak,6563994,273,462)
{
Type=1
link(Data,11236176:Var3,[(279,453)])
Primary=[15792994,511,-63]
}
Add(GetDataEx,11236176,259,448)
{
link(Data,5463590:ClassName,[])
}
Add(StrCase,12426505,784,427)
{
link(onModify,12610835:doCompare,[])
link(Str,15792994:Var,[])
}
Add(IndexToChanel,3135501,665,413)
{
Count=3
Point(Index)
link(onEvent2,9118271:doEvent1,[])
link(Index,14394130:Var,[])
link(onEvent3,9118271:doEvent2,[])
}
Add(LineBreak,9674222,315,448)
{
Type=1
link(Data,15752195:IsZoomed,[])
Primary=[14394130,350,-63]
}
Add(Hub,7328468,882,427)
{
link(onEvent1,16564328:doGetDataByHandle,[])
link(onEvent2,12507234:doReplace,[(906,440)(906,503)])
}