|
-
Dec 4th, 1999, 08:02 AM
#1
I'm sure there's a much simpler way to do this, but I can't think of it off the top of my head, although this will do the job..
In a Module..
Code:
Public Declare Function EnumWindows Lib "user32" (ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Declare Function IsWindowVisible Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Const WS_MINIMIZEBOX = &H20000
Private Const SW_MINIMIZE = 6
Private Const GWL_STYLE = (-16)
Public Function EnumProc(ByVal hwnd As Long, ByVal lParam As Long) As Long
'Make sure the Window is Visible and Minimizable..
If IsWindowVisible(hwnd) Then
If (GetWindowLong(hwnd, GWL_STYLE) And WS_MINIMIZEBOX) = WS_MINIMIZEBOX Then
'Minimize it
Call ShowWindow(hwnd, SW_MINIMIZE)
End If
End If
EnumProc = hwnd
End Function
In a Form..
Code:
Private Sub Command1_Click()
Call EnumWindows(AddressOf EnumProc, 0)
End Sub
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
-
Dec 4th, 1999, 10:41 AM
#2
Hyperactive Member
Thank you, it works just fine.
LG
-
Dec 4th, 1999, 12:15 PM
#3
Hyperactive Member
When My application starts, I would like to minimize all previously opened by user applications.
How can i do that?
-
May 18th, 2023, 02:41 PM
#4
Hyperactive Member
Re: Minimaze All
Or just:
Code:
Call CreateObject("Shell.Application").MinimizeAll
Call CreateObject("WScript.Shell").Popup("Hello, world!")
Call CreateObject("Shell.Application").UndoMinimizeAll
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|