Standardize License information
[openafs.git] / src / WINNT / client_exp / help.cpp
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  * 
5  * This software has been released under the terms of the IBM Public
6  * License.  For details, see the LICENSE file in the top-level source
7  * directory or online at http://www.openafs.org/dl/license10.html
8  */
9
10 extern "C" {
11 #include <afs/param.h>
12 #include <afs/stds.h>
13 }
14
15 #include "stdafx.h"
16 #include "help.h"
17
18
19 static CString strHelpPath;
20
21
22 static BOOL IsWindowsNT (void)
23 {
24         static BOOL fChecked = FALSE;
25         static BOOL fIsWinNT = FALSE;
26
27         if (!fChecked) {
28                 fChecked = TRUE;
29
30                 OSVERSIONINFO Version;
31                 memset (&Version, 0x00, sizeof(Version));
32                 Version.dwOSVersionInfoSize = sizeof(Version);
33
34                 if (GetVersionEx (&Version)) {
35                         if (Version.dwPlatformId == VER_PLATFORM_WIN32_NT)
36                                 fIsWinNT = TRUE;
37                 }
38         }
39
40         return fIsWinNT;
41 }
42
43
44
45 void SetHelpPath(const char *pszDefaultHelpFilePath)
46 {
47         CString str = pszDefaultHelpFilePath;
48         int nIndex = str.ReverseFind('\\');
49         ASSERT(nIndex >= 0);
50
51         if (IsWindowsNT())
52                 strHelpPath = str.Left(nIndex + 1) + HELPFILE_NATIVE;
53         else
54                 strHelpPath = str.Left(nIndex + 1) + HELPFILE_LIGHT;
55 }
56
57 void ShowHelp(HWND hWnd, DWORD nHelpID)
58 {
59         ::WinHelp(hWnd, strHelpPath, HELPTYPE, nHelpID);
60 }
61