Important alert: (current site time 7/16/2013 3:06:28 AM EDT)
 

winzip icon

Virtual Desktop Manager (UPDATED VERSION 3.0)

Email
Submitted on: 6/13/2002 5:34:43 PM
By: Matt Crowley  
Level: Intermediate
User Rating: By 72 Users
Compatibility: VB 4.0 (32-bit), VB 5.0, VB 6.0
Views: 34109
author picture
 
     NEW Version 3.0! COMPILED SETUP AVAILABLE, SEE BELOW FOR INFO. NEW FEATURES AND CREDITS BELOW. Do you have so many programs running at once that you go crazy trying to keep at least a little organized? Do you want to be able to manage multiple desktops like you can on Linux/Gnome-based interfaces? VirtualDesktop is the exact answer to this problem. This simple yet powerful utility will alow you to have up to 10 'virtual' desktops running on your system. It does this by scanning for valid windows (ignores tasks) and manages them with API calls. This code is well commented and not very large. I hope you like the utility and please comment to help me improve it. Please vote. Thanks. NEW FEATURES FOR VERSION 2.0: - Instant access for each desktop with new Hotkeys (CONTROL + F1, CONTROL + F2, etc.); - Popup menu now checks the current desktop for better organization; - Tray icon signifies the current desktop number; - The program 'remembers' background settings for each of your 10 desktops; NEW FEATURES FOR VERSION 3.0: - User can Add and Remove Desktops; - Expanded program to allow up to 1024 desktops; - Improved tray popup menu; - Mouse over tray icon reveals current desktop; - Customizable hotkey configuration with the new VirtualDesktop Settings window; - Menus now as arrays which allow for easier coding (Thanks to Bob Shull); THANKS AND CREDITS go out to Bob Shull for his menu array coding, Clint LaFever for his suggestions and ideas, and to everyone who has commentes and contributed. If you want to help out and contribute to this ongoing project, check the top of the code in frmSettings for email information. COMPILED SETUP AVAILABLE: I created a setup program with the compiled version 3.0 in it. Its available for download at: http://www.amoebasolutions.com/software/setup.exe Thanks for all your votes and comments.

 

Windows API/Global Declarations:

Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
'**************************************
'Windows API/Global Declarations for :Virtual Desktop Manager (UPDATED VERSION 3.0)
'**************************************
See code
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
  3. Scan the source code with Minnow's Project Scanner

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 1 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

6/13/2002 5:45:21 PMDave

This should be code of the year, great job!!
(If this comment was disrespectful, please report it.)

 
6/13/2002 6:47:11 PMJohn Galanopoulos

Missing an msghook.ocx...
(If this comment was disrespectful, please report it.)

 
6/13/2002 8:44:28 PMJulien Gascon Samson

just rename msghook.oc_ to .ocx

great code! 5 globes
(If this comment was disrespectful, please report it.)

 
6/13/2002 9:47:02 PMPunk

holy jesus, and i thought having 2 desktops was nice...
one thing, shortcut keys =D
like control+number of desktop or something, just a suggestion
very nice!

Punk
(If this comment was disrespectful, please report it.)

 
6/13/2002 9:48:08 PMRyan

Very very nice, 5 globes
(If this comment was disrespectful, please report it.)

 
6/13/2002 9:59:46 PMmaxime caron

i al ready posted a better virtual desktop prog that also clone the desktop wallpaper and icon but it is a nice code anyway
(If this comment was disrespectful, please report it.)

 
6/13/2002 10:03:05 PMAdam Szabo

I wish they could give this, "Code of the Century" award, because it is SOOOOO GOOD!
(If this comment was disrespectful, please report it.)

 
6/13/2002 10:58:47 PMThe Code Monkey

Thanks for all your comments. Punk, im working on CTRL+number for easier use, thx for the suggestion and thanks to all for the votes.
(If this comment was disrespectful, please report it.)

 
6/14/2002 12:51:01 AMDave Lein

Good code but I think I'm going to stick with NVidia's Nview which can handle 30. But great code anyway.
(If this comment was disrespectful, please report it.)

 
6/14/2002 1:14:18 AMProASP

Fantastic stuff, I have been wanting to do this kinda thing for years ! now I finally can, thanks to your supreme code, 5 globes from me. note : It works perfect on win98 too :-)
(If this comment was disrespectful, please report it.)

 
6/14/2002 1:22:43 AMThe Code Monkey

Hey ProASP. Thanks for the comment and the vote. Also, thanks for the OS compatibility update. I was meaning to put that in my explination, but so far we got compatibility in 98 and XP, if anyone else has a different OS comment with a report on how it works in yours.

--Matt
(If this comment was disrespectful, please report it.)

 
6/14/2002 2:29:55 AMTRON

