home *** CD-ROM | disk | FTP | other *** search
/ Informática Multimedia: Special Games / INFESPGAMES.mdf / os2 / spl / src / splhelp.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1994-07-26  |  2.2 KB  |  72 lines

  1. /* bookwin.cpp:  Spellbook control program
  2.  
  3.     Copyright (C) 1993, 1994 John-Marc Chandonia
  4.  
  5.     This program is free software; you can redistribute it and/or modify
  6.     it under the terms of the GNU General Public License as published by
  7.     the Free Software Foundation; either version 2 of the License, or
  8.     (at your option) any later version.
  9.  
  10.     This program is distributed in the hope that it will be useful,
  11.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.     GNU General Public License for more details.
  14.  
  15.     You should have received a copy of the GNU General Public License
  16.     along with this program; if not, write to the Free Software
  17.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18. */
  19.  
  20. #define INCL_WIN
  21. #include <os2.h>
  22. #include "splhelp.hpp"
  23. #include "spldlg.h"
  24.  
  25. extern HWND hwndhelp;
  26. extern HWND hwndspellhelp;
  27.  
  28. // create a general help instances hwndhelp and hwndspellhelp.
  29. void init_help(HAB hab) {
  30.     HELPINIT hi;
  31.  
  32.     // set up helpinit
  33.     hi.cb = sizeof(HELPINIT);
  34.     hi.ulReturnCode = 0;
  35.     hi.pszTutorialName = NULL;
  36.     hi.hmodHelpTableModule = NULLHANDLE;
  37.     hi.hmodAccelActionBarModule = 0;
  38.     hi.idAccelTable = 0;
  39.     hi.idActionBar = 0;
  40.     hi.phtHelpTable = (PHELPTABLE)MAKEULONG(BOOKMENU,0xFFFF);
  41.     hi.pszHelpWindowTitle = (PSZ)"Spellbook Help";
  42.     hi.pszHelpLibraryName = (PSZ)"spl.hlp";
  43.     hi.fShowPanelId = CMIC_HIDE_PANEL_ID;
  44.     
  45.     hwndhelp = WinCreateHelpInstance(hab,&hi);
  46.  
  47.     if (hwndhelp && hi.ulReturnCode) {
  48.     WinDestroyHelpInstance(hwndhelp);
  49.     hwndhelp = NULL;
  50.     }
  51.  
  52.     hi.ulReturnCode=0;
  53.     hi.phtHelpTable = (PHELPTABLE)MAKEULONG(SPELLMENU,0xFFFF);
  54.  
  55.     hwndspellhelp = WinCreateHelpInstance(hab,&hi);
  56.  
  57.     if (hwndspellhelp && hi.ulReturnCode) {
  58.     WinDestroyHelpInstance(hwndspellhelp);
  59.     hwndspellhelp = NULL;
  60.     }
  61.  
  62.     if ((hwndhelp==NULL) || (hwndspellhelp==NULL)) {
  63.     // complain about help not being available
  64.     WinMessageBox(HWND_DESKTOP,
  65.               HWND_DESKTOP,
  66.               (PSZ)"Help Not Available",
  67.               (PSZ)"Couldn't find SPL.HLP",
  68.               102,
  69.               MB_OK | MB_ICONEXCLAMATION);
  70.     }
  71. }
  72.