home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: WPS_PM / WPS_PM.zip / xfld085s.zip / helpers / prfh.h < prev    next >
C/C++ Source or Header  |  1999-02-23  |  4KB  |  96 lines

  1.  
  2. /*
  3.  * winh.h:
  4.  *      header file for prfh.h, which
  5.  *      contains those Presentation Manager helper functions
  6.  *      which deal with Profile (Prf*) functions. These can be
  7.  *      used w/out the rest of the XFolder source in any PM
  8.  *      program.
  9.  *      This file is new with V0.82.
  10.  *
  11.  *      Copyright (C) 1997-99 Ulrich Möller.
  12.  *      This file is part of the XFolder source package.
  13.  *      XFolder is free software; you can redistribute it and/or modify
  14.  *      it under the terms of the GNU General Public License as published
  15.  *      by the Free Software Foundation, in version 2 as it comes in the
  16.  *      "COPYING" file of the XFolder main distribution.
  17.  *      This program is distributed in the hope that it will be useful,
  18.  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
  19.  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  20.  *      GNU General Public License for more details.
  21.  */
  22.  
  23. #if __cplusplus
  24. extern "C" {
  25. #endif
  26.  
  27. #ifndef PRFH_HEADER_INCLUDED
  28.     #define PRFH_HEADER_INCLUDED
  29.  
  30.     /*
  31.      * prfhQueryKeysForApp:
  32.      *      returns the keys list for an INI application. This
  33.      *      list is copied into a newly allocated buffer, of which
  34.      *      the address is returned.  You should free() this buffer
  35.      *      when you're done. Returns NULL upon errors.
  36.      */
  37.  
  38.     PSZ prfhQueryKeysForApp(HINI hIni,      // in: INI handle
  39.                             PSZ pszApp);    // in: application to query
  40.  
  41.     /*
  42.      * prfhCopyProfile:
  43.      *      this function copies a given profile into a
  44.      *      new file. hOld is the handle, pszOld the filename
  45.      *      of the profile to be copied (e.g. HINI_USERPROFILE
  46.      *      and "?:\OS2\OS2.INI"; pszNew must point to a
  47.      *      buffer which will contain the new filename ending
  48.      *      in ".XFL" after prfhCopyProfile returns
  49.      *      (e.g. "?:\OS2\OS2.XFL").
  50.      *      You may specify a Callback procedure which gets
  51.      *      called upon every copied application in the INI
  52.      *      file; this way, you can provide a progress bar.
  53.      *      fncbError gets called upon errors.
  54.      */
  55.  
  56.     BOOL prfhCopyProfile(HAB hab,               // in:  anchor block
  57.                          HFILE hfLog,           // in:  logfile handle or NULLHANDLE for no log
  58.                          HINI hOld,             // in:  HINI to copy
  59.                          PSZ pszOld,            // in:  fully qualif. filename of hOld
  60.                          PSZ pszNew,            // out: new filename
  61.                          PFNWP fncbUpdate,      // in:  progress callback
  62.                          HWND hwnd, ULONG msg, ULONG ulCount, ULONG ulMax,
  63.                                                 // in:  passed to fncbUpdate
  64.                          PFNWP fncbError,       // in:  error callback
  65.                          PULONG pulFunc2);      // in:  passed to fncbError
  66.  
  67.     /*
  68.      * prfhSaveINIs:
  69.      *      this will enforce saving of OS2.INI and OS2SYS.INI
  70.      *      by calling prfhCopyProfile (above) on them; the therefrom
  71.      *      resulting ".XFL" files will replace the original
  72.      *      ".INI" files.
  73.      *      Specify fncbUpdate and fncbError like in prfhCopyProfile.
  74.      */
  75.  
  76.     APIRET prfhSaveINIs(HAB hab,                // in:  anchor block
  77.                          HFILE hfLog,           // in:  logfile handle or NULLHANDLE for no log
  78.                          PFNWP fncbUpdate,      // in:  progress callback
  79.                          HWND hwnd, ULONG msg,  // in:  params passed to fncbUpdate
  80.                          PFNWP fncbError,       // in:  error callback
  81.                          PULONG pulFunc2);      // in:  passed to fncbError
  82.  
  83.     /*
  84.      * prfhQueryColor:
  85.      *      returns a system color in OS2.INI's PM_Colors as a LONG
  86.      */
  87.  
  88.     LONG prfhQueryColor(PSZ pszKeyName, PSZ pszDefault);
  89.  
  90. #endif
  91.  
  92. #if __cplusplus
  93. }
  94. #endif
  95.  
  96.