Results 1 to 11 of 11

Thread: minimize all windows

  1. #1

    Thread Starter
    Fanatic Member Crash893's Avatar
    Join Date
    Dec 2005
    Posts
    930

    minimize all windows

    Hey all.

    a couple of my users are using a remote control program and cant use shortcuts like windows key + M to minimize all the open windows.

    I wanted to try to do this programicly ( i have a existing program that i can assigne hot keys to ( ctrl+shfit+M) or something like that)


    does anyone have decent way to minimize all the windows?

  2. #2
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    Re: minimize all windows

    you could always do SendKeys.....

    http://msdn.microsoft.com/en-us/libr...ys(VS.71).aspx

    MVP 2007-2010 any chance of a regain?
    Professional Software Developer and Infrastructure Engineer.

  3. #3
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,547

    Re: minimize all windows

    Quote Originally Posted by Techno
    ***?


    Anyways your best bet is going through every window and sending the minimize message. If you need an example let me know.

  4. #4
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    Re: minimize all windows

    no.... not really. best bet is to use SendKeys as it would save alot of time. Send the WindowsKey and the D key together. simple as.

    MVP 2007-2010 any chance of a regain?
    Professional Software Developer and Infrastructure Engineer.

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: minimize all windows

    Given that SendKeys.Send provides no modifier for the Windows key, it's not that easy after all. I think you'd have to use the SendInput API as there is a VK value for the Windows key.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  6. #6
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    Re: minimize all windows

    why not get the Windows key string and pass it? im sure I did this a long time ago for someone else....
    Last edited by Techno; Nov 24th, 2008 at 01:59 AM.

    MVP 2007-2010 any chance of a regain?
    Professional Software Developer and Infrastructure Engineer.

  7. #7
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: minimize all windows

    Quote Originally Posted by Techno
    why not get the Windows key string and pass it?
    There is no string for the Windows key, or at least the documentation certainly doesn't indicate that there is. The documentation for SendKeys.Send specifies the string representations of various special keys and the Ctrl, Shift and Alt modifiers. No mention of the Windows key.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  8. #8
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: minimize all windows

    you could shell the quicklaunch icon that does this, if it's a given that the icon will be there. You could even distribute the program with a copy of the shortcut in your program's folder and you will know it's there.
    the shortcut is actually made up of a text file named showdesktop.scf and containing only this text:
    Code:
    [Shell]
    Command=2
    IconFile=explorer.exe,3
    [Taskbar]Command=ToggleDesktop
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  9. #9

    Thread Starter
    Fanatic Member Crash893's Avatar
    Join Date
    Dec 2005
    Posts
    930

    Re: minimize all windows

    how would i translate that into code?

  10. #10
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: minimize all windows

    shell("showdesktop.scf") or something similar
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  11. #11
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    Re: minimize all windows

    no thats incorrect.
    you would need to use the Process.Start approach, or use the ProcessStartInfo classs to further customize the operation. Both of which are located in the System.Diagnostics namespace. Example:

    System.Diagnostics.Process.Start("MyFile.ext");

    MVP 2007-2010 any chance of a regain?
    Professional Software Developer and Infrastructure Engineer.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width