mirror of
https://github.com/quantum5/MusicKeyboard.git
synced 2025-04-24 13:11:58 -04:00
Merge branch 'master' of github.com:xiaomao5/MusicKeyboard
This commit is contained in:
commit
01ac5a541f
2
Makefile
2
Makefile
|
@ -41,7 +41,7 @@ $(SRCDIR)\MainWindow.cpp: $(INCDIR)\MainWindow.hpp
|
|||
$(SRCDIR)\PianoControl.cpp: $(INCDIR)\PianoControl.hpp
|
||||
$(SRCDIR)\Keyboard.cpp: $(INCDIR)\MainWindow.hpp
|
||||
$(SRCDIR)\Window.cpp: $(INCDIR)\Window.hpp
|
||||
keyboard.rc: keyboard.ico keymap.bmp
|
||||
keyboard.rc: keyboard.ico
|
||||
|
||||
$(OUTDIR)\keyboard.res: keyboard.rc
|
||||
$(RC) $(RCFLAGS) /fo$@ $**
|
||||
|
|
|
@ -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