home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2002 February
/
Chip_2002-02_cd1.bin
/
sharewar
/
apaths
/
APSOURCE.ZIP
/
Messages.c
< prev
next >
Wrap
C/C++ Source or Header
|
2001-03-26
|
2KB
|
69 lines
/* Messages - March 26th, 2001
**
** Copyright (c) 1997-2001 by Gregory Braun. All rights reserved.
**
** This function opens and displays an MS Windows 95/NT
** message dialog box containing the text string passed.
**
** Called: w = window handle to the parent.
** caption = a pointer the the window caption, or
** NULL to use the application default.
** message = a pointer to the message to be displayed.
**
** Returns: TRUE upon success, or FALSE if an error exists,
** or the user pressed the [No] or [Cancel] key.
*/
#include "AppPaths.h"
extern BOOL far Message (HWND w,LPCSTR caption,LPCSTR message)
{
auto DWORD style = MB_OK | MB_ICONWARNING;
MessageBox (w,message,(caption) ? caption : APP_CAPTION,style);
return (FALSE);
}
extern BOOL far Error (HWND w,LPCSTR caption,LPCSTR message)
{
auto DWORD style = MB_OK | MB_ICONWARNING;
auto DWORD err = GetLastError ();
auto int len;
auto char buffer[MSTRING];
*buffer = EOS;
lstrcpy (buffer,message);
if (err) {
lstrcat (buffer,"\r\r");
len = lstrlen (buffer);
SysError (err,&buffer[len]);
}
MessageBox (w,buffer,(caption) ? caption : APP_CAPTION,style);
return (FALSE);
}
extern BOOL far Query (HWND w,LPCSTR caption,LPCSTR message)
{
auto DWORD style = MB_YESNO | MB_ICONQUESTION | MB_DEFBUTTON2;
if (MessageBox (w,message,(caption) ? caption : APP_CAPTION,style) == IDYES)
return (TRUE);
return (FALSE);
}
extern BOOL far Beeper (void)
{
MessageBeep (MB_OK);
return (FALSE);
}
/* end of Messages.c - written by Gregory Braun */