mirror of
https://github.com/quantum5/MusicKeyboard.git
synced 2025-04-24 13:11:58 -04:00
Update PianoControl.cpp
This commit is contained in:
parent
a29f0b11e3
commit
287311ebab
|
@ -3,36 +3,6 @@
|
|||
#include <windowsx.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define MessageErrorWndTitle(hwnd, e, t) MessageBox(hwnd, e, t, MB_ICONERROR)
|
||||
#define MessageErrorWnd(hwnd, e) MessageBox(hwnd, e, T("Error!"), MB_ICONERROR)
|
||||
#define MessageError(e) MessageErrorWnd(NULL, e)
|
||||
|
||||
#define MessageLastErrorWndTitle(hwnd, e, title)\
|
||||
do { \
|
||||
LPTSTR s; \
|
||||
if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, e, 0, (LPTSTR)&s, 0, NULL) == 0) {\
|
||||
TCHAR str[25]; \
|
||||
snprintf(str, 25, T("%x"), str); \
|
||||
MessageErrorWndTitle(hwnd, str, title); \
|
||||
} else { \
|
||||
MessageErrorWndTitle(hwnd, s, title); \
|
||||
LocalFree(s); \
|
||||
} \
|
||||
} while (0)
|
||||
#define MessageLastErrorWnd(hwnd, e) MessageLastErrorWndTitle(hwnd, e, T("Error!"))
|
||||
#define MessageLastError(e) MessageLastErrorWnd(NULL, e)
|
||||
|
||||
#define MessageIntBox(hwnd, i, title, opt) \
|
||||
do { \
|
||||
CHAR buf[100]; \
|
||||
sprintf_s(buf, 100, "%d", i); \
|
||||
MessageBoxA(hwnd, buf, title, opt); \
|
||||
} while (0)
|
||||
|
||||
#define MessageIntWndTitle(hwnd, i, title) MessageIntBox(hwnd, i, title, MB_ICONINFORMATION)
|
||||
#define MessageIntWnd(hwnd, i) MessageIntWndTitle(hwnd, i, "Debug Info")
|
||||
#define MessageInt(i) MessageIntWnd(NULL, i)
|
||||
|
||||
BOOL PianoControl::WinRegisterClass(WNDCLASS *pwc)
|
||||
{
|
||||
return __super::WinRegisterClass(pwc);
|
||||
|
|
Loading…
Reference in a new issue