Ghastly_MIB Posted October 16, 2005 Share Posted October 16, 2005 Hey, I've ones started to make a program to have 2 desktops. You can switch between them with a key... I wan't to give the basic script to that.. Use the NUMPAD - to chance the desktop. Use is a your own risk, but it works expandcollapse popup$titel = "Boss protections" #include <Constants.au3> ;~ Opt("WinTitleMatchMode", 4) Opt("WinWaitDelay", 0) Dim $desktop = 0 Global $bezig_desktop=0, $desktop2_nr=0, $desktop1_nr=0 HotKeySet("{NUMPADSUB}", "desktops") While 1 Sleep(1000) Wend Func desktops() If $bezig_desktop = 1 Then Return $bezig_desktop = 1 $list = WinList() If $desktop2_nr = 0 Then For $n=1 To $list[0][0] $RetVal = WinGetState($list[$n][1]) If $list[$n][0] <> "" AND $list[$n][0] <> "Program Manager" AND BitAND($RetVal, 2) Then $desktop2_nr = $desktop2_nr+1 Assign("desktop2"&$desktop2_nr, $list[$n][1], 2) WInSetState($list[$n][1], "", @SW_HIDE) EndIf Next For $n = 1 To $desktop1_nr WInSetState(Eval("desktop1"&$n), "", @SW_SHOW) Next $desktop1_nr = 0 Else For $n=1 To $list[0][0] $RetVal = WinGetState($list[$n][1]) If $list[$n][0] <> "" AND $list[$n][0] <> "Program Manager" AND BitAND($RetVal, 2) Then $desktop1_nr = $desktop1_nr+1 Assign("desktop1"&$desktop1_nr, $list[$n][1], 2) WInSetState($list[$n][1], "", @SW_HIDE) EndIf Next For $n = 1 To $desktop2_nr WInSetState(Eval("desktop2"&$n), "", @SW_SHOW) Next $desktop2_nr = 0 EndIf $bezig_desktop = 0 EndFunc Link to comment Share on other sites More sharing options...
Nuffilein805 Posted October 17, 2005 Share Posted October 17, 2005 Nice idea, but as you just hide all windows what happens if your boss comes around and sees your not doing anything - clean desktop. Maybe you should include a option where you can configure which windows are going to hide. my little chatmy little encryption toolmy little hidermy unsafe clickbot Link to comment Share on other sites More sharing options...
TK_Incorperate Posted October 17, 2005 Share Posted October 17, 2005 so this changes between desktop backrounds or 100% complete desktops? if it changes the a new desktop with new shortcuts and everything, then thats awsome man.... good work either way Link to comment Share on other sites More sharing options...
gamerman2360 Posted October 17, 2005 Share Posted October 17, 2005 (edited) @TK: Each time - is pressed it hides all visable windows and displays the ones it previously hid @Nuffilein805: You could set up both configurations the way you want it. Some windows shown here. Some windows shown there. Each time you press - it will switch between them. Edited October 18, 2005 by gamerman2360 Link to comment Share on other sites More sharing options...
gamerman2360 Posted October 18, 2005 Share Posted October 18, 2005 (edited) Added more junk to it :expandcollapse popup; ---------------------------------------------------------------------------- ; ; AutoIt Version: 3.1.0 ; Author: Ghastly_MIB, Edited... ; ; Script Function: ; Hides your windows and replaces them with another set of windows. ; ; HotKeys: CTRL + Numberpad{-} = Switch windows, CTRL + ALT + ESC = Exit ; (The exit hotkey only works[when you configure it to beta] after exit is ; clicked in the tray icon menu, the other option is part of it's disguise. ; It's disguised so it looks like it's supposed to put the date in your clipboard.) ; ; ---------------------------------------------------------------------------- opt("WinTitleMatchMode", 2) opt("WinWaitDelay", 0) Global $desktop2_nr = 0, $desktop1_nr = 0, $exitready HotKeySet("^{NUMPADSUB}", "Hide");CTRL(^) + NUMPADSUB ;Comment this(below) if you don't use beta(Disguises the tray ico) opt("TrayMenuMode", 1) $DayOWeek = StringSplit("Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday", "|") $MonthOYear = StringSplit("January|February|March|April|May|June|July|August|September|October|November|December", "|") TraySetToolTip($DayOWeek[@WDAY] & ", " & $MonthOYear[@MON] & " " & @MDAY & ", " & @YEAR) TraySetClick(8) TraySetIcon("C:\WINDOWS\system32\shell32.dll", 167) $traygettime = TrayCreateItem("Get Date") TrayCreateItem("") $trayexit = TrayCreateItem("Exit") ;Uncomment this(below) if you dont use beta(Makes sure it can't close easily) ;Break(0) ;HotKeySet("^!{ESC}", "Terminate");CTRL(^) + ALT(!) + ESC (Confirms Exit) ;You must have had one of the last 2 sections uncommented and the other commented While 1 $tray = TrayGetMsg() Select Case $tray = $trayexit If $exitready Then HotKeySet("^!{ESC}") TrayItemSetState($trayexit, 4) $exitready = 0 Else HotKeySet("^!{ESC}", "Terminate");CTRL(^) + ALT(!) + ESC (Confirms Exit) TrayItemSetState($trayexit, 1) $exitready = 1 EndIf Case $tray = $traygettime ClipPut($DayOWeek[@WDAY] & ", " & $MonthOYear[@MON] & " " & @MDAY & ", " & @YEAR) EndSelect ;Comment the top part of the While if you don't have beta and uncomment the Sleep() below ;Sleep(30000) WEnd Func Hide() HotKeySet("{NUMPADSUB}") $list = WinList() If $desktop2_nr = 0 Then For $n = 1 To $list[0][0] If $list[$n][0] <> "" And $list[$n][0] <> "Program Manager" And BitAND(WinGetState($list[$n][1]), 2) Then $desktop2_nr = $desktop2_nr + 1 Assign("desktop2" & $desktop2_nr, $list[$n][1], 2) WinSetState($list[$n][1], "", @SW_HIDE) EndIf Next For $n = 1 To $desktop1_nr WinSetState(Eval("desktop1" & $n), "", @SW_SHOW) Next $desktop1_nr = 0 Else For $n = 1 To $list[0][0] If $list[$n][0] <> "" And $list[$n][0] <> "Program Manager" And BitAND(WinGetState($list[$n][1]), 2) Then $desktop1_nr = $desktop1_nr + 1 Assign("desktop1" & $desktop1_nr, $list[$n][1], 2) WinSetState($list[$n][1], "", @SW_HIDE) EndIf Next For $n = 1 To $desktop2_nr WinSetState(Eval("desktop2" & $n), "", @SW_SHOW) Next $desktop2_nr = 0 EndIf HotKeySet("^{NUMPADSUB}", "Hide") EndFunc ;==>Switch Func OnAutoItExit() For $n = 1 To $desktop1_nr WinSetState(Eval("desktop1" & $n), "", @SW_SHOW) Next For $n = 1 To $desktop2_nr WinSetState(Eval("desktop2" & $n), "", @SW_SHOW) Next EndFunc Func Terminate() Exit EndFunc Edited October 18, 2005 by gamerman2360 Link to comment Share on other sites More sharing options...
gamerman2360 Posted October 18, 2005 Share Posted October 18, 2005 (edited) Lol, wow, didn't catch this before... The icons dissappear on my desktop. I thought it just hid the windows... Edit: Oops, thought "Program Manager" ment something like taskmgr. Fixed it, my mistake... Edited October 18, 2005 by gamerman2360 Link to comment Share on other sites More sharing options...
gamerman2360 Posted October 18, 2005 Share Posted October 18, 2005 (edited) Wow, theres lots of these around... This kinda looks like the one here http://www.autoitscript.com/forum/index.php?showtopic=16092. Only that was started earlier and only works with MSIE. Just noticed it was there. Edited October 18, 2005 by gamerman2360 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