Update NEWS for 1.6.22
[pkg-k5-afs_openafs.git] / src / WINNT / client_exp / help.cpp
blobd615ba10e5f88ac1650ee1382eff944d3422f319
1 /*
2 * Copyright 2000, International Business Machines Corporation and others.
3 * All Rights Reserved.
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 */
10 #include "stdafx.h"
11 #include <winsock2.h>
12 #include <ws2tcpip.h>
14 extern "C" {
15 #include <afs/param.h>
16 #include <afs/stds.h>
19 #include "help.h"
22 static CString strHelpPath;
25 static BOOL IsWindowsNT (void)
27 static BOOL fChecked = FALSE;
28 static BOOL fIsWinNT = FALSE;
30 if (!fChecked) {
31 fChecked = TRUE;
33 OSVERSIONINFO Version;
34 memset (&Version, 0x00, sizeof(Version));
35 Version.dwOSVersionInfoSize = sizeof(Version);
37 if (GetVersionEx (&Version)) {
38 if (Version.dwPlatformId == VER_PLATFORM_WIN32_NT)
39 fIsWinNT = TRUE;
43 return fIsWinNT;
47 void SetHelpPath(LPCTSTR pszDefaultHelpFilePath)
49 CString str(pszDefaultHelpFilePath);
50 int nIndex = str.ReverseFind('\\');
51 ASSERT(nIndex >= 0);
53 if (IsWindowsNT())
54 strHelpPath = str.Left(nIndex + 1) + HELPFILE_NATIVE;
55 else
56 strHelpPath = str.Left(nIndex + 1) + HELPFILE_LIGHT;
59 void ShowHelp(HWND hWnd, DWORD nHelpID)
61 ::WinHelp(hWnd, strHelpPath, HELPTYPE, nHelpID);