reactos/reactos/base/applications/regedit/error.c
Aleksey Bragin 2bb39272f6 [REGEDIT]
Adam Kachwalla <geekdundee@gmail.com>
- "Load Hive..." and "Unload Hive..." menu items implemented
- Make address bar case-insensitive
- Remove trailing slashes in address bar when at root keys (e.g. "HKEY_LOCAL_MACHINE\" or "HKEY_CURRENT_USER\")
- Address "go" button added
- Removed ~8px slack from bottom of the app (not needed and looks better)
- Factored out error displaying functions into error.c file.

See issue #5711 for more details.

svn path=/trunk/; revision=49465
2010-11-04 12:05:35 +00:00

15 lines
535 B
C

#include <regedit.h>
void ErrorMessageBox(HWND hWnd, LPCTSTR title, DWORD code)
{
LPTSTR lpMsgBuf;
DWORD status;
static const TCHAR fallback[] = TEXT("Error displaying error message.\n");
status = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
NULL, code, 0, (LPTSTR)&lpMsgBuf, 0, NULL);
if (!status)
lpMsgBuf = (LPTSTR)fallback;
MessageBox(hWnd, lpMsgBuf, title, MB_OK | MB_ICONERROR);
if (lpMsgBuf != fallback)
LocalFree(lpMsgBuf);
}