www.pudn.com > helpview.zip > General.h, change:1997-10-15,size:7562b


/* 
  
Copyright 1997 Willows Software, Inc.  
 
This library is free software; you can redistribute it and/or 
modify it under the terms of the GNU Library General Public License as 
published by the Free Software Foundation; either version 2 of the 
License, or (at your option) any later version. 
 
This library is distributed in the hope that it will be useful, 
but WITHOUT ANY WARRANTY; without even the implied warranty of 
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
Library General Public License for more details. 
 
You should have received a copy of the GNU Library General Public 
License along with this library; see the file COPYING.LIB.  If 
not, write to the Free Software Foundation, Inc., 675 Mass Ave, 
Cambridge, MA 02139, USA. 
 
*/ 
 
/************************************************************************* 
* 
* GENERAL.H 
* General defines for entire project.      
* 
* Author: Paul E. Kissel 
* 
**************************************************************************/ 
 
#ifndef GENERAL_H 
#define GENERAL_H 
 
 
/*********************************** 
** 
**  System Includes 
** 
***********************************/ 
#include <windows.h> 
#include <stdlib.h> 
 
 
/************************************* 
* 
*  Shared Defines 
* 
**************************************/ 
 
/* Private messages. */ 
#define HELPWM_CLOSE            (WM_USER + 1)          
#define PRIVMSG_SHOWNEWTOPIC    (WM_USER + 2) 
#define PRIVMSG_SHOWHISTORY     (WM_USER + 3) 
#define PRIVMSG_ADDHISTTOPIC    (WM_USER + 4) 
#define PRIVMSG_UPDATEHISTPOS   (WM_USER + 5) 
#define PRIVMSG_CLEARHISTPOS    (WM_USER + 6) 
#define PRIVMSG_RESIZE          (WM_USER + 7) 
#define PRIVMSG_USEBGCOLOR      (WM_USER + 8) 
#define PRIVMSG_HELP_CONTENTS   (WM_USER + 9) 
 
/* Force exiting of app. on WM_CLOSE message. */ 
#define EXIT_APP  1 
 
/*  
** When telling secondary windows to close, this message 
** is you to tell them not to report that they are closing. 
*/ 
#define DONT_REPORT_CLOSING 1 
 
/*  
** Structure passed in the PRIVMSG_SHOWNEWTOPIC message's 
** lParam parameter. 
*/ 
typedef struct tagNEWTOPICSTRUCT 
{ 
  HGLOBAL hNewTopicsData;     /* Handle to new topic's data. */ 
  BOOL    bUpdateBackList;    /* Update the "Back" list with the topic data. */ 
  BOOL    bFromHistoryBack;   /* Is this a topic from the back list or history list. */ 
  WORD    wVertPos;           /* Initial vertical scroll position. */ 
  COLORREF ScrollColor;       /* Background color to use for scrolling secondary window. */ 
  COLORREF NonScrollColor;    /* Background color to use for non-scrolling secondary window. */ 
}  
NEWTOPICSTRUCT; 
typedef NEWTOPICSTRUCT * FPNEWTOPICSTRUCT; 
 
 
/* 
** 
** Message atoms strings. 
** 
*/ 
/* String used when registering the WM_WINDOC message. */ 
#define MSWIN_DOC_MSG_STRING  "WM_WINDOC" 
 
 
/*  
** Window class names for a visible topic window and a visible  
** popup window.  
*/ 
#define MAINSEC_CLASS      "WILL_HELP_MAINSEC" 
#define TOPICSEC_CLASS     "WILL_HELP_TOPICSEC" 
#define JUMPSCROLL_CLASS   "WILL_HELP_JUMPSCROLL" 
#define JUMPNOSCROLL_CLASS "WILL_HELP_JUMPNOSCROLL" 
#define POPUP_CLASS        "WILL_HELP_POPUP" 
 
/* System dependent defines. */ 
#define DIR_SEP_CHAR  '\\' 
#define DIR_SEP_STR   "\\" 
#define EXT_CHAR '.'            
 
 
/* Button bar button values. */ 
#define CONTENTS_BUTTON_ID  "btn_contents" 
#define SEARCH_BUTTON_ID    "btn_search" 
#define BACK_BUTTON_ID      "btn_back" 
#define HISTORY_BUTTON_ID   "btn_history" 
#define PREV_BUTTON_ID      "btn_previous" 
#define NEXT_BUTTON_ID      "btn_next" 
 
 
/* Default menu values. */ 
#define FILE_MENU_ID              "mnu_file" 
#define FILE_OPEN_MENU_ID         "mnu_file_open" 
#define FILE_PRINTTOPIC_MENU_ID   "mnu_file_print" 
#define FILE_PRINTSETUP_MENU_ID   "mnu_file_printsetup" 
#define FILE_EXIT_MENU_ID         "mnu_file_exit" 
 
