home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / icont190.zip / wptools.txt < prev   
Text File  |  1995-05-10  |  10KB  |  257 lines

  1.                          === DISCLAIMER ===
  2.  
  3.  
  4. I allow you to use and distribute WPTOOLS.DLL freely under the condition 
  5. that I am in no way responsible for any damage or loss you may suffer. 
  6.  
  7. Henk Kelder, 2:280/801.339@fidonet.org
  8.  
  9.  
  10. What is WPTOOLS.DLL:
  11.  
  12. WPTOOLS.DLL is a Dynamic Link Library that is contains code to query the
  13. settings for workplace shell objects. This DLL is used by WPSBKP.EXE but
  14. can also be used from within a REXX program.
  15.  
  16.  
  17. The following REXX functions are available:
  18.  
  19.  
  20.  
  21. Function: WPToolsLoadFuncs
  22. Purpose : Make the functions in WPTOOLS.DLL available to REXX.
  23.  
  24. Usage:
  25.  
  26. /*  First declare WPToolsLoadFuncs itself to REXX */
  27. call RxFuncAdd 'WPToolsLoadFuncs', 'WPTOOLS', 'WPToolsLoadFuncs' 
  28. /*  Call WPToolsLoadFuncs itself. */
  29. call WPToolsLoadFuncs
  30.  
  31.  
  32.  
  33. Function: WPToolsQueryObject
  34. Purpose : Query objects
  35.  
  36. Usage  :  rc=WPToolsQueryObject(object, [Class], [Title], [Setup], [Location])
  37.  
  38. Where:
  39.         object = A fully qualified pathname to a file or directory, or
  40.                  A OBJECTID string (e.g. <WP_DESKTOP>), or
  41.                  A string starting with a '#' and being followed
  42.                  by a hexidecimal objecthandle (See WPToolsFolderContent)
  43.  
  44.         Class  = The name of a REXX variabele enclosed in double quotes
  45.                  that will be created by WPTOOLS and will contain the
  46.                  classname of the object. This argument is optional.
  47.                  
  48.         Title  = The name of a REXX variabele enclosed in double quotes
  49.                  that will be created by WPTOOLS and will contain the
  50.                  Title of the object. This argument is optional.
  51.  
  52.         Setup  = The name of a REXX variabele enclosed in double quotes
  53.                  that will be created by WPTOOLS and will contain the
  54.                  Setupstring of the object. This argument is optional.
  55.  
  56.         Location = The name of a REXX variabele enclosed in double quotes
  57.                  that will be created by WPTOOLS and will contain the
  58.                  location of the object. This argument is optional.
  59.  
  60. Returns: 1 on succes and 0 when a error occured.
  61.  
  62. Please note that only the object argument is mandatory. All other arguments
  63. only need to be present when the result is needed. Should you not need one
  64. argument, but need a argument that is after the not needed one make sure
  65. you enter all comma's. (e.g.: rc = WPToolsQueryObject(object,,,"SetupString")
  66.  
  67. See Appendix I and II for information about objects and the setupvalues 
  68. this call returns.
  69.  
  70.  
  71. Example:
  72.  
  73. /* Rexx must start with a comment line */
  74.  
  75. call RxFuncAdd 'WPToolsLoadFuncs', 'WPTOOLS', 'WPToolsLoadFuncs' 
  76. call WPToolsLoadFuncs
  77.  
  78. iRetco = WPToolsQueryObject("<WP_DESKTOP>", "szClass", "szTitle", "szSetupString", "szLocation") 
  79. if iRetco Then do
  80.      say 'Classname :' szClass
  81.      say 'Title     :' szTitle
  82.      say 'Location  :'  szLocation
  83.      say 'Setupstring: ' szSetupString
  84.   end 
  85. else
  86.   say 'Unable to return object settings for <WP_DESKTOP>'
  87.  
  88. End of Example
  89.  
  90.  
  91. Function: WPToolsFolderContent
  92. Purpose : Query abstract (non-disk) objects in a specific folder
  93.  
  94. Usage   : rc=WPToolsFolderContent(folder, stem)
  95.  
  96. Where   : 
  97.  
  98.         folder = A fully qualified pathname to a or directory, or
  99.                  A OBJECTID string for a folder (e.g. <WP_DESKTOP>
  100.  
  101.         stem   = The name of a REXX Stem variable that on succesfull
  102.                  return will contain all abstract objects present
  103.                  in a specific folder. Each returned entry will either
  104.                  be a OBJECTID, when an OBJECTID has been set for 
  105.                  the returned object, or an string starting with a '#' and
  106.                  being followed by the hexadecimal objectid.
  107.  
  108.  
  109. Returns: 1 on succes and 0 when a error occured.
  110.  
  111. Example: 
  112.  
  113. /* Rexx must start with a comment line */
  114.  
  115. call RxFuncAdd 'WPToolsLoadFuncs', 'WPTOOLS', 'WPToolsLoadFuncs' 
  116. call WPToolsLoadFuncs
  117.  
  118. iRetco = WPToolsFolderContent("<WP_DESKTOP>", "list.")
  119. if iRetco = 0 Then Do
  120.    exit
  121. End
  122.  
  123. say 'Abstract objects on <WP_DESKTOP>:'
  124. do iObject = 1 to list.0
  125.   iRetco=WPToolsQueryObject(list.iObject, "szClass", "szTitle", "szSetupString", "szLocation") 
  126.   if iRetco Then do
  127.      say '"'szClass'", "'szTitle'", "'szSetupString'", "'szLocation'"'
  128.   end 
  129. end
  130.  
  131. End of Example
  132.  
  133. Function: WPToolsVersion
  134. Purpose : Query version of WPTOOLS.DLL
  135.  
  136. Usage  :  version=WPToolsVersion()
  137.  
  138. Example: 
  139.  
  140. /* Rexx must start with a comment line */
  141.  
  142. call RxFuncAdd 'WPToolsLoadFuncs', 'WPTOOLS', 'WPToolsLoadFuncs' 
  143. call WPToolsLoadFuncs
  144.  
  145. Version = WPToolsVersion()
  146. say 'WPTOOLS.DLL is of version' version
  147.  
  148. End of Example
  149.  
  150. APPENDIX I - The workplace shell class tree
  151.  
  152.       WPObject                       Base object class
  153.         ├── WPAbstract               Base abstract object class
  154.         │     ├── WPClock            
  155.         │     ├── WPCountry          
  156.         │     ├── WPDisk                     
  157.         │     ├── WPLaunchPad                
  158.         │     ├── WPKeyboard                 
  159.         │     ├── WPMouse                    
  160.         │     ├── WPPalette                  
  161.         │     │     ├── WPColorPalette       
  162.         │     │     ├── WPFontPalette        
  163.         │     │     └── WPSchemePalette      
  164.         │     ├── WPPower                    
  165.         │     ├── WPPrinter                  
  166.         │     ├── WPProgram                  
  167.         │     ├── WPShadow                   
  168.         │     │      └── WPNetLink           
  169.         │     ├── WPShredder                 
  170.         │     ├── WPSound                    
  171.         │     ├── WPSpecialNeeds             
  172.         │     ├── WPSpool                    
  173.         │     └── WPSystem                   
  174.         ├── WPFileSystem                     
  175.         │     ├── WPDataFile                 
  176.         │     │      ├── WPBitmap            
  177.         │     │      ├── WPIcon              
  178.         │     │      ├── WPMet               
  179.         │     │      ├── WPPif               
  180.         │     │      ├── WPPointer           
  181.         │     │      └── WPProgramFile       
  182.         │     │             └── WPCommandFile
  183.         │     ├── WPFolder                   
  184.         │     │      ├── WPDesktop           
  185.         │     │      ├── WPDrives            
  186.         │     │      ├── WPMinWinViewer      
  187.         │     │      ├── WPNetgrp            
  188.         │     │      ├── WPNetwork           
  189.         │     │      ├── WPRootFolder        
  190.         │     │      ├── WPServer            
  191.         │     │      ├── WPSharedDir         
  192.         │     │      ├── WPStartup           
  193.         │     │      └── WPTemplates         
  194.         │     └── WPWinConfig                
  195.         └── WPTransient                      
  196.               ├── WPJob                      
  197.               ├── WPPort                     
  198.               ├── WPPdr                      
  199.               └── WPQdr                      
  200.  
  201.  
  202. APPENDIX II  
  203.  
  204. WPToolsQueryObject has code to support (almost) all object classes for
  205. which object setupstrings are defined, being:
  206.  
  207. Class             Setup strings returned
  208. -----             ----------------------
  209.                       
  210. WPObject          CCVIEW, DEFAULTVIEW, HELPPANEL, HIDEBUTTON, MINWIN, NOCOPY,
  211.                   NODELETE, NODRAG, NODROP, NOLINK, NOMOVE, NOPRINT, NORENAME,
  212.                   NOSETTINGS, NOSHADOW, NOTVISIBLE, OBJECTID, TITLE
  213. WPAbstract        TEMPLATE
  214. WPProgram         ASSOCFILTER, ASSOCTYPE, EXENAME, MAXIMIZED, MINIMIZED,
  215.                   NOAUTOCLOSE, PARAMETERS, PROGTYPE, SET, STARTUPDIR
  216. WPShadow          SHADOWID
  217. WPRPrinter        NETID (1)
  218. WPPrint           APPDEFAULT, JOBDIALOGBEFOREPRINT, OUTPUTTOFILE, PORTNAME, 
  219.                   PRINTDRIVER, PRINTERSPECIFICFORMAT, PRINTWHILESPOOLING,
  220.                   QSTARTTIME, QSTOPTIME, QUEUENAME, QUEUEDRIVER, SEPARATORFILE
  221. WPServer          NETID (2)
  222. WPNetgrp          NETID (2)
  223. WPDisk            DRIVENUM
  224. WPFontPalette     FONTS, XCELLCOUNT, YCELLCOUNT, XCELLWIDTH, XCELLHEIGHT,
  225.                   XCELLGAP, YCELLGAP
  226. WPColorPalette    COLORS, XCELLCOUNT, YCELLCOUNT, XCELLWIDTH, XCELLHEIGHT,
  227.                   XCELLGAP, YCELLGAP
  228. WPFileSystem      MENU (3)
  229. WPProgramFile     ASSOCFILTER, ASSOCTYPE, EXENAME, MAXIMIZED, MINIMIZED,
  230.                   NOAUTOCLOSE, PARAMETERS, PROGTYPE, SET, STARTUPDIR
  231. WPFolder          ALWAYSSORT, BACKGROUND, DETAILSCLASS, DETAILSFONTS, 
  232.                   ICONFONT, TREEFONT, ICONNFILE, ICONVIEW, SORTCLASS, 
  233.                   TREEVIEW, DETAILSVIEW, WORKAREA,
  234. WPLaunchPad       All documented setupstrings.
  235.  
  236. (1) And all settings for WPPrint.
  237. (2) These settings cannot be used to recreate the object.
  238. (3) MENU doesn't work when applying.
  239.  
  240. For each object WPToolsQueryObject returns setupstring values for the object 
  241. itself (when supported) but also for all parent classes. When for example
  242. one uses WPToolsQueryObject against the desktop (class WPDesktop) setupstrings
  243. will be returned from the classes WPFolder, WPFileSystem and WPObject.
  244.  
  245. I did not build any support for WPSchemePalette because the setupstring
  246. for this class do not support settings the colors on an individual basis but
  247. instead one should specify a colorscheme name that is already present
  248. in the ini-files.
  249.  
  250.  
  251. HISTORY:
  252.  
  253. Version 1.00 - Initial release
  254.  
  255. Version 1.01 - Added support for the launchpad.
  256.                Added a new rexx api call: WPToolsVersion
  257.