diff options
| author | H.G. Muller <h.g.muller@hccnet.nl> | 2009-07-11 18:19:30 -0700 |
|---|---|---|
| committer | Arun Persaud <arun@nubati.net> | 2009-07-11 18:19:30 -0700 |
| commit | 3cc03b735ac2bff48a80937827a2ddcf22878959 (patch) | |
| tree | dfc24a76d5e01b8ba6664c8d8e1ff96fea52d138 | |
| parent | 09d3d08d9ce11ff482e34bad7b97380f134c14f4 (diff) | |
| download | xboard-3cc03b735ac2bff48a80937827a2ddcf22878959.tar.gz | |
fixed a few warnings in connection with the help patch (now warning free)
| -rw-r--r-- | winboard/help.c | 15 | ||||
| -rw-r--r-- | winboard/winboard.c | 8 |
2 files changed, 14 insertions, 9 deletions
diff --git a/winboard/help.c b/winboard/help.c index febd0e6..94d0fd9 100644 --- a/winboard/help.c +++ b/winboard/help.c @@ -27,8 +27,8 @@ FILE *debugFP;
-int
-HtmlHelp( HWND hwnd, LPCSTR helpFile, UINT action, DWORD data )
+HWND WINAPI
+HtmlHelp( HWND hwnd, LPCSTR helpFile, UINT action, DWORD_PTR data )
{
PROCESS_INFORMATION helpProcInfo;
STARTUPINFO siStartInfo;
@@ -36,13 +36,13 @@ HtmlHelp( HWND hwnd, LPCSTR helpFile, UINT action, DWORD data ) static int status = 0;
FILE *f;
- if(status < 0) return 0;
+ if(status < 0) return NULL;
if(!status) {
f = fopen(helpFile, "r");
if(f == NULL) {
status = -1;
- return 0;
+ return NULL;
}
status = 1;
fclose(f);
@@ -62,7 +62,7 @@ HtmlHelp( HWND hwnd, LPCSTR helpFile, UINT action, DWORD data ) sprintf(buf, "Hh.exe %s", helpFile);
// ignore the other parameters; just start the viewer with the help file
- return CreateProcess(NULL,
+ if( CreateProcess(NULL,
buf, /* command line */
NULL, /* process security attributes */
NULL, /* primary thread security attrs */
@@ -71,12 +71,13 @@ HtmlHelp( HWND hwnd, LPCSTR helpFile, UINT action, DWORD data ) NULL, /* use parent's environment */
NULL,
&siStartInfo, /* STARTUPINFO pointer */
- &helpProcInfo); /* receives PROCESS_INFORMATION */
+ &helpProcInfo) /* receives PROCESS_INFORMATION */
+ ) return hwnd; else return NULL;
}
//HWND WINAPI
int
-MyHelp(HWND hwnd, LPSTR helpFile, UINT action, DWORD data)
+MyHelp(HWND hwnd, LPSTR helpFile, UINT action, DWORD_PTR data)
{
static int status = 0;
FILE *f;
diff --git a/winboard/winboard.c b/winboard/winboard.c index 15ac962..9cc844c 100644 --- a/winboard/winboard.c +++ b/winboard/winboard.c @@ -106,7 +106,11 @@ int FinishMove P((ChessMove moveType, int fromX, int fromY, int toX, int toY, void AnimateAtomicCapture(int fromX, int fromY, int toX, int toY, int nFrames);
void DisplayMove P((int moveNumber));
Boolean ParseFEN P((Board board, int *blackPlaysFirst, char *fen));
-int HtmlHelp( HWND hwnd, LPCSTR helpFile, UINT action, DWORD data );
+#ifdef VISTA
+#include "htmlhelp.h"
+#else
+HWND WINAPI HtmlHelp( HWND hwnd, LPCSTR helpFile, UINT action, DWORD_PTR data );
+#endif
typedef struct {
ChessSquare piece;
@@ -6196,7 +6200,7 @@ WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) case IDM_HELPCONTENTS:
if (!MyHelp (hwnd, "winboard.hlp", HELP_KEY,(DWORD)(LPSTR)"CONTENTS") &&
- !HtmlHelp(hwnd, "winboard.chm", 0, 0)) {
+ !HtmlHelp(hwnd, "winboard.chm", 0, 0) ) {
MessageBox (GetFocus(),
"Unable to activate help",
szAppName, MB_SYSTEMMODAL|MB_OK|MB_ICONHAND);
|
