Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SHDocVw.WebBrowser navigating file/folder does not output selected
#1
The below code shows your mydocuments folder and when a file or folder is selected it's path will be displayed in the output window of QM.

In a more complex project I have the problem that selected file/folders are not beeing displayed in the output when you are not in the root of $personal$. If you are in the root of $personal$ then selected files or folders are displayed correctly in the qm output. The problem occurs when:
- Once you navigate down within $personal$ the selected file/folder is not displayed in the qm output window.
- Also if you navigate down within $personal$ and go back to the root of $personal$ then the selected file/folder is also not displayed in the qm output window.

It only works when you start the below code and select files/folders from the root of $personal$ the moment you navigate within $personal$, the selected file/folder is not process correctly.

I haven't worked with SHdoc for a while now but I know I  encountered this problem earlier but I can not find the correctly resolved version.

Function shdoc_filebrowser_simple
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 441 374 "Form"
;3 ActiveX 0x54000000 0x0 0 20 440 352 "SHDocVw.WebBrowser"
;4 ComboBox 0x54230243 0x0 2 4 96 213 ""
;5 Button 0x54032000 0x0 116 2 64 14 "Open selected"
;7 Button 0x54032000 0x0 182 2 48 14 "Up"
;6 Edit 0x54030080 0x200 241 6 96 12 ""
;1 Button 0x54030001 0x0 338 2 48 14 "OK"
;2 Button 0x54030000 0x0 388 2 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040601 "" "" "" ""

str controls = "3 4 6"
str ax3SHD cb4 e6
e6="Press 'OPEN' or 'UP'"
ax3SHD="$personal$"
cb4="FVM_ICON[]FVM_SMALLICON[]FVM_LIST[]FVM_DETAILS[]FVM_THUMBNAIL[]FVM_TILE[]FVM_THUMBSTRIP"; if(_winver>=0x601) cb4+"[]FVM_CONTENT"
if(!ShowDialog(dd &sub.DlgProc &controls)) ret

#sub DlgProc
function# hDlg message wParam lParam

SHDocVw.WebBrowser- we3
Shell32.ShellFolderView- fv
Shell32.FolderItem- fi
sel message    
,case WM_INITDIALOG
,,we3._getcontrol(id(3 hDlg))
,,fv=we3.Document
,,fv._setevents("sub.fv") ;; ===>> points to subfunction 'fv' !!!!
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
we3._getcontrol(id(3 hDlg))
sel wParam
,case CBN_SELENDOK<<16|4
,,_i=CB_SelectedItem(lParam)+1
,,fv=we3.Document
,,fv.CurrentViewMode=_i
,,out F"VIEMODE: {_i} (index + 1)" ;; 1 t/m 8
,
,case 5 ;;open selected
,,_s.getwintext(id(6 hDlg));if((empty(_s))||(!FileExists(_s 2)))ret
,,fv=we3.Document
,,fi=fv.FocusedItem
,,if fi.IsFolder
,,,we3.Navigate(fi.Path)
,,,_s=we3.Path;_s.replacerx("^file:\/\/\/" "");_s.replacerx("\/" "\");_s.rtrim("\");_s.setwintext(id(6 hDlg))
,,else
,,,fi.InvokeVerb
,
,case 7 ;;Up
,,_s=we3.LocationURL
,,_s.getpath
,,we3.Navigate(_s)
,,_s.replacerx("^file:\/\/\/" "");_s.replacerx("\/" "\");_s.rtrim("\");_s.escape(8)
,,_s.setwintext(id(6 hDlg))
ret 1

#sub fv_SelectionChanged
function Shell32.IShellFolderViewDual3'fv
Shell32.FolderItem fi=fv.FocusedItem
str path=fi.Path
out path
#2
here is the thread with working codes
http://www.quickmacros.com/forum/showthr...FolderView
#3
Thanks!


Forum Jump:


Users browsing this thread: 1 Guest(s)