How To Minimize All Windows - Tutorial

Use this board to post your code snippets - tips and tricks
16 posts Page 2 of 2
User avatar
mikethedj4
VIP - Site Partner
VIP - Site Partner
Posts: 2592
Joined: Thu Mar 25, 2010 4:36 am

hungryhounduk wrote:
yes Good One Livengood :)
x2
User avatar
Agust1337
Coding God
Coding God
Posts: 2456
Joined: Fri Feb 19, 2010 8:18 pm

Livengood wrote:
agust1337 wrote:
Livengood wrote:
Hey everyone :)
i am here to show you guys how to Minimize all the windows with Vb.Net
first to start it off

Put this code under the - Public Class [Project Name]
Code: Select all
      Private Declare Sub keybd_event Lib "user32" ( _
         ByVal bVk As Byte, _
         ByVal bScan As Byte, _
         ByVal dwFlags As Long, _
         ByVal dwExtraInfo As Long)

      Const KEYEVENTF_KEYUP = &H2
      Const VK_LWIN = &H5B
This code i the private declare which is used to minimize all the windows to the tray

now lets say you want to make a button minimize all windows, *adding this code + the private declare all windows will become minimized :)
Code: Select all
Call keybd_event(VK_LWIN, 0, 0, 0)
         Call keybd_event(77, 0, 0, 0)
         Call keybd_event(VK_LWIN, 0, KEYEVENTF_KEYUP, 0)
Nice, but is it the open OS windows or open program windows that the person just made?

If so then its just easier to do:
Go to Form1_Move
Code: Select all
 If Me.WindowState = FormWindowState.Minimized Then
              form2.windowsstate = FormWindowState.Minimized
          Else
             'the maximized code's go here :P
Thats for the windows OS, what code are you looking for?
this :
form2.windowsstate = FormWindowState.Maximized
No no I know that but I was asking which it was for :P
Top-notch casual Dating
User avatar
Livengood
Serious Programmer
Serious Programmer
Posts: 445
Joined: Tue Feb 16, 2010 6:24 am

agust1337 wrote:
Livengood wrote:
agust1337 wrote:

Nice, but is it the open OS windows or open program windows that the person just made?

If so then its just easier to do:
Go to Form1_Move
Code: Select all
 If Me.WindowState = FormWindowState.Minimized Then
              form2.windowsstate = FormWindowState.Minimized
          Else
             'the maximized code's go here :P
Thats for the windows OS, what code are you looking for?
this :
form2.windowsstate = FormWindowState.Maximized
No no I know that but I was asking which it was for :P
o haha, this is use for the the main desktop of your computer
Image
User avatar
rocky4126
VIP - Donator
VIP - Donator
Posts: 258
Joined: Mon Nov 16, 2009 7:39 pm

hmm may come in useful one day for my apps!

~John
Image
User avatar
Martin
Supreme VIP
Supreme VIP
Posts: 369
Joined: Sat Aug 01, 2009 12:26 pm

i have seen this on some other forum to.
Image
User avatar
Axel
Coding God
Coding God
Posts: 1928
Joined: Sun Jun 27, 2010 9:15 pm

Thats a bump.
http://vagex.com/?ref=25000
16 posts Page 2 of 2
Return to “Quick Snips”