source: branches/2.20_branch/hlpmgr/helpinstance.h@ 456

Last change on this file since 456 was 26, checked in by RBRi, 19 years ago

+ helpmgr files

  • Property svn:eol-style set to native
File size: 2.6 KB
Line 
1#ifndef HELPINSTANCE_H
2#define HELPINSTANCE_H
3
4#include "Utility.h"
5#include "HelpTables.h"
6#include "SharedMemory.h"
7
8#define MAX_VIEWER_STARTUP_MESSAGES 100
9
10#define QWL_HELPINSTANCEPTR 0
11
12// offset into window data
13#define QWL_HELPINSTANCEMAGICNUMBER 4
14#define HELPINSTANCEMAGICNUMBER 0x7af3b2ea
15
16typedef struct
17{
18 ULONG msg;
19 MPARAM mp1;
20 MPARAM mp2;
21} TQueuedViewerMessage;
22
23// Main help instance structure
24typedef struct
25{
26 HWND FHandle; // help window - receives messages from app
27
28 HAB Fhab; // application anchor block
29
30 HWND* FApplicationWindows;
31 int FNumApplicationWindows; // current number of windows in use.
32 int FMaxApplicationWindows; // current size of array
33
34 HWND FActiveWindow;
35
36 char* FHelpFileNames;
37 char* FHelpWindowTitle;
38
39 BOOL FViewerStarted;
40 HWND FViewerWindow;
41
42 TQueuedViewerMessage FViewerStartupMessages[ MAX_VIEWER_STARTUP_MESSAGES ];
43 int FViewerStartupMessagesCount;
44
45 // main help table: an array of entries,
46 // one for each main app window. Each entry
47 // specifies a help subtable and an "extended help" panel
48 PHELPTABLE pHelpTable;
49 BOOL HelpTableFromResource;
50
51 TSubAllocatedSharedMemory SharedMemory;
52
53} THelpInstance;
54typedef THelpInstance* TPHelpInstance;
55
56//--------------------------------------------------------------------------------
57
58// Start the viewer if it's not already running
59void EnsureViewerRunning( TPHelpInstance pHelpInstance );
60
61// Send a message to the viewer. If it hasn't
62// started yet, then queue the message.
63void PostViewerMessage( TPHelpInstance pHelpInstance,
64 ULONG msg,
65 MPARAM mp1,
66 MPARAM mp2 );
67
68// Post messages to the viewer that have been
69// queued up waiting for it to complete startup
70void PostQueuedViewerMessages( TPHelpInstance pHelpInstance );
71
72void CloseViewer( TPHelpInstance pHelpInstance );
73
74//--------------------------------------------------------------------------------
75
76// Add the given window to the list of associated
77// windows for this help instance
78void AssociateWindow( TPHelpInstance pHelpInstance,
79 HWND hwnd );
80
81void RemoveAssociatedWindow( TPHelpInstance pHelpInstance,
82 HWND hwnd );
83
84// Returns true if the given window is associated with
85// the given help instance
86BOOL IsWindowAssociated( TPHelpInstance pHelpInstance,
87 HWND hwnd );
88
89//--------------------------------------------------------------------------------
90
91// return the HelpInstance with the given handle
92TPHelpInstance GetHelpInstance( HWND hwnd );
93
94void ReleaseHelpTable( TPHelpInstance pHelpInstance );
95
96TPHelpInstance MakeNewHelpInstance();
97
98#endif
Note: See TracBrowser for help on using the repository browser.