home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BUG 2
/
BUGCD1997_01.iso
/
utils
/
winbatch
/
progman.wi_
< prev
next >
Wrap
Text File
|
1995-10-29
|
4KB
|
145 lines
;;Program manager WBT script. Adding/Deleting/Showing Program Manager Groups and Icons.
;; This script shows how to use DDE to communicate with Windows 3.1
;; and Windows NT (pre-Explorer).
;; With Windows 95 you can just put shortcuts into the Start Menu.
;;Written February 1994 by Wilson WindowWare, Inc.
;;Call Progman.wil
;;Syntax of commands:
;; Call("progman.wil", "AddGroup 'Group Title'")
;; ( , "DelGroup 'Group Title'")
;; ( , "AddIcon 'Group Title' 'File and Path' 'Icon Description'")
;; ( , "DelIcon 'Group Title' 'Icon Description'")
;; ( , "ShowGroup 'Group Title' ShowCommand")
;; ( , "ReplaceItem 'Group Title' 'Icon Description'")
;; ( , "Reload 'Group Title'")
;;Show command is an integer which specifies the action Program Manager is to perform on the group window.
;; VALUE ACTION
;; 1 Restores group to its original size and position.
;; 2 Displays group as an icon.
;; 3 Displays group as a maximized window.
;; 6 Minimizes the group window.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Check to see if Program manager is running. If not, run it.
AX=DDEInitiate("Progman", "Progman")
IF AX==0 ; Hmmm nobody's home
run("progman.exe","")
delay(2)
AX=DDEInitiate("Progman", "Progman")
If AX==0 ; ooooo its really dead. Give up
Message("Program Manager DDE Initiate", "Didn't work. Giving up. Going home")
return
endif
endif
ErrorMode(@OFF)
If AppExist("Progman.exe") then WinActivate("Program Manager")
ErrorMode(@ON)
ErrorMSG=""
; Fake a case statement with a string for a variable
Goto %Param1%
:ADDGROUP
;Add a group to program manager.
Err=DDEExecute(AX,"[CreateGroup(%param2%)]")
If Err==0 then ErrorMSG="[CreateGroup(%param2%)] Failed"
goto byebye
:DELGROUP
;Delete a group from the program manager.
Err=DDEExecute(AX,"[DeleteGroup(%param2%)]")
If Err==0 then ErrorMSG="[DeleteGroup(%param2%)] Failed"
goto byebye
:ADDICON
;Add an icon to a program group.
;show or create the group first.
DDEExecute(AX,"[CreateGroup(%param2%)]")
;Add the item.
Err=DDEExecute(AX,"[AddItem(%param3%,%param4%,,,-1,-1,,,0)]")
If Err==0 then ErrorMSG="[AddItem(%param3%,%param4%,,,-1,-1,,,0)] Failed"
goto byebye
:DELICON
;Delete an icon from the program manager.
;show or create the group
DDEExecute(AX,"[ShowGroup(%param2%,1)]")
;Delete the icon.
Err=DDEExecute(AX,"[DeleteItem(%param3%)]")
If Err==0 then ErrorMSG="[DeleteGroup(%param3%)] Failed"
goto byebye
:SHOWGROUP
;Show a program group.
;show or create the group
Err=DDEExecute(AX,"[ShowGroup(%param2%,%param3%,)]")
If Err==0 then ErrorMSG="[ShowGroup(%param2%,%param3%,)] Failed"
goto byebye
:RELOAD
;This command instructs Program Manager to remove and reload an existing group.
;Show the group.
DDEExecute(AX,"[ShowGroup(%param2%,1)]")
delay(2)
Err=DDEExecute(AX,"[Reload(%param2%)]")
If Err==0 then ErrorMSG="[Reload(%param2%)] Failed"
goto byebye
:REPLACEITEM
;This command deletes an item and records the position. A new item can be added to this
;position using AddIcon.
;Show the group.
DDEExecute(AX,"[ShowGroup(%param2%,1)]")
delay(2)
;record the position and delete existing group.
Err=DDEExecute(AX,"[ReplaceItem(%param3%)]")
If Err==0 then ErrorMSG="[ReplaceItem(%param3%)] Failed"
goto byebye
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
:byebye
DDETerminate(AX)
If ErrorMSG!="" then message("Progman DDE Failed", ErrorMSG)
RETURN