Ghastly_MIB Posted August 24, 2005 Share Posted August 24, 2005 Hey all, it's me again... Does anyone maby know how I can make 2 desktops? With a button it removes all the windows and show others And by clicking one more time it should switch everything back? Something like Private Desktop and Boss Key Thanks, Ghastly_MIB Link to comment Share on other sites More sharing options...
seandisanti Posted August 24, 2005 Share Posted August 24, 2005 Hey all, it's me again... Does anyone maby know how I can make 2 desktops?With a button it removes all the windows and show othersAnd by clicking one more time it should switch everything back?Something like Private Desktop and Boss Key Thanks,Ghastly_MIB<{POST_SNAPBACK}>neat idea... i may have to try this one out, sounds like a cool project. i can't work on it here at work, but will definitely try some stuff when i get home. the way i'd probably do it is with an ini file, or registry entries, listing the icons on each desktop, and then either moving the ones that shouldn't be displayed to a holding folder off the desktop Link to comment Share on other sites More sharing options...
Gigglestick Posted August 24, 2005 Share Posted August 24, 2005 Does anyone maby know how I can make 2 desktops?With a button it removes all the windows and show othersAnd by clicking one more time it should switch everything back?Here are a couple of options:1. Microsoft's Windows XP PowerToys include a utility for a Desktop Manager that sits on your taskbar and really just shows and hides windows based on which virtual desktop you're viewing. I'm not sure if it supports keystrokes, but it should be easy enough to write an AutoIt script to click the desktop buttons.2. Search some download sites, you'll probably find several decent, free solutions.3. The Win-D key combo will show the desktop. Win-M will minimize all. Repeat either one to undo the operation. Keep in mind that Win-D will undo itself when the next window is restored or an application is started. It's meant to provide quick access to the desktop icons, while restoring all windows once the desktop has been used.4. Write an AutoIt script that issues a Win-M or Win-D, followed by WinRestore's to some windows that you always keep open, such as your email, Word, Excel, a calculator, or whatever. You could probably even have it trigger after a timeout of no keyboard activity for a couple minutes... shorter than your screen saver, but I personally got myself in the habit of hitting Win-L when I turn away from the screen. My UDFs: ExitCodes Link to comment Share on other sites More sharing options...
seandisanti Posted August 24, 2005 Share Posted August 24, 2005 Here are a couple of options:1. Microsoft's Windows XP PowerToys include a utility for a Desktop Manager that sits on your taskbar and really just shows and hides windows based on which virtual desktop you're viewing. I'm not sure if it supports keystrokes, but it should be easy enough to write an AutoIt script to click the desktop buttons.2. Search some download sites, you'll probably find several decent, free solutions.3. The Win-D key combo will show the desktop. Win-M will minimize all. Repeat either one to undo the operation. Keep in mind that Win-D will undo itself when the next window is restored or an application is started. It's meant to provide quick access to the desktop icons, while restoring all windows once the desktop has been used.4. Write an AutoIt script that issues a Win-M or Win-D, followed by WinRestore's to some windows that you always keep open, such as your email, Word, Excel, a calculator, or whatever. You could probably even have it trigger after a timeout of no keyboard activity for a couple minutes... shorter than your screen saver, but I personally got myself in the habit of hitting Win-L when I turn away from the screen.<{POST_SNAPBACK}>tropsoft makes a product that displays different desktops, allows password lock etc also that you may want to check out for free, pre-made solutions, but i'm still going to try to create one and will post the code on here when i'm done Link to comment Share on other sites More sharing options...
Ghastly_MIB Posted August 24, 2005 Author Share Posted August 24, 2005 tropsoft makes a product that displays different desktops, allows password lock etc also that you may want to check out for free, pre-made solutions, but i'm still going to try to create one and will post the code on here when i'm done<{POST_SNAPBACK}>I know Private Desktop. I use that program... But I wan't to create my own one. Link to comment Share on other sites More sharing options...
Gigglestick Posted August 24, 2005 Share Posted August 24, 2005 Okay, if the purpose here is to learn, then you'll probably want to start a few processes in a hidden state for quick "swapping", get all visible window titles in a loop so you're ready at a moment's notice, use a hotkey to call a function that changes all visible windows to @SW_HIDE mode and your "safe" windows to @SW_SHOW mode, then sit idle until the hotkey is hit again, and swap the hidden and visible windows again, and continue monitoring for window titles.The WinList function has bits in its example that you can use for collecting the visible window titles and handles. I don't know how long it would take to collect titles/handles for all visible windows, which is why I mention doing it in a loop. If it's fast enough to do on-the-fly, then just put it at the beginning of your "swap" function.Sidenote: The hiding and showing of windows just gave me an idea. See this topic. My UDFs: ExitCodes Link to comment Share on other sites More sharing options...
Ghastly_MIB Posted August 24, 2005 Author Share Posted August 24, 2005 Is it not posible with a loop? $desktop1=0 $list = WinList() For $n=1 To $list[0][0] Dim $1desktop[$n] $1desktop[$n] = $list[$n][1] $desktop1 = $desktop1 + 1 Next For $n=1 To $desktop1 WinSetState($1desktop[$n], "", @SW_HIDE) Next Sleep(3000) For $n=1 To $desktop1 WinSetState($1desktop[$n], "", @SW_SHOW) Next But this won't work Link to comment Share on other sites More sharing options...
Gigglestick Posted August 24, 2005 Share Posted August 24, 2005 Is it not posible with a loop?You're on the right track. Now introduce hotkeys to do it and undo it.You might seriously consider using the OnAutoItExit() function just to make sure all your hidden windows are visible before the script exits, just in case it's killed from the system tray. My UDFs: ExitCodes Link to comment Share on other sites More sharing options...
Ghastly_MIB Posted August 25, 2005 Author Share Posted August 25, 2005 I found something, but that switches between all windows and processes. How can I skip the processes? #include <Constants.au3> HotKeySet("^s", "desktops") Func desktops2() $list = WinList() For $n=1 To $list[0][0] $RetVal = WinGetState($list[$n][1]) If $list[$n][0] <> "" Then If $RetVal = 5 Then WinSetState($list[$n][1], "", @SW_SHOW) Else WinSetState($list[$n][1], "", @SW_HIDE) EndIf EndIf Next EndFunc Please help Link to comment Share on other sites More sharing options...
Ghastly_MIB Posted August 26, 2005 Author Share Posted August 26, 2005 Never mind, i've found it:D:D 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