-
Notifications
You must be signed in to change notification settings - Fork 0
/
thetisskinmaker.h
55 lines (42 loc) · 1.28 KB
/
thetisskinmaker.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef __COMMON_H_
#define __COMMON_H_
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#define WINDOW_NAME L"ThetisSkinMaker"
#define WINDOW_WIDTH 450
#define WINDOW_HEIGHT 500
#define THETIS_SKIN_PATH L"%APPDATA%\\OpenHPSDR\\Skins"
#define THETIS_PICDISPLAY_PATH L"Console\\picDisplay.png"
#define SET_FONT(hwnd, font) \
SendMessage(hwnd, WM_SETFONT, (WPARAM) font, MAKELPARAM(FALSE, 0))
#define ERROR_BOX(text) \
MessageBoxW(NULL, text, WINDOW_NAME, MB_OK | MB_ICONERROR )
#define ERROR_BOX_WITH_CAPTION(text, caption) \
MessageBoxW(NULL, text, caption, MB_OK | MB_ICONERROR)
#define CREATE_GROUPBOX(text, x, y, width, height, parent, instance) \
CreateWindowExW(0, \
WC_BUTTONW, \
text, \
WS_CHILD | WS_VISIBLE | BS_GROUPBOX, \
x, \
y, \
width, \
height, \
parent, \
NULL, \
instance, \
NULL)
#define CHECK(hwnd) \
if(!hwnd) \
{ \
ERROR_BOX(L"Failed to create " #hwnd L"!"); \
} \
extern HBITMAP imageBitmap;
void OnPreviewButtonClick(HWND hwnd);
void OnImageButtonClick(HWND hwnd);
void OnSaveButtonClick(HWND hwnd);
void OnNewButtonClick(HWND hwnd);
void OnCreate(HWND hwnd);
HBITMAP CreateBitmapFromPath(LPWSTR path);
int SaveBitmapToFile(HBITMAP bitmap, LPWSTR path);
#endif