This project works great in Windows 2000 Advanced Server! :)
I use Service Pack 2 by the way for those who cares. 5 globals from me :P
(If this comment was disrespectful, please report it.)

 
6/14/2002 2:57:48 AMNick Spliff

Amazing, definately amazing work there matey. Five globey things from me.
(If this comment was disrespectful, please report it.)

 
6/14/2002 3:32:08 AMDaniel Pramel

I installed the Virtual Desktop Manager from Microsoft last week, but now i think about to remove it :-) it crashes sometimes, but your code...
cool - easy idea but very powerful.
Thanks for sharing it
5*
(If this comment was disrespectful, please report it.)

 
6/14/2002 3:39:56 AMGary

Cool stuff. Works fine on Win2k pro. 5*
(If this comment was disrespectful, please report it.)

 
6/14/2002 4:04:26 AMMadlew

WOW, this is great on Win2K!
Well done
(If this comment was disrespectful, please report it.)

 
6/14/2002 4:54:45 AMMadlew

Just one question.
What does the msghook control supposed to do? Thanks
(If this comment was disrespectful, please report it.)

 
6/14/2002 4:55:15 AMGreg De Haas

Very good.
One suggestion, isnt there a way of moving a window from one desktop to another?

Im particularly impressed at how many people bother to comment on it (nobody bothers with my C++ submissions)


(If this comment was disrespectful, please report it.)

 
6/14/2002 4:57:35 AMMadlew

Sorry about the previous coment, I just work it out. What a plonker I am.
(If this comment was disrespectful, please report it.)

 
6/14/2002 6:35:16 AMXoduS

Congratulations ! This is indeed a fine piece of work. Another example of how much is possible with just VB !
Keep it up !
(If this comment was disrespectful, please report it.)

 
6/14/2002 6:59:16 AMnavstar16

gr8 keep it up, nice code 5 globes
(If this comment was disrespectful, please report it.)

 
6/14/2002 7:18:01 AMWalter Brebels

Verry nice indeed
(If this comment was disrespectful, please report it.)

 
6/14/2002 7:26:09 AMWalter Brebels

Yet verry simple code, so verry powerfull, wish i could give you a 10, hope you won't mind me using your code (of course your name will be in the credits),

Thanks
(If this comment was disrespectful, please report it.)

 
6/14/2002 9:29:46 AMJose M Serrano

oohhh boy
What I can say !!!

this a piece of art. Perfect & Great !!
(If this comment was disrespectful, please report it.)

 
6/14/2002 11:26:12 AMThe Code Monkey

Thanks again to everyone for the comments. To Walter Brebels: Use the code all you want, I dont mind, thats why its on psc.
(If this comment was disrespectful, please report it.)

 
6/14/2002 11:32:46 AMNacho

This thing is AWESOME! 5 Globes
(If this comment was disrespectful, please report it.)

 
6/14/2002 12:09:39 PMLoather

it would be better if it also gave you a new desktop
(If this comment was disrespectful, please report it.)

 
6/14/2002 2:28:16 PMAdam Hall

Brillaint. Well done. There was a pretty good program which I used to use. However, it was old and shareware and obviously didnt come with source. So thanks very much dude. 5 globes.
(If this comment was disrespectful, please report it.)

 
6/14/2002 2:33:02 PM< Bob Shull >

Very nice -- One Suggestion though, If you use control arrays for your images and menu items you could reduce your code down to 1 sub vs 10 subs for your menu click event. I did this with very little effort. It makes for easier changes later, you only have to change it once vs 10 times. Great Program anyway just a suggestion.
(If this comment was disrespectful, please report it.)

 
6/14/2002 7:42:30 PMThe Code Monkey

Hey everyone. Thx again for the comments. I talked to Bob Shull and he sent me some code to add to the prog. Im going to update my zip file later tonight with that change along with the ability to have up to 1024 desktops along with customizable hotkeys.

-- Matt
(If this comment was disrespectful, please report it.)

 
6/15/2002 2:19:45 AMThe Code Monkey

Hey everyone. I updated this post by changing the zip and adding version 3.0. As you can read from above, there is a ton more options, and it all has to be accredited to you guys and your ideas. If you have any comments, questions, or critisizims on 3.0 post em up and ill be glad to update it.

-- Matt
(If this comment was disrespectful, please report it.)

 
6/15/2002 3:32:40 AMJason

Its me again. Buddy i discover a problem here. Why is that i got a message telling
(If this comment was disrespectful, please report it.)

 
6/15/2002 3:33:24 AMJason

Line 119: Cannot load control tspSettings; license not found.

(If this comment was disrespectful, please report it.)

 
6/15/2002 4:02:13 AMKenny Lai, Lai Ho Wa

