Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QM Editor: Start macro from desktop.
#1
this is a long one with more requests.

it would be nice to drag a macro from the qm editor treeview
to the desktop.
i have 2* 1600x1200 resolution, the editor is ever most of the time
on my main monitor (left, because i am a right hander).

so i have plenty space for icons on my right screen.*

so what i ask for is:

drop macro as shortcut on desktop.

or show me how to use drag
[Image: drag.png]


*
what brings me to another idea:

a workspaces toolbar for each screen with save current window
composition.
pi
#2
While QM cannot do it, you can try this function. Just to play.

Function DragMacro
Trigger: #R /QM /DragMacro
Also, go to Properties and make it a filter function.
Code:
Copy      Help
;\
function# [iid] [FILTER&f]

;this part runs as filter function, on right button down event

;if clicked QM tree view, it launches itself without arguments
if(getopt(nargs)=2)
,if(f.hwnd=_hwndqm and GetDlgCtrlID(f.hwnd2)=2202) mac iid; ret
,ret -2
;_________________________________

;this part runs as normal function

;get QM item id from tree view
int htv=id(2202 _hwndqm)
TVHITTESTINFO ht
GetCursorPos(&ht.pt); ScreenToClient(htv &ht.pt)
SendMessage(htv TVM_HITTEST 0 &ht)
if(ht.flags&0x46=0) ret
iid=TvGetParam(htv ht.hItem)
str name.getmacro(iid 1)

;wait until right button is released
rep() 0.1; if(GetKeyState(2)&0x8000=0) break

;is it desktop?
int h=win(mouse)
if(!wintest(h "" "Progman")) ret

;get number of icons on desktop
int hlv=id(1 h)
int i=SendMessage(hlv LVM_GETITEMCOUNT 0 0)

;create shortcut
str sp.format("$desktop$\%s.lnk" name)
str sa.format("M ''%s''" name)
CreateShortcut sp "qmcl.exe" sa

;wait until new icon is added
rep(100) 0.1; if(SendMessage(hlv LVM_GETITEMCOUNT 0 0)>i) break

;move the icon to the mouse position
POINT p; xm p hlv 1
SendMessage(hlv LVM_SETITEMPOSITION i p.y<<16|p.x)

Drag a macro with the right mouse button and drop on the desktop. It creates shortcut for that macro.
#3
i use #CL /QM (hold control and left mouse until release)

it stops here:

Code:
Copy      Help
int htv=id(2202 _hwndqm)
TVHITTESTINFO ht
GetCursorPos(&ht.pt); ScreenToClient(htv &ht.pt)
out ht.pt.x
_i=SendMessage(htv TVM_HITTEST 0 &ht)
out _i
if(ht.flags&0x46=0) ret

_i is 0
after that i get no output.
pi


Forum Jump:


Users browsing this thread: 1 Guest(s)