#include #include #include #include ;==> #include ;dll #include ;_WinAPI_CreateRect ;#include ;==>_WinAPI_TrackMouseEvent >>>DOESNOT WORK AT $WS_EX_TRANSPARENT #include ;label; ;#include ;==>_GDIPlus_GraphicsFillRect($h,160, 35, 40, 40,$brush)>>> NO NEED ;==> Opt("GUIOnEventMode", 1) ;==> Global $_nBkColor_Shield = 0x000001, $_nBkColor_RayBan = 0xfff000, $_nTrnsprncy=150,$cRayban = false #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&PassWord select 'SetUp' from the Tray menu" & @CRLF & _ "To Reload inial values select 'ReLoad INI' from the Tray menu" & @CRLF & @CRLF & _ "Mouse above Corner on RIGHT SIDE - Expands while below Collapse filters" & @CRLF & _ "Mouse above Corner on LEFT SIDE - Switches to immediate spy protection" & @CRLF & @CRLF & _ "Mouse below Corner on LEFT SIDE - Switches to RAY filter for eyes protection" & @CRLF IF $cRayban Then $message &= "The following custom Rayban are being used:" & @CRLF & @CRLF & _ "CLR="& $_nBkColor_RayBan & " Transparency=" & $_nTrnsprncy & @CRLF ElseIf not $cRayban Then $message &= "The following custom SHIELD are being used:" & @CRLF & @CRLF & _ "CLR="&$_nBkColor_Shield EndIf MsgBox(64, "R@yBAN Screen SHELTER ", $message) EndFunc #endregion TRAY ;==> #region INITIALIZE Custom_IniRead() Func Custom_IniRead() ;read setup $inifile = @ScriptDir & "\noPass.ini" IF FileExists($inifile) = 1 Then $_nBkColor_Shield = IniRead($inifile, "COLORS", "_nBkColor_Shield", "0x000001") $_nBkColor_RayBan = IniRead($inifile, "COLORS", "_nBkColor_RayBan", "0xfff000") $_nTrnsprncy = IniRead($inifile, "COLORS", "nTrnsprncy", "120") Else Custom_IniWrite() EndIf _ReduceMemory() EndFunc Func Custom_IniWrite() ;save setup $inifile = @ScriptDir & "\noPass.ini" FileDelete ( $inifile ) sleep(100) FileWrite($inifile, "[COLORS]" & @CRLF & _ "_nBkColor_Shield=" &$_nBkColor_Shield& @CRLF & _ "_nBkColor_RayBan=" &$_nBkColor_RayBan& @CRLF & _ "nTrnsprncy=" &$_nTrnsprncy& @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 _hGUI_SHELTER ; Global $nGuiXLeft = 0, $nGuiYTop = 0, $nGui_Width = @DesktopWidth, $nGui_Height = @DesktopHeight, $nGUI_minY = 4 ; Global $nSteps = 40 ;==> Dim $aHexColorV[4] = [00,00,00,00] ;==> $message = "Move Mouse each corners to see PROCESS " & @CRLF & _ "Mouse above Corner on RIGHT SIDE - Expands while below Collapse filters" & @CRLF & _ "Mouse above Corner on LEFT SIDE - Switches to immediate spy protection" & @CRLF & _ "Mouse below Corner on LEFT SIDE - Switches to RAY filter for eyes protection" & @CRLF " 'SetUp' from the Tray menu" Global $_hGUI_SHELTER = GUICreate("_hGUI_SHELTER", $nGui_Width, $nGui_Height, $nGuiXLeft, $nGuiYTop, _ $WS_POPUP,BitOR($WS_EX_LAYERED, $WS_EX_TOPMOST)) ;<===== since EX_LAYERED Global $_LGUI_OSK_help = GUICtrlCreateLabel($message, ($nGui_Width/2)-200, $nGui_Height/2, 620, 400, -1, $GUI_WS_EX_PARENTDRAG) GUICtrlSetFont(-1, 10, 600, 0, "MS Sans Serif") Guictrlsetcolor(-1, 0x0000ff) Global $_LGUI_OSK_logo = GUICtrlCreateLabel("info..", $nGui_Width-400, 6, 80, 17, -1, $GUI_WS_EX_PARENTDRAG) GUICtrlSetFont(-1, 12, 600, 0, "MS Sans Serif") Guictrlsetcolor(-1, 0x000fff) GUISetBkColor($_nBkColor_Shield, $_hGUI_SHELTER) ;==>Set GUI Colour WinSetTrans($_hGUI_SHELTER, "", 255) GUICtrlSetOnEvent($_LGUI_OSK_logo, "Custom_SystemEvents") GUISetOnEvent($GUI_EVENT_CLOSE, "_Custom_Exit") ; Call a common GUI close function GUISetState(@SW_SHOW, $_hGUI_SHELTER) GUICtrlSetState($_LGUI_OSK_help, $GUI_HIDE) ;==> #endregion ;==> #Region main ; OnAutoItExitRegister("MemRelease") Global Const $MSLLHOOKSTRUCT = $tagPOINT & ";dword mouseData;dword flags;dword time;ulong_ptr dwExtraInfo" Global $hMouseHook = DllCallbackRegister("MouseHook", "long", "int;wparam;lparam") Global $hMod = Null Global $g_hHook = Null ; $hMod = _WinAPI_GetModuleHandle(0) $g_hHook = _WinAPI_SetWindowsHookEx($WH_MOUSE_LL, DllCallbackGetPtr($hMouseHook), $hMod) ; ;Custom_Switch_RayBAN() While sleep(10) WEnd Custom_Exit() Func Custom_Exit() Exit EndFunc #endregion ;==> GUICtrlSetState($_LGUI_OSK_help, $GUI_HIDE) Func Custom_SystemEvents() Switch @GUI_CtrlId Case $GUI_EVENT_CLOSE ;==>ESCAPE Custom_Exit() Case $_LGUI_OSK_logo ;==>help GUICtrlSetState($_LGUI_OSK_help, $GUI_SHOW) SLEEP(5000) GUICtrlSetState($_LGUI_OSK_help, $GUI_HIDE) Case $_idButton_SetUp ;==>SAVE SETUP_idButton_Cancel 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 MouseHook($nCode, $wParam, $lParam) ;==>MouseHook Local Static $bExpanded = True ; inital prevent collapsed Local Static $tMouseInfo = Null Local $tKeyInfo = DllStructCreate($tagKBDLLHOOKSTRUCT, $lParam) #CS If ($nCode < 0) Then $tKeyInfo = Null Return _WinAPI_CallNextHookEx($g_hHook, $nCode, $wParam, $lParam) EndIf #CE Switch ($wParam) Case $WM_MOUSEMOVE ; Mouse Moved $tMouseInfo = DllStructCreate($MSLLHOOKSTRUCT, $lParam) $nMx=DllStructGetData($tMouseInfo, 1) $nMy=DllStructGetData($tMouseInfo, 2) ;msgbox(0,0,$nMx&$nMy) If $nMx<=1 Then ;Left to SWITCH If $nMy<=20 Then Custom_Switch_Shield() ;SHIELD If $nMy>$nGui_Height-20 Then Custom_Switch_RayBAN() ;RayBAN ElseIf $nMx>=$nGui_Width-1 Then ;Right to expand-close If (Not $bExpanded and $nMy<=20) Then ;if collapsed >EXPAND $bExpanded = True WinMove($_hGUI_SHELTER, "", $nGuiXLeft, $nGuiYTop, $nGui_Width, $nGui_Height) ElseIf ($bExpanded and $nMy>=$nGui_Height-20) Then ;if Expanded>COLLAPSE $bExpanded = False WinMove($_hGUI_SHELTER, "", $nGuiXLeft, $nGuiYTop, $nGui_Width, $nGUI_minY) ;WinSetTrans($_hGUI_SHELTER, "", $_nTrnsprncy) EndIf EndIf $tMouseInfo = Null EndSwitch Return _WinAPI_CallNextHookEx($g_hHook, $nCode, $wParam, $lParam) 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) GUICtrlSetData($_LGUI_OSK_logo,'Shield ') 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) GUICtrlSetData($_LGUI_OSK_logo,'R@yBAN ') ;GUICtrlSetState($sINPUT_PassWord, $GUI_HIDE) GUISetBkColor($_nBkColor_RayBan, $_hGUI_SHELTER) WinSetTrans($_hGUI_SHELTER, "", $_nTrnsprncy) TrayItemSetState($_TrayItem_Switch_RayBAN, $TRAY_CHECKED) TrayItemSetState($_TrayItem_Switch_Shield, $TRAY_UNCHECKED) $cRayban=true EndFunc ;==> Func Custom_SetUpGUI() ;==>Controller GUI Global $_hGui_Control = GUICreate("ControlGUI", 200, 140,$nGui_Width/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, $_nTrnsprncy) ;==> Global $_idButton_SetUp = GUICtrlCreateButton("Save", 1, 118, 40, 20) Global $_idButton_Cancel = GUICtrlCreateButton("Cancel", 41, 118, 40, 20) ;==> 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) ;==> 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 ;==> Func MemRelease() DllCallbackFree($hMouseHook) EndFunc ;==>MemRelease ;