garry
Joined: 19 Apr 2005 Posts: 1186 Location: switzerland
|
Posted: Thu Dec 20, 2007 11:21 pm Post subject: Watching video in internet with blackscreen |
|
|
script0:
MODIFIED=20080320
| Code: |
MODIFIED = 20080320
NAME1 = BLACK
;=========== BLACK BACKGROUND ==================================
/*
--------- watch video with black background
How to use=
-----------
start URL, -1 click button CheckXY
-2 XY leftclick left above
-3 XY leftclick right down
*/
;===============================================================
;http://www.autohotkey.net/~garry/teresateng.jpg
coordmode,mouse
setworkingdir, %a_scriptdir%
autotrim,off
Settitlematchmode, 2
DetectHiddenText,on
DetectHiddenWindows, on
RSSINI=%A_scriptdir%\BLACKINI.txt
; resolution 1280*1024 17''
WA=%A_screenwidth%
HA=%A_screenheight%
SW1 :=(WA*100)/100 ;width show
SW2 :=(WA*100)/100 ;width region
SH1 :=(HA*97 )/100 ;height
LY1 :=(HA*94 )/100 ;button y - position
Gui,4:-border +AlwaysOnTop
;Gui,4:Color,Teal ;teal
Gui,4:Color,Black ;black
Gui,4:add,button,x10 y%LY1% h25 w100 gStart,CheckXY
Gui,4:add,button,x120 y%LY1% h25 w100 gBig ,Default
Gui,4:add,button,x230 y%LY1% h25 w100 gLast ,LAST
Gui,4:add,button,x340 y%LY1% h25 w100 gQUIT ,QUIT
Gui,4:add,button,x10 y10 h25 w100 gURL1 ,YOUTUBE
Gui,4:add,button,x120 y10 h25 w100 gURL2 ,MEDIA
Gui,4:add,button,x230 y10 h25 w100 gURL3 ,STAGE
Gui,4:add,button,x340 y10 h25 w100 gURL4 ,SILVER
Gui,4:add,button,x450 y10 h25 w100 gURL5 ,ARCHIVE
Gui,4:add,button,x560 y10 h25 w100 gURL6 ,HEISE
Gui,4:add,button,x670 y10 h25 w100 gURL7 ,TV-ARD
Gui,4:add,button,x780 y10 h25 w100 gURL8 ,TV-ZDF
Gui,4:add,button,x890 y10 h25 w100 gURL8 ,VEOH
Menu, Tray, Add, OPEN, GuiShow
Menu, Tray, Default,OPEN
Menu, Tray, Add, Close,CLOSE
Menu, Tray, Add, About, About
Menu, Tray, Add
Menu, Tray, Add, Exit, Exit
Menu, Tray, NoStandard
gosub,big
Gui,4:show,x0 y0 h%SH1% w%SW1%,%NAME1%
return
;------------------------------------------------------
URL1:
;run,http:www.youtube.com
run,http://www.youtube.com/results?search_query=jim+reeves&search_type=
return
URL2:
run,http://multimediastream.cc/
return
URL3:
run,http://www.stage6.com/Cult-Movie-Theater/videos/group:13601
return
URL4:
run,http://quicksilverscreen.com/
return
URL5:
run,http://www.archive.org/details/the-last-man-on-earth
return
URL6:
run,http://www.heise.de/ct/tv/archiv/
return
URL7:
run,http://www.daserste.de/plusminus/archiv.asp
return
URL8:
AS=http://frontal21.zdf.de/ZDFde/inhalt/1/0`,1872`,1001633_idDispatch`:7372960`,00.html
run,%AS%
return
URL9:
run,http://www.veoh.com/browse/videos.html?order=mp&category=Comedy&range=t
return
;--------------------------------------------------------
big:
WinSet, Region,, %NAME1%
X1 :=(WA*.3 )/100
Y1 :=(HA*5 )/100
B :=(WA*99.7 )/100
H :=(HA*88 )/100
X2 :=(X1+B) ;2. x-position
Y2 :=(Y1+H) ;2. y-position
WinSet,Region, 0-0 %SW2%-0 %SW2%-%SH1% 0-%SH1% 0-0 %X1%-%Y1% %X2%-%Y1% %X2%-%Y2% %X1%-%Y2% %X1%-%Y1%,%NAME1%
return
;--------- read last position and size ------------------
LAST:
IniRead, X1 , %rssini% , Position1 , X1
IniRead, X2 , %rssini% , Position1 , X2
IniRead, Y1 , %rssini% , Position1 , Y1
IniRead, Y2 , %rssini% , Position1 , Y2
HL:=(Y2-Y1)
BL:=(X2-X1)
WinSet, Region,, %NAME1%
WinSet,Region, 0-0 %SW2%-0 %SW2%-%SH1% 0-%SH1% 0-0 %X1%-%Y1% %X2%-%Y1% %X2%-%Y2% %X1%-%Y2% %X1%-%Y1%,%NAME1%
return
;---------------------------------------------------------
quit:
exitapp
;-------------
;----------- define XY1/2 --------------------------------
start:
V=0
settimer,aas,500
return
;-----------------
AAS:
settimer,aas,20
MouseGetPos,Xa,Ya
ToolTip X=%Xa% Y=%Ya%
GetKeyState,state, LButton
if state=D
{
V++
M:=mod(V,2)
if M=1
{
MouseGetPos,X1,Y1
KeyWait, LButton, U
ToolTip Position1 is set X=%X1% Y=%Y1%
sleep,800
return
}
else
{
settimer,aas,off
MouseGetPos,X2,Y2
KeyWait, LButton, U
tooltip
WinSet, Region,, %NAME1%
WinSet,Region, 0-0 %SW2%-0 %SW2%-%SH1% 0-%SH1% 0-0 %X1%-%Y1% %X2%-%Y1% %X2%-%Y2% %X1%-%Y2% %X1%-%Y1%,%NAME1%
IniWrite, %X1% , %rssini% ,Position1 , X1
IniWrite, %X2% , %rssini% ,Position1 , X2
IniWrite, %Y1% , %rssini% ,Position1 , Y1
IniWrite, %Y2% , %rssini% ,Position1 , Y2
HL:=(Y2-Y1)
BL:=(X2-X1)
return
}
}
return
;---------------------------------------
4GuiContextMenu: ;when rightclick can move the hole
{
Gui,4:submit,nohide
HLP = %a_GuiControl%
if HLP=
{
MouseGetPos,x1,y1
X2 :=(X1+BL) ;2. x-position
Y2 :=(Y1+HL) ;2. y-position
WinSet, Region,, %NAME1%
WinSet,Region, 0-0 %SW2%-0 %SW2%-%SH1% 0-%SH1% 0-0 %X1%-%Y1% %X2%-%Y1% %X2%-%Y2% %X1%-%Y2% %X1%-%Y1% ,%NAME1%
return
}
return
}
return
;------------------------------------
;------------- menu tray ------------
About:
ee=
(
start URL
-1 click button CheckXY
-2 XY leftclick left above
-3 XY leftclick right down
)
MsgBox, 64,Info,%modified%`n%ee%
Return
;---------
GuiShow:
reload
Return
;-------------------------------------
close:
4Guiclose:
esc::
Gui,4:show,minimize
Return
;------------------
exit:
exitapp
;===============================================================
|
script1:
MODIFIED=20071229
Script1:
needs cwebpage.dll
http://www.codeguru.com/code/legacy/ieprogram/cwebpage.zip
| Code: |
MODIFIED=20071229
/*
DATUM...............20071030
ADDON...............cwebpage.dll
....................http://www.codeguru.com/code/legacy/ieprogram/cwebpage.zip
How to use .........start, select video in youtube
( escape to minimize/maximize black screen )
*/
#NoEnv
#SingleInstance force
SetBatchLines,-1
FILENAME=IE_TEST05.ahk
;....... garry http://www.autohotkey.com
setworkingdir, %a_scriptdir%
;AS=http://www.youtube.com/watch?v=DSvKh7ecIaU
;AS=http://www.youtube.com/watch?v=iCKMzrPy4t4
AS=http://www.youtube.com/results?search_query=jim+reeves&search=Search
;AS=http://www.youtube.com
;-------------------------------------------
WA=%A_screenwidth%
HA=%A_screenheight%
SW1 :=(WA*99)/100 ;width guishow width
SH1 :=(HA*80)/100 ;height
YB1 :=(SH1*96)/100 ;y-button last line
;-------- 1 -----------------
X11 :=0
Y11 :=0
W11 :=SW1
H11 :=SH1
;------- 2 embed URL --------
W12 :=(W11-220)
H12 :=(H11-80)
;-- position from URL -------
X12 :=210
Y12 :=8
;------ 3 -----------------
X13 :=X11
Y13 :=Y11
W13 :=W11
H13 :=H11
;--- hole in black screen --
X1 :=280 ;x hole in black
Y1 :=120 ;y hole in black
B :=482 ;width
H :=429 ;height
X2 :=(X1+B)
Y2 :=(Y1+H)
XGB :=(X1-20)
YGB :=(Y1-20)
WGB :=(B+40)
HGB :=(H+40)
;Gui,3:Add, GroupBox, x%XGB% y%YGB% w%WGB% h%HGB%,
;----------------------------
;--- winset --
SW3a :=(W11-7)
SH3a :=(H11-50)
;--------------------------------------------
cwebpageHandle := DllCall("LoadLibrary", "str", "cwebpage.dll")
OnExit, Cleanup
;-------------- 1 -----------------------------
Gui,1:Color,000000
Gui,1:+Owner
Gui,1:add,button,x20 y%YB1% h20 w100 gTEST1,TEST1
Gui,1:add,button,x140 y%YB1% h20 w100 gTEST2,TEST2
Gui,1:Show, x%X11% y%Y11% w%W11% h%H11%,BLACK1
WinGet, mainGuiHandle, ID, A
gosub,2ndgui
gosub,call1
gosub,3ndgui
settimer,AAS1,200
return
;---------------------------------------------
TEST2:
msgbox, 262208,GUI1TEST,TEST2
return
;--------------- 2 ----------------------------
2ndgui:
Gui,2:Color,000000 ;BLACK
Gui,2: Margin, 0, 0
Gui,2: +ToolWindow -Caption
Gui,2: Show,x0 y0 w%W12% h%H12%,BLACK2
Gui,2: +LastFound
WinGet, browserGuiHandle1, ID, A
return
;----------------------------------------------
;-------------- 3 hole ------------------------
3ndgui:
gui,3:+owner1
Gui,3: Margin, 0, 0
;Gui,3:Color,000000 ;black
Gui,3:Color,teal ;teal
Gui,3:+Alwaysontop
Gui,3: +ToolWindow -Caption
Gui,3:Add, GroupBox, x%XGB% y%YGB% w%WGB% h%HGB%,
Gui,3:Show,x%X13% y%Y13% w%W13% h%H13%,BLACK
WinSet,Region,,BLACK
WinSet,Region, 0-0 %SW3a%-0 %SW3a%-%SH3a% 0-%SH3a% 0-0 %X1%-%Y1% %X2%-%Y1% %X2%-%Y2% %X1%-%Y2% %X1%-%Y1%,BLACK
return
;----------------------------------------------
call1:
DllCall("SetParent", "uint", WinExist(), "uint", mainGuiHandle)
; Create the Browser object
res := DLLCall("cwebpage\EmbedBrowserObject", "uint", browserGuiHandle1)
If (res != 0 Or ErrorLevel != 0) ; error
Goto, Cleanup
; Position the Browser "control" in the Gui
WinMove, ahk_id %browserGuiHandle1%, ,%X12%,%Y12% ;<<<< position URL
URL2Load =%AS%
res := DLLCall("cwebpage\DisplayHTMLPage"
, "uint", browserGuiHandle1
, "str", URL2Load)
If (res != 0 Or ErrorLevel != 0) ; error
Goto, Cleanup
URL2Load =
Return
;--------------------------------------------
AAS1:
WinGetPos,X3,Y3, Width, Height,BLACK1
X4:=(X3+10)
Y4:=(Y3+30)
WinMove,BLACK,,X4,Y4
return
;--------------------------------------------
;-------------------------------------------
~ESC::
TEST1:
V++
M:=mod(V,2)
if M=1
{
settimer,AAS1,OFF
sleep,200
Gui,3:show,minimize
return
}
else
{
settimer,AAS1,200
sleep,200
Gui,3:show,maximize
return
}
return
;-----------------------------------------------------------------
cleanup:
;GuiEscape:
Guiclose:
1GuiClose:
2GuiClose:
DLLCall("cwebpage\UnEmbedBrowserObject", "uint", browserGuiHandle1)
DllCall("FreeLibrary", "uint", cwebpageHandle)
ExitApp
;-----------------------------------------------------------------
|
================================================
script 2:
MODIFIED =20071221 automatically maximize black-screen when use YouTube
/*
watch video through a 'hole' black screen
rightclick to start youtube
escape to minimize
click on box (hole) to select a new video in YouTube
automatically maximize black-screen when use YouTube
rightclick to move the box ( if needed )
*/
Script2:
http://www.autohotkey.net/~garry/BLACK.ahk
 |
|