Posts: 1,271
Threads: 399
Joined: Mar 2003
i just got an idea, would it be possible to have a transparent toolbar on desktop which only becomes active when mouse drag is in the toolbar area?
so that i for example drag a link from firefox over that area the qm toolbar and it would offer icons for possible drop.
when mouse leaves toolbar then it hides the icons.
Posts: 12,090
Threads: 142
Joined: Dec 2002
Probably would need a toolbar hook function with a timer...
To detect OLE drag and drop also can be used accessibility trigger.
Function
acc_drag_detect
Trigger
$a 8 0 0 "CLIPBRDWNDCLASS"
function hwnd idObject idChild
OnScreenDisplay "Drag and drop detected" -1 0 0 "" 0 0 8
rep
,1
,int tid=GetWindowThreadProcessId(hwnd 0); if(!tid) break
,GUITHREADINFO g.cbSize=sizeof(g)
,if(!GetGUIThreadInfo(tid &g)) break
,if(g.hwndCapture!hwnd) break
Posts: 1,271
Threads: 399
Joined: Mar 2003
Gintaras Wrote:Probably would need a toolbar hook function with a timer...
To detect OLE drag and drop also can be used accessibility trigger.
Function acc_drag_detect
Trigger $a 8 0 0 "CLIPBRDWNDCLASS"
function hwnd idObject idChild
OnScreenDisplay "Drag and drop detected" -1 0 0 "" 0 0 8
rep
,1
,int tid=GetWindowThreadProcessId(hwnd 0); if(!tid) break
,GUITHREADINFO g.cbSize=sizeof(g)
,if(!GetGUIThreadInfo(tid &g)) break
,if(g.hwndCapture!hwnd) break
wow, this is a good start!!!
Posts: 1,271
Threads: 399
Joined: Mar 2003
can i use captureend to get info about the target?
my steps so far with your example code.
can identify source window info from hwnd.
Function
acc_drag_detect
Trigger
$a 8 0 0 "CLIPBRDWNDCLASS"
function hwnd idObject idChild
str exe.getwinexe(hwnd)
;if exe = "qm"; end
str osdtext.format("Drag and drop detected from exe: %s" exe)
OnScreenDisplay osdtext -1 0 0 "" 0 0 8
rep
,1
,int tid=GetWindowThreadProcessId(hwnd 0); if(!tid) break
,GUITHREADINFO g.cbSize=sizeof(g)
,if(!GetGUIThreadInfo(tid &g)) break
,if(g.hwndCapture!hwnd) break
Posts: 1,271
Threads: 399
Joined: Mar 2003
next level. in order to get info about the ole object, should i simply send copy and analyze clipboard?
like detecting if it is an url.
then i could show url related buttons on the toolbar.
Posts: 12,090
Threads: 142
Joined: Dec 2002
Quote:in order to get info about the ole object, should i simply send copy and analyze clipboard?
Can try it. It maybe simpler, but not the correct way.
The better way is QmRegisterDropTarget. You probably already used dialogs or toolbars with it. Look for more examples in forum. Your window must be under mouse, because it must receive a "drag enter" notification; it may be a temporary small and almost transparent window.
Quote:can i use captureend to get info about the target?
It will give you the same hwnd as capturestart.