Posts: 331
Threads: 60
Joined: May 2006
In the TreeView in QM where you select the macro you are going to edit, how do I tell if I have seleted a folder or a macro or function.
I know that .getmacro("" 3) will get the selected macro or functions type but it will not get the selected folder type if a folder is selected it just gets the last selected.
Posts: 12,073
Threads: 140
Joined: Dec 2002
int htv=id(2202 _hwndqm) ;;get QM tree view handle (HWND)
int hitem=SendMessage(htv TVM_GETNEXTITEM TVGN_CARET 0) ;;get selected item (HTREEITEM)
int iid=TvGetParam(htv hitem) ;;get lParam. It is QM item id. This function is in System. It is private, but it is safe to use in macros.
QMITEM qi; qmitem(iid 0 qi) ;;get QM item info
sel qi.itype ;;see qmitem in QM help
,case 0 out "macro"
,case 1 out "function"
,case 2 out "menu"
,case 3 out "tb"
,case 4 out "tsm"
,case 5 out "folder"
,case 6 out "member f"
Posts: 331
Threads: 60
Joined: May 2006
Wow I have been trying to do this for about 3 hours and I dont think I would have ever got that.
THANNKS SO MUCH.
Posts: 331
Threads: 60
Joined: May 2006
Is there a way of telling if folder is a Child of another folder.
Posts: 12,073
Threads: 140
Joined: Dec 2002
qmitem can get parent folder id.
Posts: 331
Threads: 60
Joined: May 2006
Thanks, I think this will work just fine.