ReactOS 0.4.15-dev-8096-ga0eec98
__crt_MessageBoxA.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS C runtime library
3 * LICENSE: BSD - See COPYING.ARM in the top level directory
4 * FILE: lib/sdk/crt/misc/__crt_MessageBoxA.c
5 * PURPOSE: __crt_MessageBoxA implementation
6 * PROGRAMMER: Timo Kreuzer (timo.kreuzer@reactos.org)
7 */
8
9#include <precomp.h>
10
11/*****************************************************************************
12 * \brief Displays a message box.
13 *
14 * \param pszText - The message to be displayed.
15 * \param uType - The contents and behavior of the message box.
16 * \return Identifies the button that was pressed by the user.
17 * \see MessageBox
18 *
19 *****************************************************************************/
20int
23 _In_opt_ const char *pszText,
24 _In_ unsigned int uType)
25{
26 HMODULE hmodUser32;
27 int (WINAPI *pMessageBoxA)(HWND, LPCTSTR, LPCTSTR, UINT);
28 int iResult;
29
30 /* Get MessageBoxA function pointer */
31 hmodUser32 = LoadLibrary("user32.dll");
32 pMessageBoxA = (PVOID)GetProcAddress(hmodUser32, "MessageBoxA");
33 if (!pMessageBoxA)
34 {
35 abort();
36 }
37
38 /* Display a message box */
39 iResult = pMessageBoxA(NULL,
40 pszText,
41 "ReactOS C Runtime Library",
42 uType);
43
44 FreeLibrary(hmodUser32);
45 return iResult;
46}
47
int __cdecl __crt_MessageBoxA(_In_opt_ const char *pszText, _In_ unsigned int uType)
#define __cdecl
Definition: accygwin.h:79
#define NULL
Definition: types.h:112
HANDLE HWND
Definition: compat.h:19
#define GetProcAddress(x, y)
Definition: compat.h:753
#define FreeLibrary(x)
Definition: compat.h:748
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
#define abort()
Definition: i386-dis.c:34
#define _In_
Definition: ms_sal.h:308
#define _In_opt_
Definition: ms_sal.h:309
unsigned int UINT
Definition: ndis.h:50
void * PVOID
Definition: typedefs.h:50
#define LoadLibrary
Definition: winbase.h:3862
#define WINAPI
Definition: msvc.h:6
const CHAR * LPCTSTR
Definition: xmlstorage.h:193