Posts: 1,271
Threads: 399
Joined: Mar 2003
my idea is to have a system wide logic to make searching easier.
after some tests i decided to start without qm toolbar and instead use windows taskbar from where to initiate.
so i created a new taskbar toolbar which displays content of a folder. its set to show not toolbar title and file name.
my first question is you could extend the 'create shortcut' dialog by adding custom shortcut targets.
it would be also cool to choose an own icon for the macro shortcut.
--
now that i use a shortcut icon for starting the macro i put an act on top in code to get the last active window.
that works nice when working with windows where text has been selected, but how do i get selected files when the last
active control was a systreeview32?
Posts: 12,073
Threads: 140
Joined: Dec 2002
Quote:how do i get selected files when the last
active control was a systreeview32?
Ctrl+C
GetClipboardFiles
Posts: 1,271
Threads: 399
Joined: Mar 2003
that is working, but i want to prevent to use clipboard.
what i need is something like get active last control.
Posts: 12,073
Threads: 140
Joined: Dec 2002
Get last active control's handle, or its selected items?
Posts: 1,271
Threads: 399
Joined: Mar 2003
Gintaras Wrote:Get last active control's handle, or its selected items?
both :roll: :lol:
Posts: 12,073
Threads: 140
Joined: Dec 2002
For selected items, will post tomorrow.
For handle, can get only currently focused control in currently active window. Or get focused control every 1 s..., or try accessible object trigger.
Posts: 1,271
Threads: 399
Joined: Mar 2003
Gintaras Wrote:For handle, can get only currently focused control in currently active window
how?
Posts: 12,073
Threads: 140
Joined: Dec 2002
Function GetFolderWindowItems
;/
function! ARRAY(str)&a [hwnd] [flags] ;;flags: 1 selection
;Gets full paths of items in the folder that is opened in Windows Explorer (WE).
;Returns 1 on success, 0 if failed. If empty, or empty selection (flag 1), returns 1, but the array is empty.
;a - receives paths.
;hwnd - WE window handle. If 0 or omitted, finds WE window that is above all other WE windows in Z order.
a=0
SHDocVw.InternetExplorer ie=GetFolderWindowIE(hwnd); if(!ie) ret
IShellView isv
IShellBrowser isb
IServiceProvider isp=+ie
isp.QueryService(uuidof(IShellBrowser) uuidof(IShellBrowser) &isb)
isb.QueryActiveShellView(&isv)
IDataObject ido
isv.GetItemObject(iif(flags&1 SVGIO_SELECTION SVGIO_ALLVIEW) IID_IDataObject &ido); err ret 1
FORMATETC f.cfFormat=RegisterClipboardFormat(CFSTR_SHELLIDLIST)
f.dwAspect=DVASPECT_CONTENT; f.lindex=-1; f.tymed=TYMED_HGLOBAL
STGMEDIUM sm
if(ido.GetData(&f &sm)) ret
CIDA* c=GlobalLock(sm.hGlobal)
int i
a.create(c.cidl)
for i 0 c.cidl
,ITEMIDLIST* il=ILCombine(+(c+c.aoffset[0]) +(c+c.aoffset[i+1]))
,PidlToStr(il &a[i])
,CoTaskMemFree il
GlobalUnlock(sm.hGlobal); ReleaseStgMedium(&sm)
err+ ret
ret 1
Function GetFolderWindowIE
;/
function'SHDocVw.InternetExplorer [hwnd]
;Gets SHDocVw.InternetExplorer of folder that is opened in Windows Explorer (WE).
;hwnd - WE window handle. If 0 or omitted, finds WE window that is above all other WE windows in Z order.
SHDocVw.ShellWindows sw._create
SHDocVw.InternetExplorer ie
type __GFWIE hwnd SHDocVw.InternetExplorer'ie
ARRAY(__GFWIE) a
int hwnd2
str ss
foreach ie sw
,ss=ie.LocationURL; err continue
,;out ss
,if(!ss.begi("file:///")) continue ;;web browser or non-file-system folder
,ss.get(ss 8)
,ss.findreplace("/" "\")
,ss.escape(8)
,;out ss
,hwnd2=ie.HWND; err continue
,if(!hwnd2) continue
,if(hwnd)
,,if(hwnd2=hwnd) ret ie
,else
,,__GFWIE& r=a[]
,,r.hwnd=hwnd2; r.ie=ie
if(hwnd) ret
hwnd=GetWindow(_hwndqm GW_HWNDFIRST)
rep
,if(!hwnd) break
,int i
,for(i 0 a.len) if(a[i].hwnd=hwnd) ie=a[i].ie; ret ie
,hwnd=GetWindow(hwnd GW_HWNDNEXT)
Posts: 12,073
Threads: 140
Joined: Dec 2002
Quote:how?
int hwnd=child
Posts: 1,271
Threads: 399
Joined: Mar 2003
Gintaras Wrote:Quote:how?
int hwnd=child
doh! hock: :lol:
the first function work very nice for windows explorer.
i need this for Q-Dir and speed commander too.
is a general file-info function for systreeview32 possible?
Posts: 12,073
Threads: 140
Joined: Dec 2002
Quote:is a general file-info function for systreeview32 possible?
No.
Posts: 12,073
Threads: 140
Joined: Dec 2002
Updated GetFolderWindowItems. Now works with folders containing non file system objects.
Posts: 1,058
Threads: 367
Joined: Oct 2007
I think that
Quote:if(a[i].hwnd=hwnd) ret ie
in GetFolderWindowIE
it should be replaced by
Quote: if(a[i].hwnd=hwnd) ie=a[i].ie ; ret ie
Posts: 12,073
Threads: 140
Joined: Dec 2002
|