Windows 10 / Using WinItemize how can I tell that a window is a Directory

Started by mxbsuper, July 18, 2017, 02:49:47 AM

Previous topic - Next topic

mxbsuper

Hi There All,

Does anyone know of a way to tell if a window on a Windows 10 machine is a Directory.

I used to be able to use the WinItemize command and the following bit of script to identify all of the windows that were open and that were Directories viewing a file system.

The changes in the way Windows 10 presents information to the WinItemize command has broken my script where I used to detect the "\\" in the extracted items, this no longer works. The "\\" is no longer present.

Please advise?

Regards

mxbsuper


mywind=""
allwins = WinItemize( )
n = ItemCount(allwins, @TAB)

for a = 1 to n
   test=ItemExtract(a,allwins,@TAB)
   if DirExist(test) && StrIndex(test,"\\",1,@FWDSCAN)==0 then
      mywind=Strcat(mywind,test,@TAB)
   endif
next a

if mywind=="" then exit


JTaylor

If you have File Explorer set to show the full file path in title bar it should show...assuming those are the Windows of which you speak?

Jim

td

Windows Explorer has had the option to "Display full path in title bar" since at least Windows XP.  So if you are referring to a "File Explorer" - Windows 10 speak - window,   your problem has nothing to do with Windows 10 and everything to do with whether or not the display path option is enabled.

Your only options are to make sure the  "Display full path in title bar" is enabled or walk the window hierarchy to find the "ToolbarWindow32" child window that displays the full path in File Explorer and check its Window text.   Roboscripter and/or the analyze.wbt script should be of help with the latter approach.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

td

RoboScripter output on Window 10:

Code (winbatch) Select
:RoboScripter
; Made with
;   RoboScripter ver: 45
;   CtlMgr ver: 44040
AddExtender("wwctl44i.dll")

;Title: Address: \\INTREPID\WinBatch
;ID: 1001
;Class: ToolbarWindow32
;Level: 7

; Default cWndByWndSpec seems OK here
window1=cWndByWndSpec("CabinetWClass","explorer",7,0,0,0,0,0,0,0)
; window1=cWndByWndSpecName("\\INTREPID\WinBatch","explorer",7,0,0,0,0,0,0,0)
; window1=DllHwnd('\\INTREPID\WinBatch')
window2=cWndByClass(window1,`WorkerW`)
; or window2=cWndBySeq(window1,5)
window3=cWndByID(window2,40965)
; or window3=cWndByClass(window2,`ReBarWindow32`)
; or window3=cWndBySeq(window2,1)
window4=cWndByID(window3,41477)
; or window4=cWndByClass(window3,`Address Band Root`)
; or window4=cWndBySeq(window3,3)
window5=cWndByID(window4,0)
; or window5=cWndByClass(window4,`msctls_progress32`)
; or window5=cWndBySeq(window4,1)
window6=cWndByClass(window5,`Breadcrumb Parent`)
; or window6=cWndBySeq(window5,1)
ControlHandle=cWndByID(window6,1001)
; or ControlHandle=cWndByName(window6,`Address: \\INTREPID\WinBatch~`)
; or ControlHandle=cWndByClass(window6,`ToolbarWindow32`)
; or ControlHandle=cWndBySeq(window6,1)
result=cWndInfo(ControlHandle,0)     ;Reads the title/text of a control
Message("Window Title/Text",result)     ;TODO - Remove Message.  Add code.

"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade