А нужно через диалог это сделать
1) Создать текстовый файл
2) Прочитать данные из поля 1 и поля 2 и вычесть поле1- поле2= "нужное число"
3) Создать пробелы в текстовом файле на "нужное число" и сохранить.
Диалоговое окно (Отобразить)
CODE:
#define WS_VISIBLE 0x10000000
#define WS_CHILD 0x40000000
#define WS_BORDER 0x00800000
#define BS_MULTILINE 0x00002000
#define SS_EDITCONTROL 0x00002000
#define ES_MULTILINE 0x0004
#define ES_WANTRETURN 0x1000
#define ES_AUTOVSCROLL 0x0040
#define ES_AUTOHSCROLL 0x0080
#define TRUE 1
#define WM_SETFONT 0x0030
#define RUSSIAN_CHARSET 204
external(INT, "CreateWindow", "CreateWindowExA", "User32.dll");
external(INT, "GetWindowText", "GetWindowTextA", "User32.dll");
external(INT, "SetWindowText", "SetWindowTextA", "User32.dll");
external(INT, "CreateFont", "CreateFontA", "Gdi32.dll");
external(INT, "GetWindowRect", "GetWindowRect", "User32.dll");
external(INT, "DeleteObject", "DeleteObject", "Gdi32.dll");
external(INT, "DeleteFile", "DeleteFileA", "kernel32.dll");
int h_font;
string rn = formatic(13)+formatic(10);
int dialogPosX_0 = 750, dialogPosY_0 = 322;
int button0[1];
int flag_button0[1] = { 0 };
int edit0[2];
string text_edit0[2];
text_edit0[0] = "Размер"; text_edit0[1] = "0";
int static0[1];
createdialog(0);
showdialog(0, "Диалог0", dialogPosX_0, dialogPosY_0, 222, 138, 4, 1);
loop()
{
// тут нужный код
sleep(10);
}
end_0:;
function getmessage(0, WM_CREATE)
{
int i;
h_font = CreateFont(-21, 0, 0, 0, 700, 0, 0, 0, RUSSIAN_CHARSET, 0, 0, 0, 0, "Arial Narrow");
button0[0] = CreateWindow(0, "BUTTON", "Создать файл", WS_VISIBLE | WS_CHILD, 8, 56, 200, 40, gethwnd(0), 0, 0, 0);
edit0[0] = CreateWindow(0, "EDIT", text_edit0[0], WS_VISIBLE | WS_CHILD | WS_BORDER, 8, 16, 80, 32, gethwnd(0), 0, 0, 0);
edit0[1] = CreateWindow(0, "EDIT", text_edit0[1], WS_VISIBLE | WS_CHILD | WS_BORDER, 128, 16, 80, 32, gethwnd(0), 0, 0, 0);
static0[0] = CreateWindow(0, "STATIC", "-", WS_VISIBLE | WS_CHILD, 104, 16, 16, 32, gethwnd(0), 0, 0, 0);
for(i=0; i<1; i++)sendmessage(WM_SETFONT, h_font, TRUE, formatiw(button0[i]));
for(i=0; i<2; i++)sendmessage(WM_SETFONT, h_font, TRUE, formatiw(edit0[i]));
for(i=0; i<1; i++)sendmessage(WM_SETFONT, h_font, TRUE, formatiw(static0[i]));
}
function getmessage(0, WM_COMMAND)
{
int i;
char c_text_edit[999];
for(i=0; i<1; i++) // обработка нажатий кнопок
{
if(message.lparam == button0[i])
{
if(flag_button0[i])flag_button0[i] = 0;
else flag_button0[i] = 1;
return;
}
}
for(i=0; i<2; i++) // обработка нажатий edit
{
if(message.lparam == edit0[i])
{
GetWindowText(edit0[i], address(#c_text_edit[0]), sizearray(c_text_edit));
text_edit0[i] = format(#c_text_edit[0]);
return;
}
}
}
function getmessage(0, WM_CLOSE)
{
DeleteObject(h_font);
goto global end_0; // переход в метке
// close(); // закрыть кибор
}
#define WS_CHILD 0x40000000
#define WS_BORDER 0x00800000
#define BS_MULTILINE 0x00002000
#define SS_EDITCONTROL 0x00002000
#define ES_MULTILINE 0x0004
#define ES_WANTRETURN 0x1000
#define ES_AUTOVSCROLL 0x0040
#define ES_AUTOHSCROLL 0x0080
#define TRUE 1
#define WM_SETFONT 0x0030
#define RUSSIAN_CHARSET 204
external(INT, "CreateWindow", "CreateWindowExA", "User32.dll");
external(INT, "GetWindowText", "GetWindowTextA", "User32.dll");
external(INT, "SetWindowText", "SetWindowTextA", "User32.dll");
external(INT, "CreateFont", "CreateFontA", "Gdi32.dll");
external(INT, "GetWindowRect", "GetWindowRect", "User32.dll");
external(INT, "DeleteObject", "DeleteObject", "Gdi32.dll");
external(INT, "DeleteFile", "DeleteFileA", "kernel32.dll");
int h_font;
string rn = formatic(13)+formatic(10);
int dialogPosX_0 = 750, dialogPosY_0 = 322;
int button0[1];
int flag_button0[1] = { 0 };
int edit0[2];
string text_edit0[2];
text_edit0[0] = "Размер"; text_edit0[1] = "0";
int static0[1];
createdialog(0);
showdialog(0, "Диалог0", dialogPosX_0, dialogPosY_0, 222, 138, 4, 1);
loop()
{
// тут нужный код
sleep(10);
}
end_0:;
function getmessage(0, WM_CREATE)
{
int i;
h_font = CreateFont(-21, 0, 0, 0, 700, 0, 0, 0, RUSSIAN_CHARSET, 0, 0, 0, 0, "Arial Narrow");
button0[0] = CreateWindow(0, "BUTTON", "Создать файл", WS_VISIBLE | WS_CHILD, 8, 56, 200, 40, gethwnd(0), 0, 0, 0);
edit0[0] = CreateWindow(0, "EDIT", text_edit0[0], WS_VISIBLE | WS_CHILD | WS_BORDER, 8, 16, 80, 32, gethwnd(0), 0, 0, 0);
edit0[1] = CreateWindow(0, "EDIT", text_edit0[1], WS_VISIBLE | WS_CHILD | WS_BORDER, 128, 16, 80, 32, gethwnd(0), 0, 0, 0);
static0[0] = CreateWindow(0, "STATIC", "-", WS_VISIBLE | WS_CHILD, 104, 16, 16, 32, gethwnd(0), 0, 0, 0);
for(i=0; i<1; i++)sendmessage(WM_SETFONT, h_font, TRUE, formatiw(button0[i]));
for(i=0; i<2; i++)sendmessage(WM_SETFONT, h_font, TRUE, formatiw(edit0[i]));
for(i=0; i<1; i++)sendmessage(WM_SETFONT, h_font, TRUE, formatiw(static0[i]));
}
function getmessage(0, WM_COMMAND)
{
int i;
char c_text_edit[999];
for(i=0; i<1; i++) // обработка нажатий кнопок
{
if(message.lparam == button0[i])
{
if(flag_button0[i])flag_button0[i] = 0;
else flag_button0[i] = 1;
return;
}
}
for(i=0; i<2; i++) // обработка нажатий edit
{
if(message.lparam == edit0[i])
{
GetWindowText(edit0[i], address(#c_text_edit[0]), sizearray(c_text_edit));
text_edit0[i] = format(#c_text_edit[0]);
return;
}
}
}
function getmessage(0, WM_CLOSE)
{
DeleteObject(h_font);
goto global end_0; // переход в метке
// close(); // закрыть кибор
}