Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MODIFIED= 20111120
- /* INFO
- VLC VIDEOS PLAYER
- Written by: Najeeb Shah Khan (najeebshahkhan@gmail.com)
- Last Modified: 3-20-2023
- */
- ;#warn
- #NoEnv
- #SingleInstance, Force
- Process, Priority, , A
- SendMode, Input
- SetBatchLines, -1
- ;#NoTrayIcon
- SetWorkingDir %A_ScriptDir%
- ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- FileCreateDir, %A_ScriptDir%\DATA
- FileSetAttrib +HS, %A_ScriptDir%\DATA, 2
- FileInstall , VLC-PLAYER3.ahk, %A_ScriptDir%\DATA\VLC-PLAYER3.ahk, 1
- FileSetAttrib +HS, %A_ScriptDir%\DATA\VLC-PLAYER3.ahk, 2
- ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- /* ----------- a videolan example to play video or audio ---------------------------
- script uses vlc.exe http://www.videolan.org/
- 1- start video while click on column A or rightclick to mark then start
- use buttons below to skip etc ....
- Example: ( mark row with rightclick )
- start-time = 0:40
- stop-time = 1:10
- repeat = 2
- The button "Start/Stop/repeat" plays marked video-file from 0:40 until 1:10 twice
- */ ----------------------------------------------------------------------------------
- TMR=D:\VIDEOS ;-- << path from your video files
- vlc=%A_programfiles%\VideoLAN\VLC\vlc.exe ;-- << path from vlc.exe
- ;F1=%A_scriptdir%\videolanvlc.txt
- EXTX=flv,vob,mp4,mpg,wmv,avi ;-- << only videos
- HK1=Esc
- Hotkey,%hk1%,mute1,ON
- HK2=space
- Hotkey,%hk2%,pause1,ON
- ;------------------------------------------------------------------------------
- Gui,2:default
- Gui,2: Font, S12, Lucida Console
- Gui,2:Color,Black
- sendmode,input
- setworkingdir,%A_scriptdir%
- DetectHiddenWindows, On
- SetTitleMatchMode, 2
- SW=%A_screenwidth%
- SH=%A_screenheight%
- GSW:=(SW*99)/100 ;-- GUI width
- GSH:=(SH*90)/100 ;-- GUI height
- LSW:=(SW*99)/100 ;-- LV width
- LSH:=(SH*65)/100 ;-- LV height
- T1:=(SW*23 )/100 ;NAME
- T2:=(SW*15 )/100 ;PATH
- T3:=(SW*9 )/100 ;SIZE
- T4:=(SW*14 )/100 ;C
- T5:=(SW*14 )/100 ;A
- T6:=(SW*14 )/100 ;M
- T7:=(SW*8 )/100 ;FULLPATH
- T1A:=T1
- T2A:=T1+T2
- T3A:=T1+T2+T3
- T4A:=T1+T2+T3+T4
- T5A:=T1+T2+T3+T4+T5
- T6A:=T1+T2+T3+T4+T5+T6
- T7A:=T1+T2+T3+T4+T5+T6+T7
- Gui,2:Add,ListView,grid backgroundTeal cWhite x0 y0 w%LSW% h%LSH% +hscroll altsubmit vA1 gA2, Name|FOLDER|Size|Created|LastAccess|Modified|FullPath
- LV_ModifyCol(1,T1)
- LV_ModifyCol(2,T2)
- LV_ModifyCol(3,T3)
- LV_ModifyCol(4,T4)
- LV_ModifyCol(5,T5)
- LV_ModifyCol(6,T6)
- LV_ModifyCol(7,T7)
- LV_ModifyCol(3,"Integer")
- LV_ModifyCol(4,"digit")
- LV_ModifyCol(5,"digit")
- LV_ModifyCol(6,"digit")
- Y1 :=(SH*67)/100
- Y2 :=(SH*72)/100
- Y3 :=(SH*76)/100
- Y4 :=(SH*80)/100
- Y5 :=(SH*85)/100
- WDTH1:=(SW*90 )/100
- X1:=(SW*91.5 )/100
- X2:=(SW*94 )/100
- Gui,2:Font,,FixedSys
- Gui,2:Add,Edit, right x%x1% y%Y2% w70 h20 vI2 ; I2 focussed
- Gui,2:Add,Edit, right x%x1% y%Y4% w70 h20 vI3 ; I3 total
- Gui,2:Add,Edit, readonly x5 y%Y2% w%wdth1% h20 cWhite vFPH ; path
- Gui,2:add,button, x10 y%y3% w100 gFULLSCREEN vFULLSCREEN1 ,FULLSCREEN
- Gui,2:add,button, x10 y%y4% w100 gPlay1 vPlay2 ,PLAY
- Gui,2:add,button, x130 y%y4% w100 gPAUSE1 vPAUSE1 ,PAUSE/PLAY
- Gui,2:add,button, x10 y%y5% w100 gSTATUS1 vStatus1 ,STATUS
- Gui,2:Add,Edit, x240 y%Y3% w60 h20 vBack1 ,30
- Gui,2:add,button, x240 y%y4% w60 gSKIPBACK vSKIPBACK1 ,<<<<
- Gui,2:Add,Edit, x310 y%Y3% w60 h20 vFWD1 ,30
- Gui,2:add,button, x310 y%y4% w60 gSKIPFWD1 vSKIPFWD1 ,>>>>
- Gui,2:Add,Edit, x380 y%Y3% w70 h20 vJUMP ,1:30
- Gui,2:add,button, x380 y%y4% w70 gJUMPTO vJUMPTO ,JUMP-TO
- Gui,2:Add,Edit, x460 y%Y3% w90 h20 vStartTimex ,0:40
- Gui,2:add,button, x460 y%y4% w90 gStarttime1 vStarttime2 ,Start-Time
- Gui,2:Add,Edit, x560 y%Y3% w90 h20 vStopTimex ,1:10
- Gui,2:add,button, x560 y%y4% w90 gStoptime1 vStoptime2 ,Stop-Time
- Gui,2:add,button, x460 y%y5% w190 gStartStoptime1 vStartStoptime2 ,Start/Stop-Time
- Gui,2:Add,Edit, x660 y%Y3% w90 h20 vRuntimex ,20
- Gui,2:add,button, x660 y%y4% w90 gRuntime1 vRuntime2 ,Run-Time
- Gui,2:Add,Edit, x760 y%Y3% w40 h20 vRepeatx ,2
- Gui,2:add,button, x760 y%y4% w70 gRepeat1 vRepeat2 ,Repeat
- Gui,2:add,button, x660 y%y5% w170 gStartStopRepeat1 vStartStoprepeat2 ,Start/Stop/Repeat
- Gui,2:add,button, x840 y%y4% w90 gQUIT1 vQUIT1 ,STOP
- Gui,2:add,button, x820 y%y3% w90 gVOLUMEDOWN vVDOWN ,<<VOLUME
- Gui,2:add,button, x920 y%y3% w90 gVOLUMEUP vVUP ,VOLUME>>
- Gui,2:Add,Edit, x10 y%Y1% w200 h20 vSRCHSTR ; search
- Gui,2:add,button, x220 y%y1% w80 gSearchx ,<search
- Gui,2:add,button, x320 y%y1% w120 gShowall ,Show-ALL
- Gui,2: Show, x1 y1 w%GSW% h%GSH%,VLC_TEST [ Click Column A (Name) or mark with rightclick ] SPACE=stop/start ESC=Volume on/off
- gosub,disable1
- gosub,disable2
- gosub,filllist
- GuiControl,2:Focus,SRCHSTR
- return
- ;---------------------------------------------------------------------
- 2Guiclose:
- exitapp
- ;----------------------------------
- MUTE1:
- soundset,+1,master,mute
- return
- ;----------------------------------
- starttime1:
- ;gui,2:submit,nohide
- guicontrolget,starttimex
- X1=
- X2=
- X=
- stringsplit,X,starttimex,`:
- if x2<>
- X:=(X1*60)+X2
- else
- X:=starttimex
- gosub,WHENPLAY
- runwait,%vlc% --intf qt --extraintf http --start-time=%x% "%c7%",,,PID1
- gosub,whenstop
- ;run, %vlc% --intf qt --extraintf http "%C7%",,,PID1
- return
- ;----------------------------------
- stopTIME1:
- ;gui,2:submit,nohide
- guicontrolget,stoptimex
- X1=
- X2=
- X=
- stringsplit,X,stoptimex,`:
- if x2<>
- X:=(X1*60)+X2
- else
- X:=stoptimex
- runwait,%vlc% --intf qt --extraintf http --stop-time=%x% "%c7%",,,PID1
- gosub,whenstop
- return
- ;----------------------------------
- StartstopTIME1:
- ;gui,2:submit,nohide
- guicontrolget,starttimex
- guicontrolget,stoptimex
- X1=
- X2=
- X=
- y1=
- y2=
- y=
- stringsplit,x,starttimex,`:
- if x2<>
- x:=(x1*60)+X2
- else
- x:=starttimex
- stringsplit,Y,stoptimex,`:
- if y2<>
- y:=(y1*60)+y2
- else
- y:=stoptimex
- gosub,WHENPLAY
- runwait,%vlc% --intf qt --extraintf http --start-time=%x% --stop-time=%y% "%c7%",,,PID1
- gosub,whenstop
- return
- ;----------------------------------
- StartStopRepeat1:
- ;gui,2:submit,nohide
- guicontrolget,starttimex
- guicontrolget,stoptimex
- guicontrolget,repeatx
- X1=
- X2=
- X=
- y1=
- y2=
- y=
- z=
- stringsplit,x,starttimex,`:
- if x2<>
- x:=(x1*60)+X2
- else
- x:=starttimex
- stringsplit,Y,stoptimex,`:
- if y2<>
- y:=(y1*60)+y2
- else
- y:=stoptimex
- z:=(repeatx-1)
- gosub,WHENPLAY
- runwait,%vlc% --intf qt --extraintf http --start-time=%x% --stop-time=%y% --input-repeat=%z% "%c7%",,,PID1
- gosub,whenstop
- return
- ;----------------------------------
- runtime1:
- ;gui,2:submit,nohide
- guicontrolget,runtimex
- X1=
- X2=
- X=
- stringsplit,X,runtimex,`:
- if x2<>
- X:=(X1*60)+X2
- else
- X:=runtimex
- gosub,WHENPLAY
- runwait,%vlc% --intf qt --extraintf http --run-time=%x% "%c7%",,,PID1
- gosub,whenstop
- return
- ;----------------------------------
- repeat1:
- ;gui,2:submit,nohide
- guicontrolget,repeatx
- x=
- X:=(repeatx-1)
- gosub,WHENPLAY
- runwait,%vlc% --intf qt --extraintf http --input-repeat=%x% "%c7%",,,PID1
- gosub,whenstop
- return
- ;----------------------------------
- PLAY1:
- gui,2:submit,nohide
- gosub,WHENPLAY
- runwait,%vlc% --intf qt --extraintf http "%c7%",,,PID1
- gosub,WHENSTOP
- return
- ;----------------------------------
- STATUS1:
- F1=http://127.0.0.1:8080/requests/status.xml
- AA:=UrlDownloadToVar(F1)
- msgbox,%aa%
- ;UrlDownloadToFile, http://127.0.0.1:8080/?control=pause, %F1%
- return
- ;----------------------------------
- PAUSE1:
- ;Hotkey,%hk1%,mute1,OFF
- F1=http://127.0.0.1:8080/?control=pause
- AA:=UrlDownloadToVar(F1)
- ;UrlDownloadToFile, http://127.0.0.1:8080/?control=pause, %F1%
- return
- ;----------------------------------
- STOP1:
- gosub,WHENSTOP
- F1=http://127.0.0.1:8080/?control=stop
- AA:=UrlDownloadToVar(F1)
- ;UrlDownloadToFile, http://127.0.0.1:8080/?control=stop, %F1%
- return
- ;----------------------------------
- QUIT1:
- ID := WinExist( "ahk_pid" PID1 )
- if (ID<>0x0)
- {
- WinClose, ahk_id %ID%
- ;process,exist,pid1
- Process,close,%Pid1%
- WinWaitClose, ahk_id %ID%
- gosub,disable1
- }
- gosub,WHENSTOP
- return
- ;----------------------------------
- FULLSCREEN1:
- F1=http://127.0.0.1:8080/?control=fullscreen
- AA:=UrlDownloadToVar(F1)
- ;UrlDownloadToFile, http://127.0.0.1:8080/?control=fullscreen, %F1%
- return
- ;----------------------------------
- SKIPFWD1:
- guicontrolget,fwd1
- F1=http://127.0.0.1:8080/requests/status.xml?command=seek&val=`%2B%fwd1%
- AA:=UrlDownloadToVar(F1)
- ;UrlDownloadToFile, http://127.0.0.1:8080/requests/status.xml?command=seek&val=`%2B%fwd1%, %F1%
- return
- ;----------------------------------
- SKIPBACK:
- guicontrolget,back1
- F1=http://127.0.0.1:8080/requests/status.xml?command=seek&val=-%back1%
- AA:=UrlDownloadToVar(F1)
- ;UrlDownloadToFile, http://127.0.0.1:8080/requests/status.xml?command=seek&val=-%back1%, %F1%
- return
- ;----------------------------------
- JUMPTO:
- ;gui,2:submit,nohide
- guicontrolget,jump
- X1=
- X2=
- X=
- stringsplit,X,jump,`:
- if x2<>
- X:=(X1*60)+X2
- else
- X:=JUMP
- F1=http://127.0.0.1:8080/requests/status.xml?command=seek&val=%x%
- AA:=UrlDownloadToVar(F1)
- ;UrlDownloadToFile, http://127.0.0.1:8080/requests/status.xml?command=seek&val=%x%, %F1%
- return
- ;----------------------------------
- VOLUMEDOWN:
- F1=http://127.0.0.1:8080/requests/status.xml?command=volume&val=-10.24
- AA:=UrlDownloadToVar(F1)
- ;UrlDownloadToFile, http://127.0.0.1:8080/requests/status.xml?command=volume&val=-10.24, %F1%
- return
- ;----------------------------------
- VOLUMEUP:
- F1=http://127.0.0.1:8080/requests/status.xml?command=volume&val=`%2B10.24
- AA:=UrlDownloadToVar(F1)
- ;UrlDownloadToFile, http://127.0.0.1:8080/requests/status.xml?command=volume&val=`%2B10.24, %F1%
- return
- ;----------------------------------
- FULLSCREEN:
- F1=http://127.0.0.1:8080/?control=fullscreen
- AA:=UrlDownloadToVar(F1)
- ;UrlDownloadToFile, http://127.0.0.1:8080/?control=fullscreen, %F1%
- return
- ;----------------------------------
- CLOSE1:
- F1=http://127.0.0.1:8080/?control=shutdown
- AA:=UrlDownloadToVar(F1)
- ;UrlDownloadToFile, http://127.0.0.1:8080/?control=shutdown, %F1%
- gosub,WHENSTOP
- return
- ;=====================================================================================================
- ;-----------------
- Filllist:
- ShowAll:
- Gui,2:submit,nohide
- ;Gui,2:default
- Gui,2:ListView,A1
- IX=0
- GuiControl,2:Text,I3,
- LV_Delete()
- Splashimage,,b1 x140 y0 w500 h30 CWGreen zh0,SEARCH
- LV_Delete()
- Loop, %tmr%\*.*, 0, 1
- {
- SplitPath,A_LoopFileFullPath, name, dir, ext, name_no_ext, drive
- If Ext In %extx%
- {
- IX++
- CX=
- C=
- D=
- O=
- P:=0
- Q:=0
- R:=0
- S:=0
- T=
- O=%A_LoopFileName%
- P=%A_LoopFileSize%
- Q=%A_LoopFileTimeCreated%
- R=%A_LoopFileTimeAccessed%
- S=%A_LoopFileTimeModified%
- T=%A_LoopFileFullPath%
- StringSplit,CX, T,`\
- C:=(CX0-1) ; path oneflashback
- D=% CX%C% ; name from path position -1
- LV_Add("",O,D,P,Q,R,S,T)
- }
- }
- LV_Modify(RFX, "Vis") ; scrollto to row where files were deleted visible aera
- Splashimage,off
- GuiControl,2:Text,I3,%IX%
- return
- ;---------------------------------------------------------------------
- searchx:
- Gui,2:submit,nohide
- Gui,2:ListView,A1
- LV_Delete()
- GuiControl,2: -Redraw,A1
- Splashimage,,b1 x140 y0 w500 h30 CWGreen zh0,SEARCH
- IX=0
- GuiControl,2:Text,I3,%IX%
- Loop, %tmr%\*.*, 0, 1
- {
- SplitPath,A_LoopFileFullPath, name, dir, ext, name_no_ext, drive
- If Ext In %extx%
- {
- CX=
- C=
- D=
- O=
- P:=0
- Q:=0
- R:=0
- S:=0
- T=
- O=%A_LoopFileName%
- P=%A_LoopFileSize%
- Q=%A_LoopFileTimeCreated%
- R=%A_LoopFileTimeAccessed%
- S=%A_LoopFileTimeModified%
- T=%A_LoopFileFullPath%
- SplitPath,A_LoopFileFullPath,name, dir, ext, name_no_ext, drive
- StringSplit,CX, T,`\
- C:=(CX0-1) ; path oneflashback
- D=% CX%C% ; name from path position -1
- if T contains %srchstr%
- {
- IX++
- LV_Add("",O,D,P,Q,R,S,T)
- }
- }
- }
- LV_Modify(RFX, "Vis") ; scrollto to row where files were deleted visible aera
- Splashimage,off
- GuiControl,2: +Redraw,A1
- GuiControl,2:Text,I3,%IX%
- return
- ;---------------- LISTVIEW ----------------------------
- A2:
- Gui,2:default
- Gui,2:ListView,A1
- Gui,2:submit,nohide
- RN:=LV_GetNext("C") ;2 selected checked
- RF:=LV_GetNext("F") ;2 selected focused
- GC:=LV_GetCount() ;4 total
- if A_GuiEvent = Normal
- {
- MouseGetPos,x,y
- {
- if x<%T1A%
- {
- LV_GetText(C7,A_EventInfo,7)
- GuiControl,2:Text,I2,%RF%
- GuiControl,2:Text,FPH,%C7%
- ID := WinExist( "ahk_pid" PID1 )
- if (ID<>0x0)
- {
- WinClose, ahk_id %ID%
- process,close,%PID1%
- WinWaitClose, ahk_id %ID%
- }
- SplitPath,C7, name, dir, ext, name_no_ext, drive
- If Ext In %extx%
- {
- run, %vlc% --intf qt --extraintf http "%C7%",,,PID1
- gosub,enable1 ;--
- }
- return
- }
- if x<%T2A%
- {
- LV_GetText(C7,A_EventInfo,7)
- GuiControl,2:Text,I2,%RF%
- GuiControl,2:Text,FPH,%C7%
- SplitPath,C7,name, dir, ext, name_no_ext, drive
- run,%dir%
- return
- }
- if x<%T3A%
- {
- LV_GetText(C7,A_EventInfo,7)
- GuiControl,2:Text,I2,%RF%
- GuiControl,2:Text,FPH,%C7%
- return
- }
- if x<%T4A%
- {
- LV_GetText(C7,A_EventInfo,7)
- GuiControl,2:Text,I2,%RF%
- GuiControl,2:Text,FPH,%C7%
- return
- }
- if x<%T5A%
- {
- LV_GetText(C7,A_EventInfo,7)
- GuiControl,2:Text,I2,%RF%
- GuiControl,2:Text,FPH,%C7%
- return
- }
- if x<%T6A%
- {
- LV_GetText(C7,A_EventInfo,7)
- GuiControl,2:Text,I2,%RF%
- GuiControl,2:Text,FPH,%C7%
- return
- }
- if x<%T7A%
- {
- LV_GetText(C7,A_EventInfo,7)
- GuiControl,2:Text,I2,%RF%
- GuiControl,2:Text,FPH,%C7%
- ;run,%mplc% "%c7%"
- run,%c7%
- return
- }
- }
- }
- if A_GuiEvent = Rightclick
- {
- LV_GetText(C7,A_EventInfo,7)
- GuiControl,2:Text,I2,%RF%
- GuiControl,2:Text,FPH,%C7%
- gosub,enable2
- return
- }
- return
- ;============================= end listview ==========
- ;----- once click ------------------------------------
- ENABLE1:
- GuiControl,2:Enable,Fullscreen1
- GuiControl,2:Enable,Pause1
- GuiControl,2:Enable,Skipback1
- GuiControl,2:Enable,Skipfwd1
- GuiControl,2:Enable,Jumpto
- GuiControl,2:Enable,Quit1
- GuiControl,2:Enable,VDown
- GuiControl,2:Enable,Vup
- return
- DISABLE1:
- GuiControl,2:Disable,Fullscreen1
- GuiControl,2:Disable,Pause1
- GuiControl,2:Disable,Skipback1
- GuiControl,2:Disable,Skipfwd1
- GuiControl,2:Disable,Jumpto
- GuiControl,2:Disable,Quit1
- GuiControl,2:Disable,VDown
- GuiControl,2:Disable,Vup
- return
- ;------ mark with RightClick -----------
- ;------ allow / block all -----------
- ENABLE2:
- GuiControl,2:Enable,Play2
- GuiControl,2:Enable,Starttime2
- GuiControl,2:Enable,Stoptime2
- GuiControl,2:Enable,StartStoptime2
- GuiControl,2:Enable,StartStopRepeat2
- GuiControl,2:Enable,Runtime2
- GuiControl,2:Enable,Repeat2
- return
- WHENPLAY:
- GuiControl,2:Enable,Fullscreen1
- GuiControl,2:Enable,Pause1
- GuiControl,2:Enable,Skipback1
- GuiControl,2:Enable,Skipfwd1
- GuiControl,2:Enable,Jumpto
- GuiControl,2:Enable,Quit1
- GuiControl,2:Enable,VDown
- GuiControl,2:Enable,Vup
- ;return
- DISABLE2:
- GuiControl,2:Disable,Play2
- GuiControl,2:Disable,Starttime2
- GuiControl,2:Disable,Stoptime2
- GuiControl,2:Disable,StartStoptime2
- GuiControl,2:Disable,StartStopRepeat2
- GuiControl,2:Disable,Runtime2
- GuiControl,2:Disable,Repeat2
- return
- WHENSTOP:
- GuiControl,2:disable,Fullscreen1
- GuiControl,2:disable,Pause1
- GuiControl,2:disable,Skipback1
- GuiControl,2:disable,Skipfwd1
- GuiControl,2:disable,Jumpto
- GuiControl,2:disable,Quit1
- GuiControl,2:disable,VDown
- GuiControl,2:disable,Vup
- ;return
- GuiControl,2:Enable,Play2
- GuiControl,2:Enable,Starttime2
- GuiControl,2:Enable,Stoptime2
- GuiControl,2:Enable,StartStoptime2
- GuiControl,2:Enable,StartStopRepeat2
- GuiControl,2:Enable,Runtime2
- GuiControl,2:Enable,Repeat2
- return
- ;============================= END SCRIPT ===================================
- ;================== Function UrlDownloadToVar OLFEN ==============================
- ;http://www.autohotkey.com/forum/viewtopic.php?t=10466
- ;msgbox % UrlDownloadToVar("http://www.autohotkey.com/download/CurrentVersion.txt")
- UrlDownloadToVar(URL, Proxy="", ProxyBypass="") {
- AutoTrim, Off
- hModule := DllCall("LoadLibrary", "str", "wininet.dll")
- If (Proxy != "")
- AccessType=3
- Else
- AccessType=1
- ;INTERNET_OPEN_TYPE_PRECONFIG 0 // use registry configuration
- ;INTERNET_OPEN_TYPE_DIRECT 1 // direct to net
- ;INTERNET_OPEN_TYPE_PROXY 3 // via named proxy
- ;INTERNET_OPEN_TYPE_PRECONFIG_WITH_NO_AUTOPROXY 4 // prevent using java/script/INS
- io_hInternet := DllCall("wininet\InternetOpenA"
- , "str", "" ;lpszAgent
- , "uint", AccessType
- , "str", Proxy
- , "str", ProxyBypass
- , "uint", 0) ;dwFlags
- iou := DllCall("wininet\InternetOpenUrlA"
- , "uint", io_hInternet
- , "str", url
- , "str", "" ;lpszHeaders
- , "uint", 0 ;dwHeadersLength
- , "uint", 0x80000000 ;dwFlags: INTERNET_FLAG_RELOAD = 0x80000000 // retrieve the original item
- , "uint", 0) ;dwContext
- If (ErrorLevel != 0 or iou = 0) {
- DllCall("FreeLibrary", "uint", hModule)
- return 0
- }
- VarSetCapacity(buffer, 512, 0)
- VarSetCapacity(NumberOfBytesRead, 4, 0)
- Loop
- {
- irf := DllCall("wininet\InternetReadFile", "uint", iou, "uint", &buffer, "uint", 512, "uint", &NumberOfBytesRead)
- NOBR = 0
- Loop 4 ; Build the integer by adding up its bytes. - ExtractInteger
- NOBR += *(&NumberOfBytesRead + A_Index-1) << 8*(A_Index-1)
- IfEqual, NOBR, 0, break
- ;BytesReadTotal += NOBR
- DllCall("lstrcpy", "str", buffer, "uint", &buffer)
- res = %res%%buffer%
- }
- StringTrimRight, res, res, 2
- DllCall("wininet\InternetCloseHandle", "uint", iou)
- DllCall("wininet\InternetCloseHandle", "uint", io_hInternet)
- DllCall("FreeLibrary", "uint", hModule)
- AutoTrim, on
- return, res
- }
- ;================== END Function UrlDownloadToVar OLFEN ==============================
- ;=-=-=-=-=-=- END Script VideoPlay ActiveX-=-=-=-=-=-=-=-=-
- #S::Suspend
- #P::Pause
- #R::Reload
- ESC::ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement