Windows: Build afs_shl_ext.dll with talocaleU.lib
[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 #include "stdafx.h"
11 #include <winsock2.h>
12 #include <ws2tcpip.h>
13
14 extern "C" {
15 #include <afs/param.h>
16 #include <afs/stds.h>
17 }
18
19 #include "help.h"
20
21
22 static CString strHelpPath;
23
24
25 static BOOL IsWindowsNT (void)
26 {
27         static BOOL fChecked = FALSE;
28         static BOOL fIsWinNT = FALSE;
29
30         if (!fChecked) {
31                 fChecked = TRUE;
32
33                 OSVERSIONINFO Version;
34                 memset (&Version, 0x00, sizeof(Version));
35                 Version.dwOSVersionInfoSize = sizeof(Version);
36
37                 if (GetVersionEx (&Version)) {
38                         if (Version.dwPlatformId == VER_PLATFORM_WIN32_NT)
39                                 fIsWinNT = TRUE;
40                 }
41         }
42
43         return fIsWinNT;
44 }
45
46
47 void SetHelpPath(LPCTSTR pszDefaultHelpFilePath)
48 {
49     CString str(pszDefaultHelpFilePath);
50         int nIndex = str.ReverseFind('\\');
51         ASSERT(nIndex >= 0);
52
53         if (IsWindowsNT())
54                 strHelpPath = str.Left(nIndex + 1) + HELPFILE_NATIVE;
55         else
56                 strHelpPath = str.Left(nIndex + 1) + HELPFILE_LIGHT;
57 }
58
59 void ShowHelp(HWND hWnd, DWORD nHelpID)
60 {
61         ::WinHelp(hWnd, strHelpPath, HELPTYPE, nHelpID);
62 }
63