Code: Select all
;- ActiveX works with videolan ( vlc.exe )
;--------------------------------
Gui, 2: +HwndAId +0x2000000 ; +WS_CLIPCHILDREN Fixes drawing problems with child.
;Gui, 2: +HwndAId +0x16000000
Gui, 2: -DPIScale
Gui, 2:Color,Black,
Gui, 2:Font,s12 cGray,Lucida Console
Gui, 2:Add, Text ,x10 y10 w500 ,Listview is the parent
Gui, 2:Add,button ,x10 y40 w300 h40 gA1,ActiveX (Child)
Gui, 2:Add,button ,x350 y40 w300 h40 gA2,Listview (Parent)
Gui, 2:Add,Listview ,x50 y100 w1500 h950 cBackgrounGray grid, A|B
Gui, 2:Add,Text ,x50 y1080 w300 vMemoryX cYellow ;- Memory_used
Gui, 2:Show,x100 y100 w1600 h1150
gosub,memorycheck
settimer,memorycheck,1000
return
;--------------------------------
a1:
Gui, 3: +HwndBId -Caption -Border
Gui, 3: -DPIScale
Gui, 3:Color,Gray,Gray
Gui, 3:Font,s14 cGray,Lucida Console
;Gui, 3:Add, Text,x0 y10 w500 center,This is the Child
id1=yKbzBGntI8Q ;- Li Xiang Lan - Ye lai xiang
;id1=sraZaL6jylM ;- Lilian de Celis - El relicario
;id1=l9lw-zQcZ58 ;- Gloria Lasso - Etranger au paradies
F1=https://www.youtube.com/watch?v=%id1%
xxb=VideoLAN.VLCPlugin.2
Gui, 3:Add,ActiveX, x0 y0 w1500 h950 vVlcx,%xxb%
Gui, 3:Show , x50 y100 w1500 h950
Gui, 3:+Parent%AId%
vlcx.playlist.stop()
vlcx.playlist.items.clear()
sleep,500
vlcx.playlist.add(F1,"","""""") ;- MEM- 84000-kB
vlcx.playlist.next()
return
;--------------------------------
a2:
vlcx.playlist.stop()
vlcx.playlist.items.clear()
;ObjRelease(vlcx)
vlcx:="" ;- mem=29000-kB
sleep,500
Gui,3:destroy
return
;--------------------------------
2Guiclose:
exitapp
;-------- https://autohotkey.com/boards/viewtopic.php?f=5&t=43654 ---
memorycheck:
memx:=checkWorkingset()//1024 . "-kB-RAM"
GuiControl,2:Text,MemoryX,%memx%
return
checkWorkingset(pid:=""){
static wmi:=comObjGet("winmgmts:{impersonationLevel=impersonate}!\\" . a_computerName . "\root\cimv2")
pid:=pid?pid:dllCall("GetCurrentProcessId")
processInfo:=wmi.execQuery("select WorkingSetSize,ProcessId from Win32_Process")._NewEnum
while(processInfo[item]){
if(item.processId=pid){
workingSet:=item.WorkingSetSize
break
}
}
return workingSet
}
;-----------------------------------------------------------------