home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Win 3.11 Apps
/
win311aps.iso
/
NORTON
/
MINALL.S!
/
MINALL.SM
Wrap
Text File
|
1993-11-15
|
2KB
|
87 lines
/**********************************************************************
* MINALL.SM - Sample ScriptMaker file to minimize all windows except
* NDW menu, drive windows and groups.
*
* The best way to use this is to add an item to the Launch List and assign
* it a hotkey. When you're in a maximized application, you can hit the hotkey
* and everything but NDW will be set to an icon so you can get to all of your
* drive and tool icons.
*
* USES:
* AppActivate
* AppList
* AppGetState
* AppSetState
* Declare
* Dim
* For..Next
* Function
* If..Then..Else
* InStr
* Len
* ReadINI
* Space
* Sub
* Trim
* UBound
* While..Wend
* WinFind
*
* Written by Ted Sadler
* ⌐ 1993 Symantec Corporation
*********************************************************************/
'Need to call Windows API function to get class of window
Declare Function GetClassName Lib "User" (ByVal hWnd As Integer, ByVal lpClassName As String, ByVal nMaxCount As Integer) As Integer
'Test to see if the string contains NDW's normal title
Function IsNDW(window As String) As Integer
'Get NDW's current title
NDWTitle$ = ReadINI$("Configuration", "BannerTitle", "ndw.ini")
IsNDW = FALSE 'Assume that it isn't
If InStr(window, NDWTitle) Then
IsNDW = TRUE 'It is NDW
End If
End Function
Sub Main
Dim wins() As String
Dim i As Integer
'get list of windows into array
AppList wins
'Save this value for speed
ulim=UBound(wins)
For i = 0 To ulim
' save this value for speed
a$ = wins(i)
If (IsNDW(a) = False) Then
'If it's already minimized, we don't need to minimize it again
If (AppGetState(a) <> WS_MINIMIZED) Then
' Get the handle to the window so we can get the class name
hWnd = WinFind(a)
Class$ = Space$(128)
' Get current window's class name
nClass = GetClassName(hWnd, Class, 128)
'Removing spaces before and after the name
class = Trim$(class)
' If it isn't one of NDW's groups, minimize it
If Class <> "QuickAccessGroup" Then AppSetState 2, a
End If
Else
'It is NDW so save it to activate at the end
NDW$ = a
End If
Next i
'Now make NDW the active window
AppActivate(NDW)
End Sub