Somebody bigger than Microsoft! 5 stars!
(If this comment was disrespectful, please report it.)

 
6/15/2002 9:49:51 AMAlex MF

Works great on Windows ME!
Just one thing programs like winamp don't function properly - Only the main form gets hidden.
(If this comment was disrespectful, please report it.)

 
6/15/2002 1:49:06 PMThe Code Monkey

Hey everyone. I created a setup program with the compiled version 3.0 in it. Its available for download at:

http://www.amoebasolutions.com/software/setup.exe

Thanks again for all your comments and votes.

-- Matt
(If this comment was disrespectful, please report it.)

 
6/15/2002 10:14:36 PMOpcodeVoid

This code sux, u broke rules, u summit compile ocx controls, this should be kick, I only following rules.
(If this comment was disrespectful, please report it.)

 
6/16/2002 12:55:50 AMThe Code Monkey

Im sorry you feel that way OpcodeVoid, i didnt mean to make people angry with this sumbission.

-- Matt
(If this comment was disrespectful, please report it.)

 
6/16/2002 2:36:08 AMThe Code Monkey

Hey again OpcodeVoid. I did a little "research" on PSC about how you "follow" the rules so often. It seems as though you are pissed because your entry was removed from C++ world, so not only did you post a entry that is not code, you have started to vote other entries on the leader board in VB world with a 1 rating (ex. Commercial XPCalendar(Updated on 14/06/2002) by Zhu JinYong). OpcodeVoid, just because you have issues with PSC why do you have to take it out on those who are really trying to work on their code and share it with the PSC community. I'd ask you to please stop doing this to me and my fellow programmers at PSC.

-- Matt
(If this comment was disrespectful, please report it.)

 
6/16/2002 10:15:56 AMDhaval Faria

Hey.. I am getting error Out Of Memory.. whats this mean?? please help me out.. please mail me..
(If this comment was disrespectful, please report it.)

 
6/16/2002 12:18:22 PMDhaval Faria

Hey.. thanks for mail me.. now there is no error.. actually that error was coming.. becoz I didnt register that .ocx file..
(If this comment was disrespectful, please report it.)

 
6/16/2002 8:08:24 PMçh@d $êTTêRbô

