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
|
#include "alfpriv.h"
/* EDIT */
HWND
ALF_AddEdit(HWND win, WORD id, int x, int y, const TCHAR *text)
{
DWORD exstyle;
DWORD style;
if (ALF_Compat_IsMinWindowsVersion(4, 0)) {
exstyle = WS_EX_CLIENTEDGE;
style = 0;
} else {
exstyle = 0;
style = WS_BORDER;
}
HWND hwndEdit = CreateWindowEx(exstyle,
TEXT("EDIT"),
text,
WS_CHILD | WS_VISIBLE | WS_TABSTOP | style,
0, 0, 100, 100,
win,
(HMENU)(int)id,
(HINSTANCE)GetWindowLongPtr(win, GWLP_HINSTANCE),
NULL);
SetWindowPos(hwndEdit, NULL, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_FRAMECHANGED);
ALF_AddWidget(win, x, y, hwndEdit, 0, 0, ALF_LAYOUT_SIZE_EDIT | ALF_LAYOUT_INHERITFONT);
return hwndEdit;
}
|