//QM v2.9. Do not edit with text editor!!! //
7     2
i1+PS5()^[
  Controls help  0 36EA6290 0
 Functions to work with controls in other processes.

 EXAMPLES

out
#compile Controls
Controls c

int w1=win("" "CabinetWClass"); if(!w1) w1=win("" "ExploreWClass") ;;folder window
int w2=id(1 w1)
int i n=SendMessage(w2 LVM_GETITEMCOUNT 0 0)
str s
ARRAY(str) a.create(n)
for i 0 n
	if(c.ListViewGetItemText(w2 i 0 s)) a[i]=s
out n
for(i 0 n) out a[i]

  Controls.ListViewGetItemText  16 36E824B6 0
function! hlv item column str&text

 Gets text of a listview control item.
 Returns 1 if successful, 0 if not.
 List view control class name is "SysListView32" or similar.
 Fails if the process belongs to another user.
 On Vista, fails if QM is running as User and the process has higher integrity level.

 hlv - list view control handle.
 item - zero-based item index.
 column - zero-based column index.
 text - str variable that receives text.


if(!hlv) end ES_WINDOW
text.len=0

if(!InitPm(hlv)) ret

LVITEMW* lip2=m_pm.address
LVITEMW lip
lip.pszText=+(lip2+sizeof(lip))
lip.cchTextMax=260
lip.iSubItem=column
lip.mask=LVIF_TEXT
m_pm.Write(&lip sizeof(lip))
int tl=SendMessageW(hlv LVM_GETITEMTEXTW item lip2)
if(tl)
	m_pm.ReadStr(text tl*2 sizeof(lip) 1)
	ret 1

err+

  private  65600 36E81065 0

  Controls  16 36E81305 3
#compile CProcessMemory
class Controls m_hwnd m_pid -CProcessMemory'm_pm

  Controls.InitPm  16 36E81565 3
function! hwnd
if(m_hwnd and hwnd=m_hwnd) ret 1
int pid
if(!GetWindowThreadProcessId(hwnd &pid)) ret
if(m_pid and pid=m_pid) ret 1
m_pm.Alloc(pid 4096 1)
err ret
m_hwnd=hwnd
m_pid=pid
ret 1

  file  268500992 0

  