CODE:#define GWL_STYLE -16
#define WS_VISIBLE 0x10000000
#define WS_CHILD 0x40000000
#define WS_BORDER 0x00800000
#define WS_OVERLAPPEDWINDOW 0xCF0000
#define TRUE 1
external(INT, "CreateWindow", "CreateWindowExA", "User32.dll");
external(INT, "SetWindowLong", "SetWindowLongA", "User32.dll");
external(INT, "MoveWindow", "MoveWindow", "User32.dll");
int edit0;
createdialog(0);
showdialog(0, "Диалог", 300, 300, 500, 400, 1, 1);
SetWindowLong(gethwnd(0), GWL_STYLE, WS_VISIBLE | WS_OVERLAPPEDWINDOW);
loop()sleep(10);
function getmessage(0, WM_CREATE)
{
edit0=CreateWindow(0, "EDIT", "", WS_VISIBLE | WS_CHILD | WS_BORDER, 10, 10, 50, 20, gethwnd(0), 0, 0, 0);
}
function getmessage(0, WM_SIZE)
{
// тут нужные действия с контролами
int Width = loword(message.lparam);
int Height = hiword(message.lparam);
textout(0, 200, 100, "Ширина окна: "+format(Width)+" Высота окна: "+format(Height), 0);
MoveWindow(edit0, 10, 10, Width - 20, 20, TRUE);
} |