2 * Copyright (c) 2000, Red Hat, Inc.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * A copy of the GNU General Public License can be found at
12 * Written by DJ Delorie <dj@cygnus.com>
16 /* The purpose of this file is to centralize all the message
20 static const char *cvsid
=
35 msg (const char *fmt
, ...)
40 vsnprintf (buf
, 2000, fmt
, args
);
41 OutputDebugString (buf
);
45 mbox (HWND owner
, const char *buf
, const char *name
, int type
)
47 Log (LOG_PLAIN
) << "mbox " << name
<< ": " << buf
<< endLog
;
50 // Return some default values.
51 Log (LOG_PLAIN
) << "unattended_mode is set at mbox: returning default value" << endLog
;
52 switch (type
& MB_TYPEMASK
)
62 case MB_ABORTRETRYIGNORE
:
69 Log (LOG_PLAIN
) << "unattended_mode failed for " << (type
& MB_TYPEMASK
) << endLog
;
73 return MessageBox (owner
, buf
, "Cygwin Setup", type
);
77 mbox (HWND owner
, const char *name
, int type
, int id
, va_list args
)
79 char buf
[1000], fmt
[1000];
81 if (LoadString (hinstance
, id
, fmt
, sizeof (fmt
)) <= 0)
84 vsnprintf (buf
, 1000, fmt
, args
);
85 return mbox(owner
, buf
, name
, type
);
89 note (HWND owner
, int id
, ...)
93 mbox (owner
, "note", 0, id
, args
);
97 fatal (HWND owner
, int id
, ...)
101 mbox (owner
, "fatal", 0, id
, args
);
106 yesno (HWND owner
, int id
, ...)
110 return mbox (owner
, "yesno", MB_YESNO
, id
, args
);