it does not work on my computer : ( i give it a 2. i will make an exception, if you send me the backgrounds and appearance of XP, i will give you a perfect five and i will tell all my frends to vote and they will do a 5, you think about that.
-CHad
(If this comment was disrespectful, please report it.)

 
6/16/2002 9:09:54 PMZhu JinYong

Creative idea.Thanks for Sharing it with PSC World.5 Balls from me.
(If this comment was disrespectful, please report it.)

 
6/17/2002 4:12:42 AMCharles Sollenberger

Gr8 Code 5 thingies from me. thx for sharing
(If this comment was disrespectful, please report it.)

 
6/19/2002 4:39:26 AMMohan

works great on win2000. 5 globes
(If this comment was disrespectful, please report it.)

 
6/20/2002 3:07:26 AMNick

Best I've ever seen: 5 from me
(If this comment was disrespectful, please report it.)

 
6/30/2002 12:42:09 AMChuckling Clown

you should make the background the same as the first one. it is ugly seeing the backcolour instead of the wallpaper.
(If this comment was disrespectful, please report it.)

 
7/13/2002 12:58:24 PMAdnan

Nice Job 100 Globes
(If this comment was disrespectful, please report it.)

 
10/11/2002 9:15:50 AMPhillip De Suze

Great work keep up the good work I can't wait to see what you will come up with next!
(If this comment was disrespectful, please report it.)

 
10/22/2002 7:40:48 AMluke20au

EXCELLENT, but could you had it for each desktop has it's each intervidual theme?
(If this comment was disrespectful, please report it.)

 
10/22/2002 3:03:27 PMPADSoft

I have just dloaded and run your Virtual Desktop project... and I do not need to see the code: 5 globes to it. It's nice, well finished and INCREDIBLY useful for people like me that can help having 25 windows open at the same time :)

Keep this good work!
(If this comment was disrespectful, please report it.)

 
10/30/2002 11:27:55 AMCharles R

You've definately got my vote * * * * *
(If this comment was disrespectful, please report it.)

 
11/13/2002 4:44:04 AM

Missing an msghook.ocx...
(If this comment was disrespectful, please report it.)

 
1/6/2003 6:39:07 AM

Rename the OCX!
(If this comment was disrespectful, please report it.)

 
3/11/2003 4:49:22 AM

nice
(If this comment was disrespectful, please report it.)

 
5/20/2003 11:01:14 AMPhillip Ponchot

Really great code for Virual Desktop. I appreciate you sharing the code.

Phillip
(If this comment was disrespectful, please report it.)

 
5/20/2003 11:01:24 AMPhillip Ponchot

Really great code for Virtual Desktop. I appreciate you sharing the code.

Phillip
(If this comment was disrespectful, please report it.)

 
6/3/2003 9:57:39 PM

GREAT Utility !!! A BIG 5 Globes..
Where can I find the source code for the msghook.ocx
(If this comment was disrespectful, please report it.)

 
6/22/2003 7:38:49 PMCodeFester

I like it alot. 5 nuts from me.
(If this comment was disrespectful, please report it.)

 
7/7/2003 2:40:57 PM

Excellent work .. Worth 5 globes
Just one suggestion; a pop-up desktop browser (i.e. shows thumbnails of each desktop)
(If this comment was disrespectful, please report it.)

 
7/7/2003 8:16:03 PM

Great code. Is it possible to set it up so that each desktop is individualised i.e. on one desktop there might be certain icons/shortcuts and on another there are different ones according to the different tasks that you do in each environment. I often have to do demos of programmes and want a tidy desktop to be seen whereas when I'm developing my desktop gets rather messy - it'd be good to have one that was always tidy for demos etc.
(If this comment was disrespectful, please report it.)

 
7/8/2003 6:51:19 PM

Works beautifully in WinNT 4.00.1381. Oustanding submission - 5 from me!
(If this comment was disrespectful, please report it.)

 
12/19/2003 10:23:38 PMAndre Laurin

Very nice code. Worth 5!
(If this comment was disrespectful, please report it.)

 
11/25/2004 1:40:30 AMJames...

As a suggestion when you remove a dektop check to see if it is the selected one. If it is ask the user which desktop they want or go the first one.
(If this comment was disrespectful, please report it.)

 
4/12/2005 9:58:33 AM

how comt this version doesnt contain the desktop wallpaper but the earlier verion dose
(If this comment was disrespectful, please report it.)

 
4/16/2005 8:27:02 PM

This is great stuff to say the least!!.
I hope you don't mind, but I recompiled
it with vb4 32bit.Only needed minor changes - like added "Function Split"
vb4 don't do split.
Compiles and ran it on XP-SP1 + XP-SP2.
Not a problem at all ...
Thanks for sharing a great piece of work.
10 outa 10 from me.

cheers Bri.



(If this comment was disrespectful, please report it.)

 
5/12/2005 3:30:22 AM

This is great stuff to say the
least!!.
I hope you don't mind, but I
recompiled it with vb4 32bit.
Had to add a "Function Split"
vb4 don't do split.

Compiled and ran it on XP-SP1 +
XP-SP2.
Not a problem at all
...
Thanks for sharing a great piece
of work.
10 outa 10 from me.
cheers
Bri.
(If this comment was disrespectful, please report it.)

 
8/18/2006 3:03:39 PMChad

there was a question back on 6/14/2002 4:55:15 AM: from Greg De Haas that asked about moving windows from one desktop to another.... did you ever answer that?? other than that...awesome i love it, and i like the way you handled the 'Bad Apple' (OpcodeVoid)on 6/15/2002 10:14:36 PM:. You did a great job with this and deserve the credit and globes. Please let me know if you have and answer to the moving of windows

thnx, Chad
(If this comment was disrespectful, please report it.)

 
10/15/2007 2:28:25 PMkerplunk_boy

Hmmm... it gave me one idea, IF i can manipulate desktops that are not in focus, i can make something similar to a terminal server, sending and receiving information through winsock, with a special client program, of course... what do you think dude?
(If this comment was disrespectful, please report it.)

 
2/2/2008 1:15:24 PMSuNcO

Very good work. I made some changes as ask for a password when click on the trayicon

I found a bug in it. If you run mIRC and connect to a server and change the desktop, the mIRC appear on every desktop
(If this comment was disrespectful, please report it.)

 
2/24/2008 8:00:03 AMNguyen Luu Ngoc

looks like lots of hard working here...
but too bad, i still have to say:
1. you can use for-next instead of complex loops
2. you can use GetAsyncKeyState for hotkeys
(If this comment was disrespectful, please report it.)

 
6/13/2008 1:55:59 AMNguyen Luu Ngoc

i've found quite a big bug: it can't hide windows which don't have a caption/border, for example: skinned windows
(If this comment was disrespectful, please report it.)

 
6/13/2008 1:56:19 AMNguyen Luu Ngoc

i've found quite a big bug: it doesn't hide windows which don't have a caption/border, for example: skinned windows
(If this comment was disrespectful, please report it.)

 
10/30/2010 4:06:10 AMBuzz

wow...its cool dude! 5 Globe For you!
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.