MB_GetString

Go to Home Page

Returns strings for standard message box buttons

Syntax

LPCWSTR WINAPI MB_GetString (
    int strId
)

Parameters

strId
The id of the string to return. These are identified by the ID* values assigned to the predefined buttons.

Return Value

The string, or NULL if not found

Remarks

The allowable ids are between IDOK (0) and IDCONTINUE (11) inclusive specified in winuser.h

Examples

#include <windows.h>
#include <stdio.h>
int main()
{
    typedef LPCWSTR (WINAPI*pfnUser)(int);
    HMODULE hMod = LoadLibrary(L"user32.dll");
    pfnUser mbString = (pfnUser)GetProcAddress(hMod, "MB_GetString");
    for(int i = 0; i < 0xb; ++i)
    {
        LPCWSTR mbStr = mbString(i);
        wprintf(L"%d - %s\n", i, mbStr);
    }
    FreeLibrary(hMod);
    return 0;
}
OUTPUT
------
0 - OK
1 - Cancel
2 - &Abort
3 - &Retry
4 - &Ignore
5 - &Yes
6 - &No
7 - &Close
8 - Help
9 - &Try Again
10 - &Continue