Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Executes subfunctions within AutoText files by searching for comments
#8
I found most of the code in the post below, But I don't know how to get the handle to the control SysListView32

https://www.quickmacros.com/forum/showth...9#pid36089

#1.How to make the first item always selected?(Same as AutoText list)
 
Code:
Copy      Help
sub.LvSelect hsys32 0

#sub LvSelect
function hlv item [flags] ;;flags: 1 don't deselect previous, 2 don't set focus, 4 ensure visible, 8 deselect

;Selects listview item.
;To select none, use item -1.
;To select all, use item -1 and flag 8.
;Note that listview controls with LVS_SINGLESEL style can have max 1 item selected.

LVITEMW li.stateMask=LVIS_FOCUSED|LVIS_SELECTED
if(item>=0)
,if(flags&9=0) SendMessage hlv LVM_SETITEMSTATE -1 &li
,if(flags&8=0) li.state=LVIS_SELECTED; if(flags&2=0) li.state|LVIS_FOCUSED
,SendMessage hlv LVM_SETITEMSTATE item &li
,if(flags&4) SendMessage hlv LVM_ENSUREVISIBLE item 0
else
,if(flags&8) li.state=LVIS_SELECTED
,SendMessage hlv LVM_SETITEMSTATE -1 &li


#3.Press the right mouse button on the item to locate the position of the subfunction and flash it
 
Code:
Copy      Help
,case WM_NOTIFY goto messages3
;messages3
NMHDR* nh=+lParam
sel nh.idFrom
,case 3
,sel nh.code
,,case LVN_KEYDOWN
,,NMLVKEYDOWN* lvk=+nh
,,if(lvk.wVKey<64 or lvk.wVKey>91)
,,,ret
,,int ln dc=sub.CheckForUnique(text lvk.wVKey ln)
,,if dc=0
,,,DT_EndDialog(hDlg ln)
,,case NM_DBLCLK;;on double left click of listview item
,,i=SendDlgItemMessage(hDlg 3 LVM_GETNEXTITEM -1 LVNI_SELECTED)
,,DT_EndDialog(hDlg i)
,,case NM_RCLICK;;on right click of listview item
,,i=SendDlgItemMessage(hDlg 3 LVM_GETNEXTITEM -1 LVNI_SELECTED)
,,str lviText2
,,GetListViewItemText nh.hwndFrom i-1 lviText2 0 2
,,str lviText.getl(text i)
,,DT_EndDialog(hDlg 1000)
,,int posF=find(ss lviText 0)
,,sub.FlashCodeLine(posF iid)

#sub FlashCodeLine
function curPos iid [hce]
if(!hce) hce=GetQmCodeEditor
mac+ iid
act hce
SendMessage hce SCI.SCI_GOTOPOS curPos 0
int indicator=19
SendMessage(hce SCI.SCI_SETINDICATORCURRENT indicator 0)
SendMessage(hce SCI.SCI_INDICSETALPHA indicator 100)
SendMessage(hce SCI.SCI_INDICSETFORE indicator 0x00FF00)
SendMessage(hce SCI.SCI_INDICSETSTYLE indicator SCI.INDIC_STRAIGHTBOX)
SendMessage(hce SCI.SCI_INDICSETUNDER indicator TRUE)
int line=SendMessage(hce SCI.SCI_LINEFROMPOSITION curPos 0)
int lep=SendMessage(hce SCI.SCI_GETLINEENDPOSITION line 0)
act hce
rep 4
,SendMessage(hce SCI.SCI_INDICATORFILLRANGE curPos lep-curPos)
,0.25
,SendMessage(hce SCI.SCI_INDICATORCLEARRANGE curPos lep-curPos)
,0.25
SendMessage(hce SCI.SCI_SETINDICATORCURRENT 0 0)


Messages In This Thread
RE: Executes subfunctions within AutoText files by searching for comments - by Davider - 12-11-2022, 11:07 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)