guiltyking Posted May 6, 2016 Share Posted May 6, 2016 (edited) DeskTop Utilities part 1 - R@yBAN Screen SHELTER ver.16.05.12 click intro for help. RayBAN_noPass.au3 Screen SHELTER on mouse hook with no password. care for eyes. "To change the COLORS and PassWord select 'SetUp' from the Tray menu "To Reload saved COLORS and PassWord select 'ReLoad INI' from the Tray menu "Mouse on LEFT SIDE above Switches to immediate screen protection outher eyes" "Mouse on MID TOP SIDE Switches to RAY filter to protect your eyes as you work hard on monitor" "at start pasword is asked twice later process normal- default "9" ver.16.05.07 RayBAN.au3 Edited May 12, 2016 by guiltyking Link to comment Share on other sites More sharing options...
Trong Posted May 7, 2016 Share Posted May 7, 2016 2 hours ago, guiltyking said: DeskTop Utilities part 1 - R@yBAN Screen SHELTER care for eyes. "To change the COLORS and PassWord select 'SetUp' from the Tray menu "To Reload saved COLORS and PassWord select 'ReLoad INI' from the Tray menu "Mouse on LEFT SIDE above Switches to immediate screen protection outher eyes" "Mouse on MID TOP SIDE Switches to RAY filter to protect your eyes as you work hard on monitor" "at start pasword is asked twice later process normal- default "9" ver.16.05.07 good idea, but a bad script. My AutoIt: 3.3.14.2 | Windows 7 x64 Need skip check scripts to run, and just show your name and black screen. Must using Alt+Tab to exit RayBAN.au3 expandcollapse popup#include <Constants.au3> #include <StaticConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> ;==> #include <WinAPI.au3> ;#include <winapiex.au3> ;==>_WinAPI_TrackMouseEvent >>>DOESNOT WORK AT $WS_EX_TRANSPARENT #include <Color.au3> ;#include <GdiPlus.au3> ;==>_GDIPlus_GraphicsFillRect($h,160, 35, 40, 40,$brush)>>> NO NEED ;==> #cs alt-tab protection >>>> CAUSE TROUBLE #Include 'HotKey.au3' #Include 'vkConstants.au3' _HotKey_Assign(BitOR($CK_ALT, $VK_TAB), 'Message') Func Message() return EndFunc #CE Opt("GUIOnEventMode", 1) ;==> #region TRAY ;Opt("TrayIconDebug", 1) Opt("TrayMenuMode", 3) Opt("TrayAutoPause", 0) Opt("TrayOnEventMode", 1) TraySetToolTip("SCREEN SHELTER") $_TrayItem_About = TrayCreateItem("&About") TrayCreateItem("") $_TrayItem_Switch_Shield = TrayCreateItem("S&Hield", -1, -1, $TRAY_ITEM_RADIO) TrayItemSetState($_TrayItem_Switch_Shield, $TRAY_CHECKED) $_TrayItem_Switch_RayBAN = TrayCreateItem("&RayBAN", -1, -1, $TRAY_ITEM_RADIO) TrayCreateItem("") $_TrayItem_SetUp = TrayCreateItem("&SetUp") $_TrayItem_ReLoad = TrayCreateItem("re&Load INI") TrayCreateItem("") $_TrayItem_Exit = TrayCreateItem("E&xit") TrayItemSetOnEvent($_TrayItem_About, "TrayAbout") TrayItemSetOnEvent($_TrayItem_Switch_Shield, "Custom_Switch_Shield") TrayItemSetOnEvent($_TrayItem_Switch_RayBAN, "Custom_Switch_RayBAN") TrayItemSetOnEvent($_TrayItem_SetUp, "Custom_SetUpGUI") TrayItemSetOnEvent($_TrayItem_ReLoad, "Custom_ReLoadIni") TrayItemSetOnEvent($_TrayItem_Exit, "Custom_Exit") Func TrayAbout() $message = "Created by GUILTYKING" & @CRLF & @CRLF & _ "To change the COLORS and PassWord select 'SetUp' from the Tray menu" & @CRLF & _ "To Reload saved COLORS and PassWord select 'ReLoad INI' from the Tray menu" & @CRLF & _ "To change the COLORS ans PassWord select 'SetUp' from the Tray menu" & @CRLF & @CRLF & _ "Mouse on LEFT SIDE above Switches to immediate screen protection outher eyes" & @CRLF & @CRLF & _ "Mouse on MID TOP SIDE Switches to RAY filter to protect your eyes as you work hard on monitor" & @CRLF & _ "at start pasword is asked twice later process normal" & @CRLF & @CRLF IF $cRayban Then $message &= "The following custom Rayban are being used:" & @CRLF & @CRLF & _ "CLR="& $_nBkColor_RayBan & " Transparency=" & $_nTransCounter & @CRLF ElseIf not $cRayban $message &= "The following custom SHIELD are being used:" & @CRLF & @CRLF & _ "CLR="&$_nBkColor_Shield EndIf MsgBox(64, "R@yBAN Screen SHELTER ", $message) EndFunc #endregion TRAY ;==> Global $cRayban = false, $GUI_Collapsed = false ;==> Global $nGUI_Top = 0, $nGUI_Left = 0, $_nGUI_min = 3, $sense = 2, $nSteps = 40 Global $_nBkColor_Shield=0x000001, $_nBkColor_RayBan=0xfff000, $_nTransCounter=120, $_sPASS="9" ;==> Dim $aHexColorV[4] = [00,00,00,00] ;==> #region INITIALIZE Custom_IniRead() Func Custom_IniRead() ;read setup $inifile = @ScriptDir & "\RayBAN.ini" IF FileExists($inifile) = 1 Then $_nBkColor_Shield = IniRead($inifile, "COLORS", "_nBkColor_Shield", "0x000001") $_nBkColor_RayBan = IniRead($inifile, "COLORS", "_nBkColor_RayBan", "0xfff000") $_nTransCounter = IniRead($inifile, "COLORS", "_nTransCounter", "120") $_sPASS = IniRead($inifile, "PASSWORD", "_sPASS", " ") Else Custom_IniWrite() EndIf _ReduceMemory() EndFunc Func Custom_IniWrite() ;save setup $inifile = @ScriptDir & "\RayBAN.ini" FileDelete ( $inifile ) sleep(100) FileWrite($inifile, "[COLORS]" & @CRLF & _ "_nBkColor_Shield=" &$_nBkColor_Shield& @CRLF & _ "_nBkColor_RayBan=" &$_nBkColor_RayBan& @CRLF & _ "_nTransCounter=" &$_nTransCounter& @CRLF & @CRLF & _ "[PASSWORD]" & @CRLF & _ "_sPASS="&$_sPASS& @CRLF & @CRLF & _ ";==>This file will be regenerated IF removed." & @CRLF & _ ";==>http://www.autoitscript.com/forum/index.php?showtopic=103047") EndFunc Func _ReduceMemory($i_PID = -1) ;cleans ram unnecessary IF $i_PID <> -1 Then Local $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $i_PID) Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', $ai_Handle[0]) DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $ai_Handle[0]) Else Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', -1) EndIf Return $ai_Return[0] EndFunc Func Custom_ReLoadIni() ;refresh temp setup back Custom_IniRead() IF $cRayban Then Custom_Switch_RayBAN() IF not $cRayban Then Custom_Switch_Shield() sleep(200) EndFunc #endregion ;==> #region GUI ;==>Create Transparent GUI Global $_hGUI_SHELTER = GUICreate("_hGUI_SHELTER", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, $WS_EX_TOPMOST) GUICtrlCreateLabel("R@yBAN", @DesktopWidth-300, 6, 80, 17) GUICtrlSetFont(-1, 6, 600, 0, "MS Sans Serif") Guictrlsetcolor(-1, 0xffffff) GUISetBkColor($_nBkColor_Shield, $_hGUI_SHELTER) ;==>Set GUI Colour GUIRegisterMsg($WM_MOUSEMOVE, "Custom_MouseEvents") GUISetOnEvent($GUI_EVENT_CLOSE, "Custom_SystemEvents") GUISetState(@SW_SHOW, $_hGUI_SHELTER) ;==> #endregion GUI ;==> Custom_MouseEvents () AdlibRegister ( 'Custom_MouseEvents' ) ;==> Func Custom_MouseEvents() Local $aMousePos = MouseGetPos() IF $aMousePos[0] <= 3 and $aMousePos[1] <= 30 Then ;==>shield on IF $cRayban Then Custom_Switch_Shield() Custom_CollapseExpand() sleep(900) EndIf IF $aMousePos[1] <= 3 and $aMousePos[0] >= 600 and $aMousePos[0] <= 800 Then ;==>rayban IF NOT $cRayban then Custom_Switch_RayBAN() Custom_CollapseExpand() sleep(900) EndIf EndFunc ;==> While GUIGetMsg() <> -3 sleep(10) WEnd Custom_Exit() Func Custom_Exit() Exit EndFunc ;==> Func Custom_SystemEvents() Switch @GUI_CtrlId Case $GUI_EVENT_CLOSE ;==>ESCAPE Custom_Exit() Case $_idButton_SetUp ;==>SAVE SETUP_idButton_Cancel $_sPASS = GUICtrlRead($sINPUT_NewPassWord) GUIDelete($_hGui_Control) sleep(100) Custom_IniWrite() _ReduceMemory() Case $_idButton_Cancel ;==>cancel SETUP GUIDelete($_hGui_Control) sleep(100) _ReduceMemory() Case $nSlider_TrnsPrncy ;==>RAYBAN IF $cRayban Then $_nTransCounter = GUICtrlRead($nSlider_TrnsPrncy) WinSetTrans($_hGUI_SHELTER, "", $_nTransCounter) tooltip($_nTransCounter, 400, 100) sleep(800) tooltip("") EndIf Case $_xSlider_Alpha $at = GUICtrlRead($_xSlider_Alpha) $aHexColorV[0] = Number($at) GUICtrlSetData($ALPHA,StringRight(Hex($aHexColorV[0]),2)) setHEX() Case $_xSlider_ColRed $rt = GUICtrlRead($_xSlider_ColRed) $aHexColorV[1] = Number($rt) GUICtrlSetData($RED,StringRight(Hex($aHexColorV[1]),2)) setHEX() Case $_xSlider_ColGreen $vt = GUICtrlRead($_xSlider_ColGreen) $aHexColorV[2] = Number($vt) GUICtrlSetData($GREEN,StringRight(Hex($aHexColorV[2]),2)) setHEX() Case $_xSlider_ColBlue $bt = GUICtrlRead($_xSlider_ColBlue) $aHexColorV[3] = Number($bt) GUICtrlSetData($BLUE,StringRight(Hex($aHexColorV[3]),2)) setHEX() EndSwitch EndFunc ;==> Func Custom_Switch_Shield() $NoTrans = BitNOT($WS_EX_TRANSPARENT) _WinAPI_SetWindowLong($_hGUI_SHELTER, $GWL_EXSTYLE, BitAND(_WinAPI_GetWindowLong($_hGUI_SHELTER, $GWL_EXSTYLE), $NoTrans)) Sleep(10) GUISetBkColor($_nBkColor_Shield, $_hGUI_SHELTER) WinSetTrans($_hGUI_SHELTER, "", 255) TrayItemSetState($_TrayItem_Switch_Shield, $TRAY_CHECKED) TrayItemSetState($_TrayItem_Switch_RayBAN, $TRAY_UNCHECKED) $cRayban = false EndFunc Func Custom_Switch_RayBAN() IF NOT $GUI_Collapsed AND NOT $cRayban Then $cRayban=Custom_EnterPassWord() _WinAPI_SetWindowLong($_hGUI_SHELTER, $GWL_EXSTYLE,BitOR(_WinAPI_GetWindowLong($_hGUI_SHELTER, $GWL_EXSTYLE), $WS_EX_TRANSPARENT)) sleep(10) GUISetBkColor($_nBkColor_RayBan, $_hGUI_SHELTER) WinSetTrans($_hGUI_SHELTER, "", $_nTransCounter) TrayItemSetState($_TrayItem_Switch_RayBAN, $TRAY_CHECKED) TrayItemSetState($_TrayItem_Switch_Shield, $TRAY_UNCHECKED) $cRayban=true EndFunc ;==> Func Custom_EnterPassWord() IF $cRayban Then RETURN ;SetUpGUI $_hGUI_PassWord=GUICreate("SetUpGUI",98,50,-1,400,BitOR($WS_POPUP,$WS_BORDER,$WS_SIZEBOX),BitOR($WS_EX_TOPMOST,$WS_EX_CONTROLPARENT)) GUICtrlCreateLabel("Shield Pass: ", 1, 1, 99, 17) $sINPUT_PassWord = GUICtrlCreateInput("", 2, 20, 111, 20) GUICtrlSetFont($sINPUT_PassWord, 10, 600, 0, "MS Sans Serif") Guictrlsetcolor($sINPUT_PassWord, 0xff0000) GUISetBkColor(0xfff000) ;==>Set GUI Colour ;==>GUISetOnEvent($_hGUI_PassWord, "FLY") GUISetState(@SW_SHOW, $_hGUI_PassWord) ;==> local $nTemp_OLD=9999999 while $nTemp_OLD <> $_sPASS $nTemp_OLD = GUICtrlRead($sINPUT_PassWord) SLEEP(100) WEnd ;GUICtrlSetData($sINPUT_PassWord, "") GUIDelete($_hGUI_PassWord) _ReduceMemory() SLEEP(200) RETURN TRUE EndFunc ;==> Func Custom_CollapseExpand() Local $win_pos = WinGetPos($_hGUI_SHELTER) ;==> IF $GUI_Collapsed Then ;==>Expand IF $cRayban Then ;==>accordion WinSetTrans($_hGUI_SHELTER, "", $_nTransCounter) For $i = $win_pos[1] To $win_pos[3] Step $nSteps WinMove($_hGUI_SHELTER, "", $win_pos[0], -($win_pos[3] - $i), $win_pos[2], $win_pos[3]) Sleep(10) Next Else ;==>immediate WinSetTrans($_hGUI_SHELTER, "", 255) EndIf WinMove($_hGUI_SHELTER, "", Default, 0, Default, Default) Sleep(100) $GUI_Collapsed = false ;==> ElseIF not $GUI_Collapsed Then ;==>Collapse IF not $cRayban Then Custom_EnterPassWord() WinMove($_hGUI_SHELTER, "", $win_pos[0], -($win_pos[3] - $_nGUI_min), $win_pos[2], $win_pos[3]) sleep(10) WinSetTrans($_hGUI_SHELTER, "", 20) $GUI_Collapsed = true EndIf EndFunc ;==> Func Custom_SetUpGUI() ;==>Controller GUI Global $_hGui_Control = GUICreate("ControlGUI", 200, 140,@DesktopWidth/2, 100, BitOR($WS_POPUP, $WS_BORDER, $WS_SIZEBOX), BitOR($WS_EX_TOPMOST, $WS_EX_CONTROLPARENT)) ;==> IF $cRayban Then $Group2 = GUICtrlCreateGroup("RAYBAN Colour", 0, 0, 197, 116) Local $aColor = _ColorGetCOLORREF($_nBkColor_RayBan) Global $_Label_aHex = GUICtrlCreateLabel(Hex($_nBkColor_RayBan),120,0,70,15) EndIf IF not $cRayban Then $Group2 = GUICtrlCreateGroup("SHIELD Colour", 0, 0, 197, 116) Local $aColor = _ColorGetCOLORREF($_nBkColor_Shield) Global $_Label_aHex = GUICtrlCreateLabel(Hex($_nBkColor_Shield),120,0,70,15) EndIf ;==> Global $_xSlider_Alpha = GUICtrlCreateSlider(4, 15, 96, 20,0x0010) GUICtrlCreateLabel("Alpha: ", 100, 15, 50, 17) Global $ALPHA = GUICtrlCreateLabel("0", 150, 15, 20, 17) GUICtrlSetLimit($_xSlider_Alpha, 255, 0) GUICtrlSetData($_xSlider_Alpha, 0) $aHexColorV[0] = 0 ;==> Global $_xSlider_ColRed = GUICtrlCreateSlider(4, 35, 96, 20,0x0010) GUICtrlCreateLabel("Red: ", 100, 35, 50, 17) Global $RED = GUICtrlCreateLabel(Hex($aColor[0], 2), 150, 35, 20, 17) GUICtrlSetLimit($_xSlider_ColRed, 255, 0) GUICtrlSetData($_xSlider_ColRed, Hex($aColor[0], 2)) $aHexColorV[1] = Hex($aColor[0], 2) ;==> Global $_xSlider_ColGreen = GUICtrlCreateSlider(4, 55, 96, 20,0x0010) GUICtrlCreateLabel("Green: ", 100, 55, 50, 17) Global $GREEN = GUICtrlCreateLabel(Hex($aColor[1], 2), 150, 55, 20, 17) GUICtrlSetLimit($_xSlider_ColGreen, 255, 0) GUICtrlSetData($_xSlider_ColGreen, Hex($aColor[1], 2)) $aHexColorV[2] = Hex($aColor[1], 2) ;==> Global $_xSlider_ColBlue = GUICtrlCreateSlider(4, 75, 96, 20,0x0010) GUICtrlCreateLabel("Blue: ", 100, 75, 50, 17) Global $BLUE = GUICtrlCreateLabel(Hex($aColor[2], 2), 150, 75, 20, 17) GUICtrlSetLimit($_xSlider_ColBlue, 255, 0) GUICtrlSetData($_xSlider_ColBlue, Hex($aColor[2], 2)) $aHexColorV[3] = Hex($aColor[2], 2) ;==> Global $nSlider_TrnsPrncy = GUICtrlCreateSlider(4, 95, 96, 20,0x0010) GUICtrlCreateLabel("Transparency: ", 100, 95, 96, 17) GUICtrlSetLimit($nSlider_TrnsPrncy, 255, 1) GUICtrlSetData($nSlider_TrnsPrncy, $_nTransCounter) ;==> Global $_idButton_SetUp = GUICtrlCreateButton("Save", 1, 118, 40, 20) Global $_idButton_Cancel = GUICtrlCreateButton("Cancel", 41, 118, 40, 20) ;==> Global $sINPUT_NewPassWord = GUICtrlCreateInput($_sPASS, 82, 118, 110, 20) GUICtrlSetFont($sINPUT_NewPassWord, 10, 600, 0, "MS Sans Serif") Guictrlsetcolor($sINPUT_NewPassWord, 0xff0000) ;==> GUICtrlCreateGroup('', -99, -99, 1, 1) ;==> GUICtrlSetOnEvent($_idButton_SetUp, "Custom_SystemEvents") GUICtrlSetOnEvent($_idButton_Cancel, "Custom_SystemEvents") GUICtrlSetOnEvent($_xSlider_Alpha, "Custom_SystemEvents") GUICtrlSetOnEvent($_xSlider_ColRed, "Custom_SystemEvents") GUICtrlSetOnEvent($_xSlider_ColGreen, "Custom_SystemEvents") GUICtrlSetOnEvent($_xSlider_ColBlue, "Custom_SystemEvents") GUICtrlSetOnEvent($nSlider_TrnsPrncy, "Custom_SystemEvents") ;==> GUISetState(@SW_SHOW, $_hGui_Control) IF not $cRayban Then GUICtrlSetState($nSlider_TrnsPrncy, $GUI_HIDE) GUICtrlSetState($sINPUT_NewPassWord, $GUI_FOCUS) ;==> EndFunc Func setHEX() $0 = StringRight(Hex($aHexColorV[0]),2);a $1 = StringRight(Hex($aHexColorV[1]),2);r $2 = StringRight(Hex($aHexColorV[2]),2);g $3 = StringRight(Hex($aHexColorV[3]),2);b $xHexColor = "0x" & $0 & $3& $2 & $1 GUICtrlSetData($_Label_aHex,$xHexColor) ;$brush = _GDIPlus_BrushCreateSolid($xHexColor) ;$h = _GDIPlus_GraphicsCreateFromHWND($_hGui_Control) ;_GDIPlus_GraphicsFillRect($h,160, 35, 40, 40,$brush) GUISetBkColor($xHexColor, $_hGUI_SHELTER) ;==>Set GUI Colour IF $cRayban Then $_nBkColor_RayBan = $xHexColor IF not $cRayban Then $_nBkColor_Shield = $xHexColor EndFunc ;==>DELETED Func Hey($sMsg) MsgBox(0, "About ", $sMsg, 2) EndFunc Func Custom_FLY($_hGUI) ;==>IF $NOFLY = 1 Then RETURN Local $a = 200, $b = 100 $a += Random(-100, 150, 1) * Random(0, 5, 1) $b += Random(-100, 100, 1) * Random(0, 5, 1) IF($a < 1200) And($b < 600) And($a > 0) And($b > 0) Then WinMove($_hGUI, "", $a, $b, Default, Default, 5) Endif EndFunc Regards, Link to comment Share on other sites More sharing options...
guiltyking Posted May 7, 2016 Author Share Posted May 7, 2016 (edited) tks, needs develop. i know. still learning. it has more functions seekers can expect. all aimed. try to move mouse at defined locations. Edited May 7, 2016 by guiltyking Link to comment Share on other sites More sharing options...
TheDcoder Posted May 7, 2016 Share Posted May 7, 2016 At first I though it was spam lol (Because of the thread title) EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now