home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1999 February
/
PCWorld_1999-02_cd.bin
/
software
/
Zkuste
/
WinBat98
/
PROGMAN.WI_
< prev
next >
Wrap
Text File
|
1996-10-24
|
6KB
|
196 lines
;;Program manager WBT script. Adding/Deleting/Showing Program Manager Groups and Icons.
;;Written February 1994 by Wilson WindowWare, Inc.
;;Modifed July 1995
;;Sept 96 Fixed bug in Reload. Added ListIcons Removed ProgBuild
;;Call Progman.wil
;;Syntax of commands:
;; Call("progman.wil", "AddGroup 'Group Title'")
;; ( , "DelGroup 'Group Title'")
;; ( , "AddIcon 'Group Title' 'File and Path' 'Icon Description''wrk dir'")
;; ( , "DelIcon 'Group Title' 'Icon Description'")
;; ( , "ShowGroup 'Group Title' ShowCommand")
;; ( , "ReplaceItem 'Group Title' 'Icon Description'")
;; ( , "Reload 'Group Title'")
;; ( , "IconDump 'Group Title''Icon Description' 'variable name'")
;; ( , "ListGroups 'variable name'") ; Sets variable to tab delimited list of groups
;; ( , "ListIcons 'Group Title' 'variable name'") ; Creates a tab delimited list of icons.
;; Call("progman.wil", "AddNewData '%grptitle%' '%data%'")
;;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
:ListGroups
;List groups.
%param2%=DDERequest(AX,"Groups")
If %param2%==0 then ErrorMSG="Groups Failed"
%param2%=strreplace(%param2%,@crlf,@tab)
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,%param5%,0)]")
If Err==0 then ErrorMSG="[AddItem(%param3%,%param4%,,,-1,-1,%param5%,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="[DeleteItem(%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("")] 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
:ADDNEWDATA
;Add an icon by adding all information. Use with Progbuild or IconDump to create line.
;show or create the group first.
DDEExecute(AX,"[CreateGroup(%param2%)]")
;Add the item.
Err=DDEExecute(AX,"[AddItem(%param3%)]")
If Err==0 then ErrorMSG="[AddItem(%param3%)] Failed"
goto byebye
:IconDump
;;This command accesses a group and then searches the group for a specific icon title.
;;The DDE Syntax for the icon is returned to the calling program as a variable.
;;Open a channel to a specified Group
groups= DDERequest(AX, param2)
groups = StrReplace(groups, @crlf, @tab)
groups = ItemSort(groups, @tab)
count=ItemCount(groups,@tab)
For j = 1 to count by 1
item = ItemExtract(j, groups, @tab)
itemicon=ItemExtract(1, item, ",")
if '"%param3%"'==itemicon then break ;; Compare each line to the specified icon title.
Next
if '"%param3%"'!=itemicon ;;If the specified icon title is found, break loop.
ErrorMSG="[IconDump] Failed"
break
else
%param4%=item ;;icon title is set to equal and then returned as the supplied variable name.
endif
goto byebye
:LISTICONS
;;
items = DDERequest(AX, param2) ;;Create a list of icons within chosen group.
If items==0 then errormsg="Ack, Ack, List Icon Error"
items = StrReplace(items, @crlf, @tab)
%param3%=items ;;icon title is set to equal and then returned as the supplied variable name.
goto byebye
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
:byebye
DDETerminate(AX)
If ErrorMSG!="" then message("Progman DDE Failed", ErrorMSG)
RETURN