#define EDIT_MENU_ID              "mnu_edit" 
#define EDIT_COPY_MENU_ID         "mnu_edit_copy" 
#define EDIT_ANNOTATE_MENU_ID     "mnu_edit_annotate" 
 
#define BOOKMARK_MENU_ID          "mnu_bookmark" 
#define BOOKMARK_DEFINE_MENU_ID   "mnu_bookmark_define" 
                             
#define HELP_MENU_ID              "mnu_help" 
#define HELP_HELPONHELP_MENU_ID   "mnu_help_helponhelp" 
#define HELP_ALWAYSONTOP_MENU_ID  "mnu_help_alwaysontop" 
#define HELP_ABOUT_MENU_ID        "mnu_help_about" 
 
/* Name of the default "Help on Help" help file's name. */ 
#define DEFAULT_HELPONHELP_FILENAME  "twinhelp.hlp" 
 
 
/* Page position info. used in various places. */ 
typedef struct tagPOSRECT  
{     
  long int left; 
  long int top; 
  long int right; 
  long int bottom; 
}  
POSRECT; 
typedef POSRECT * FPPOSRECT; 
 
/* Page position info. used in various places. */ 
typedef struct tagPOSPOINT  
{     
  long int x; 
  long int y; 
}  
POSPOINT; 
typedef POSPOINT * FPPOSPOINT; 
 
/* Name of main icon in resource file. */ 
#define MAIN_ICON "TWINHELP" 
 
/* Secondary window strings max. sizes. */ 
#define MAX_SEC_TYPE     10 
#define MAX_SEC_NAME      9 
#define MAX_SEC_CAPTION  51 
 
/* A path to a help file can contain a path, '>', and the name. */ 
#define MAX_HLPPATH  ( _MAX_PATH + sizeof(char) + MAX_SEC_NAME ) 
             
/*  
** Separator token used to specify, in a filepath or after a topic, a target window 
** to show the topic in. 
*/ 
#define WINDOW_SEP_TOKEN_STR  ">" 
#define WINDOW_SEP_TOKEN_CHAR '>' 
 
/* Maximum length of a help class name. */ 
#define MAX_CLASS_NAME   20                    
 
 
/************************************* 
* 
*  Shared Functions 
* 
**************************************/ 
 
LRESULT CALLBACK MainWndProc( HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam ); 
LRESULT CALLBACK TopicWndProc( HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam ); 
LRESULT CALLBACK NoScrollTopicWndProc( HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam ); 
LRESULT CALLBACK PopupWndProc( HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam ); 
LRESULT CALLBACK MainSecWndProc ( HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); 
LRESULT CALLBACK TopicSecWndProc( HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam ); 
void SendShowNewTopicMsg 
(  
  HWND    hTopicWnd,  
  HGLOBAL hNewTopicsData, 
  BOOL    bUpdateBackList, 
  BOOL    bFromHistoryBack, 
  WORD    wVertPos 
); 
 
BOOL ShowBackTopic( HWND hDataWnd ); 
 
void SetBrowseButtonsTopics( HWND hDataWnd ); 
 
BOOL DoHelpContentsButton( HWND hDataWnd ); 
 
void ShowHistory( HWND hDataWnd );  
 
BOOL DoPrevButton( HWND hDataWnd ); 
BOOL DoNextButton( HWND hDataWnd ); 
 
BOOL DoHelpContentsMsg( HWND hDataWnd, char * HelpFilePathPtr ); 
BOOL DoHelpSetContentsMsg( HWND hDataWnd, char * ContentsHelpFilePath, long int nContentsContext ); 
 
void OpenFileMenuItem( HWND hWnd ); 
 
BOOL DoHelpOnHelpMsg( HWND hWnd ); 
 
void ShowAboutDialogBox( HWND hParentWnd, HWND hMainWnd ); 
 
BOOL DoHelpContextMsg 
(  
  HWND hDataWnd, 
  char * szHelpFilePath,  
  unsigned long int nContext 
); 
    
BOOL JumpToContextHashTopic 
(  
  HWND hDataWnd, 
  char * szHelpFilePath,  
  DWORD dwHashValue 
); 
    
BOOL JumpKeyword 
(  
  HWND hDataWnd,  
  char * szHelpFilePath,  
  char * szKeyword 
); 
 
BOOL DoHelpContextPopupMsg 
(  
  HWND hDataWnd, 
  HWND hParentWnd, 
  char * szHelpFilePath,  
  unsigned long int nMapValue 
); 
 
BOOL PopupContextHashTopic 
(  
  HWND hDataWnd, 
  HWND hParentWnd, 
  char * szHelpFilePath,  
  DWORD dwHashValue 
); 
 
 
#endif /* #ifndef GENERAL_H */