MODIFIED =20071221 automatically maximize black-screen when use YouTube /* watch video through a 'hole' black screen rightclick to move the box 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 */ #NoEnv #SingleInstance force SetBatchLines,-1 FILENAME=BLACK.ahk AUTHOR =garry http://www.autohotkey.com setworkingdir, %a_scriptdir% autotrim,off Settitlematchmode, 2 DetectHiddenText,on DetectHiddenWindows, on ; resolution 1280*1024 17'' WA=%A_screenwidth% HA=%A_screenheight% SW1 :=(WA*99 )/100 ;width show SW2 :=(WA*100)/100 ;width region SH1 :=(HA*97 )/100 ;height Gui,4:-Border Gui,4:Color,000000 ;BLACK ;Gui,4:Color,Teal ;teal 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 Gui,4:Add,Text,cteal x50 y10 ,use rightclick to move the box or start Gui,4:Font,S16 cteal, Verdana Gui,4:Add,Text, y40 x50 w%SW2% vAL1,%BX2% Gui,4:Add,GroupBox, x50 y80 h40 w120 vGYTB ,YOUTUBE Gui,4:Add,GroupBox, x50 y140 h40 w120 vMUVI ,MUVIBEE Gui,4:show,x0 y0 h%SH1% w%SW1%,BLACK ;gosub,calc1 return ;------------------------------------ 4GuiContextMenu: ;when rightclick can move the hole { Gui,4:submit,nohide HLP = %a_GuiControl% if HLP=GYTB { ;run,http://www.youtube.com run,http://www.youtube.com/watch?v=DSvKh7ecIaU gosub,calc1 return } if HLP=MUVI { ;run,http://www.muvibee.com run,http://www.muvibee.com/watch/?q=jim+reeves&t=all gosub,calc2 return } if HLP= { MouseGetPos,x1,y1 gosub,calc WinSet, Region,, BLACK WinSet,Region, 0-0 %SW2%-0 %SW2%-%SH1% 0-%SH1% 0-0 %X1%-%Y1% %X2%-%Y1% %X2%-%Y2% %X1%-%Y2% %X1%-%Y1% ,BLACK return } return } return ;------------------------------------ CALC: Gui,4:submit,nohide if B= B:=480 ;width if H= H:=362 ;height X2 :=(X1+B) ;2. x-position Y2 :=(Y1+H) ;2. y-position return ;------------------------------------ ;------------------------------------ CALC1: Gui,4:submit,nohide WinSet, Region,, BLACK X1 :=(WA*15.2)/100 Y1 :=(HA*25 )/100 ;X1 :=194 ;x-position left top ;Y1 :=256 ;y-position ;msgbox,194=%X1% 256=%Y1% ;return B :=(WA*37.5 )/100 H :=(HA*35.4 )/100 ;B:=480 ;width ;H:=362 ;height ;msgbox,480=%B% 362=%H% ;return 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%,BLACK settimer,srchname,2000 return ;------------------------------------ ;------------------------------------ CALC2: Gui,4:submit,nohide WinSet, Region,, BLACK settimer,srchname,OFF X1 :=(WA*70.5 )/100 Y1 :=(HA*17.5 )/100 ;X1 :=900 ;x-position left top ;Y1 :=180 ;y-position ;msgbox,900=%X1% 180=%Y1% ;return B :=(WA*24.2 )/100 H :=(HA*27.7 )/100 ;B:=310 ;width ;H:=290 ;height ;msgbox,310=%B% 290=%H% ;return 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%,BLACK return ;------------------------------------ ;------------- menu tray ------------ About: MsgBox, 64,%filename%,%modified% %author% Return GuiShow: reload Return ;------------------------------------- ;------------------------------------------------ ;YouTube - Broadcast Yourself. SRCHNAME: Gui,4:submit,nohide Wingettitle,WGT,YouTube, if WGT=%WGT1% return if WGT contains YouTube { stringmid,WGT2,WGT,1,29 if WGT2=YouTube - Broadcast Yourself. return Gui,4:show, maximize } stringsplit,BX,WGT,`-, GuiControl,4:Text,AL1,%BX2% WGT1=%WGT% return ;-------------------------------------------------------------- ;----------------- close: 4Guiclose: esc:: ;Gui,4:Hide Gui,4:show,minimize Return ;------------------ exit: exitapp ;===============================================================