home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: WPS_PM / WPS_PM.zip / open201.zip / WPSExtS.doc < prev   
Text File  |  1997-11-20  |  6KB  |  169 lines

  1. WPS Extentions 1.0   (C) 1997  Samuel Audet <guardia@cam.org>
  2.  
  3.  
  4. WPSAgentSam class
  5. =================
  6.  
  7. This class will subclass WPObject and it should be replacing WPObject
  8. because it is the only way to have it initialized without creating a dummy
  9. object.  Once initialized (once and only once, when the WPS starts), it
  10. will start a thread waiting an input from a queue.  The following function
  11. that are importable from the DLL will facilitate the communication with
  12. this thread and its supported features.
  13.  
  14.    Background open fix
  15.    ===================
  16.  
  17.    This function will switch to the specified open views that it will find
  18.    to be opened.  So you can call this function right after
  19.    WinSetObjectData() or WinOpenObject() to fix the "background open"
  20.    problem.  SwitchToObject() will not open a view if none are currently
  21.    opened.  The C syntax is:
  22.  
  23.    BOOL _System SwitchToObject(HOBJECT hobj, ULONG view,
  24.                                              ULONG timeout, BOOL wait)
  25.  
  26.    where
  27.       hobj    Object permanent handle.
  28.       view    View of the object to switch to (see below).
  29.       timeout Amount of time to try to switch to the object.
  30.       wait    Wait or not to successful switch or timeout.
  31.               Should be FALSE if called from the PM thread.
  32.  
  33.    If wait is TRUE, the return code indicates if the object has been
  34.    sucessfully switched to, else it will always report FALSE.  It will try
  35.    up to timeout seconds to switch to the object, after which it will
  36.    return FALSE.  If WPSAgentSam thread is not found, it will return FALSE.
  37.  
  38.    If you don't have WPS view constant definitions, here they are:
  39.  
  40.          #define OPEN_DEFAULT       0
  41.          #define OPEN_SETTINGS      2
  42.          #define OPEN_CONTENTS      1
  43.          #define OPEN_TREE          101
  44.          #define OPEN_DETAILS       102
  45.          #define OPEN_HELP          3
  46.          #define OPEN_RUNNING       4
  47.          #define OPEN_PROMPTDLG     5
  48.          #define OPEN_PALETTE       121
  49.          #define OPEN_USER          0x6500
  50.  
  51.    I can't be sure about the exotic ones like OPEN_HELP or OPEN_USER, but I
  52.    have tested the first 5 ones.
  53.  
  54.    Note that I don't know all the WPS bugs (err... features), so sometimes it
  55.    just won't switch, and since WPSAgentSam only runs on one thread, if you
  56.    put a timeout of 30 minutes, it won't be able to do anything else.
  57.  
  58.  
  59.    Finding Object permanent handles from WPS drop
  60.    ==============================================
  61.  
  62.    This function will be able to convert the ulItemID of the "DRM_OBJECT"
  63.    mechanism from the DRAGITEM structure to an Object handle that can be
  64.    used with such things as WinOpenObject() and WinSetObjectData().  The C
  65.    syntax is:
  66.  
  67.    HOBJECT _System HObjectFromID(ULONG ulItemID, BOOL shadowresolve)
  68.  
  69.    where
  70.       ulItemID      ulItemID from DRAGITEM
  71.       shadowresolve Indicates if you want to have the real object handle if
  72.                     HObjectFromID() finds out it is a shadow.
  73.  
  74.    Thanks to Rick Fishman for the tip on the identity of ulItemID with
  75.    "DRM_OBJECT".
  76.  
  77.    It will return 0 if it cannot find the WPSAgentSam thread.
  78.  
  79.  
  80.    Query path, filename and title information from an HOBJECT
  81.    ==========================================================
  82.  
  83.    This function will be able to find path, real filename and title
  84.    information from an HOBJECT.  Can be used when saving HOBJECT and you
  85.    need to reload them with useful information to output to the user.  The
  86.    C syntax is:
  87.  
  88.    BOOL _System QueryPathTitle(HOBJECT hobj, BOOL shadowresolve,
  89.                                              BOOL truename, char path[])
  90.  
  91.    where
  92.       hobj          Object permanent handle.
  93.       shadowresolve Indicates if you want to have the real object informations
  94.                     if QueryPathTitle() finds out it is a shadow.
  95.       truename      Finds the object's truname instead of its title.
  96.       path          An array of chars for output.
  97.  
  98.    "path" will contain the fully qualified path + \ + title or the true name
  99.    depending on "truename" value.
  100.  
  101.    ex.: x:\Desktop\OS/2 System   or with true name
  102.         x:\Desktop\OS!2 System
  103.  
  104.         x:\Desktop\Programs\Utilites\OS/2 System Editor   or with true name
  105.         x:\Desktop\Programs\Utilites\
  106.  
  107.    If the "path" has been successfully filled with whatever WPSAgentSam found,
  108.    it will return TRUE.
  109.  
  110.    "path" will be a 0 length string if the object is invalid.
  111.  
  112.    You can make a strrchr() for the last backslash if you only want the
  113.    path or the file name.
  114.  
  115.    "path" should be of length 2*CCHMAXPATH for safety.
  116.  
  117.  
  118. FFolder class, the Filter Folder
  119. ================================
  120.  
  121. Once FFolder registered and WPFolder replaced, this new folder class will
  122. intercept FILTER= keys in the setup method of folder objects.
  123.  
  124. So, for example
  125.  
  126.     WinSetObjectData(hobj,"FILTER=*.C");
  127.  
  128. will set the folder object title filtering to *.C.  The filter is destroyed
  129. when the last view of a folder is closed.  Also, if a folder is already
  130. opened and the filter is changed, if you try to open it with
  131. WinSetObjectData() or WinOpenObject() and if concurent view is disabled,
  132. the folder will come foreground as expected, but will also refresh its
  133. contents to the new filter.
  134.  
  135. The object positions are not saved, and I do not plan on trying to... I
  136. think it will be a while until I make so darn complicated WPS extentions
  137. again without proper documentation (hear that IBM!??  what good is the WPS
  138. based on SOM if we can't get 90% of what we could with proper docs??)
  139.  
  140.  
  141. Anyway, I hope you will like them!
  142.  
  143.  
  144. Legal stuff
  145. ===========
  146.  
  147. This freeware product is used at your own risk, although it is highly
  148. improbable it can cause any damage.
  149.  
  150. If you plan on copying me, please give me the credits, thanks.
  151.  
  152. Source code is freely available, and done with VisualAge C++ 3.0.  I will
  153. send them to you on request unless you are planning to make money with it,
  154. in which case I would want to have a bit of $$$ for it.
  155.  
  156.  
  157. Contacting the author
  158. =====================
  159.  
  160. Samuel Audet
  161.  
  162. E-mail:    guardia@cam.org
  163. Homepage:  http://www.cam.org/~guardia
  164. Snail Mail:
  165.  
  166.    377, rue D'Argenteuil
  167.    Laval, Quebec
  168.    H7N 1P7   CANADA
  169.