Update tabcontrol.c

This commit is contained in:
Jan Bodnar 2016-03-07 14:04:27 +01:00
parent 07cf1af1ee
commit f6e5397654

View File

@ -7,6 +7,7 @@
#define BTN_ADD 3 #define BTN_ADD 3
#define BTN_DEL 4 #define BTN_DEL 4
#define BTN_CLR 5 #define BTN_CLR 5
#define MAX_TAB_LEN 15
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
HWND hTab, hEdit; HWND hTab, hEdit;
@ -41,7 +42,7 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam) { WPARAM wParam, LPARAM lParam) {
TCITEMW tie; TCITEMW tie;
wchar_t text[250]; wchar_t text[4];
LRESULT count, id; LRESULT count, id;
INITCOMMONCONTROLSEX icex; INITCOMMONCONTROLSEX icex;
@ -58,6 +59,8 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg,
hEdit = CreateWindowW(WC_EDITW, NULL, WS_CHILD | WS_VISIBLE | WS_BORDER, hEdit = CreateWindowW(WC_EDITW, NULL, WS_CHILD | WS_VISIBLE | WS_BORDER,
250, 20, 100, 25, hwnd, (HMENU) ID_EDIT, NULL, NULL); 250, 20, 100, 25, hwnd, (HMENU) ID_EDIT, NULL, NULL);
SendMessage(hEdit, EM_SETLIMITTEXT, MAX_TAB_LEN, 0);
CreateWindowW(WC_BUTTONW, L"Add", WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, CreateWindowW(WC_BUTTONW, L"Add", WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
250, 50, 100, 25, hwnd, (HMENU) BTN_ADD, NULL, NULL); 250, 50, 100, 25, hwnd, (HMENU) BTN_ADD, NULL, NULL);