[No Bug] 6.11 B3 won't compile same code as 6.10
Posted: Sun May 26, 2024 12:25 pm
This doesn't compile in 6.11 B3 but does with 6.10:
Code: Select all
Global folderlist$
Procedure GetAllOpenFolderPathsProc(hWnd,lParam) ; https://www.purebasic.fr/english/viewtopic.php?t=84380
Static NewMap hWnd()
If Not FindMapElement(hWnd(),Str(hWnd))
GetWindowThreadProcessId_(hWnd,@PID)
cap$=Space(999) : GetWindowText_(hWnd,@cap$,990)
cl$=Space(999) : GetClassName_(hWnd,@cl$,990)
If FindString(cap$,"Address: ") And cl$="ToolbarWindow32" ; Win 10 and lower (due to no tabbed folders).
folderlist$+Mid(cap$,10)+#LF$
ElseIf cl$="ShellTabWindowClass" ; Win 11 folder NAMES only, because Win 11 doesn't have an "Address: " field for folder paths. :(
folderlist$+cap$+#LF$
EndIf
hWnd(Str(hWnd)) ; <- SYNTAX ERROR ON 6.11 B3 but not on 6.10
EndIf
EnumChildWindows_(hWnd,@GetAllOpenFolderPathsProc(),lParam+1)
ProcedureReturn #True
EndProcedure
Procedure.s GetAllOpenFolderPaths() ; Win 10 or lower only due to not have tabbed folders.
folderlist$=""
EnumChildWindows_(GetDesktopWindow_(),@GetAllOpenFolderPathsProc(),0)
ProcedureReturn folderlist$
EndProcedure
GetAllOpenFolderPaths()