CODE://-----------------------------------------------------------------------------------------------------------------------------------------------------
external(INT, "CreateWindow", "CreateWindowExA", "User32.dll" );
external(INT, "EnableWindow", "EnableWindow", "User32.dll" );
external(INT, "SetWindowTextA", "SetWindowTextA", "User32.dll" );
external(INT, "CreateMenu", "CreateMenu", "User32.dll" );
external(INT, "CreatePopupMenu", "CreatePopupMenu", "User32.dll" );
external(INT, "AppendMenu", "AppendMenuA", "User32.dll" );
external(INT, "SetMenuInfo", "SetMenuInfo", "User32.dll" );
external(INT, "SetMenu", "SetMenu", "User32.dll" );
external(INT, "TrackPopupMenu", "TrackPopupMenu", "User32.dll" );
external(INT, "GetDC", "GetDC", "User32.dll" );
external(INT, "SelectObject", "SelectObject", "Gdi32.dll" );
external(INT, "CreateFont", "CreateFontA", "Gdi32.dll" );
external(INT, "TextOut", "TextOutA", "Gdi32.dll" );
external(INT, "SetTextColor", "SetTextColor", "Gdi32.dll" );
external(INT, "SetBkMode", "SetBkMode", "Gdi32.dll" );
external(INT, "InvalidateRect", "InvalidateRect", "user32.dll");
external(INT, "SetScrollRange", "SetScrollRange", "User32.dll" );
external(INT, "SetScrollPos", "SetScrollPos", "User32.dll" );
external(INT, "SetWindowText", "SetWindowTextA", "User32.dll" );
external(INT, "SetScrollRange", "SetScrollRange", "User32.dll" );
external(INT, "SetScrollPos", "SetScrollPos", "User32.dll" );
external(INT, "EnableWindow", "EnableWindow", "user32.dll");
external(INT, "SetWindowPos", "SetWindowPos", "User32.dll");
//-----------------------------------------------------------------------------------------------------------------------------------------------------
getdisplay(Display_Color, Display_Width, Display_Height);
createdialog(0);
showdialog(0, "Мой диалог", Display_Width/2-400, Display_Height/2-300, 1025, 830, 1, 0);
//-----------------------------------------------------------------------------------------------------------------------------------------------------
win MainWindow = window ("Мой диалог");
win Browser;
int Display_Color, Display_Width, Display_Height;
int HWND;
int MenuInfo[7] = {28, 16, 134217728, 0, 0, 0, 0};
int Menu1, Menu2, Menu3;
int min = 62, max = 100, pos = 62;
//-----------------------------------------------------------------------------------------------------------------------------------------------------
while(window ("Мой диалог") == 0)
{
sleep(1);
}
//-----------------------------------------------------------------------------------------------------------------------------------------------------
int Button1 = CreateWindow(0, "BUTTON", "1", 1342177280, 10, 10, 120, 20, formatwi(MainWindow), 0, 0, 0);
int Button2 = CreateWindow(0, "BUTTON", "2", 1342177280, 140, 10, 250, 20, formatwi(MainWindow), 0, 0, 0);
int Button3 = CreateWindow(0, "BUTTON", ">", 1342177280, 610, 10, 20, 20, formatwi(MainWindow), 0, 0, 0);
int Scrollbar1 = CreateWindow(0, "SCROLLBAR", 0, 1342177280, 400, 10, 200, 20, formatwi(MainWindow), 0, 0, 0);
SetScrollRange(Scrollbar1, 2, min, max, 1);
EnableWindow(Button1, 0);
Изменить();
//-----------------------------------------------------------------------------------------------------------------------------------------------------
function getmessage(0, WM_HSCROLL)
{
if (message.lparam == Scrollbar1)
{
if (message.wparam == 1 || message.wparam == 3)
{
pos = pos+1;
if (pos > max)
{
pos = max;
}
SetScrollPos(Scrollbar1, 2 , pos, 1);
Изменить();
return;
}
if (message.wparam == 0 || message.wparam == 2)
{
pos = pos-1;
if (pos < min)
{
pos = min;
}
SetScrollPos(Scrollbar1, 2, pos, 1);
Изменить();
return;
}
if (loword(message.wparam) == 5)
{
pos = pos-(pos-hiword(message.wparam));
if (pos > max)
{
pos = max;
}
if (pos < min)
{
pos = min;
}
SetScrollPos(Scrollbar1, 2 , pos, 1);
Изменить();
}
}
}
//-----------------------------------------------------------------------------------------------------------------------------------------------------
loop()
{
textout(0, 0, 0, format(MainWindow.width), 1);
sleep(10);
}
//-----------------------------------------------------------------------------------------------------------------------------------------------------
function getmessage(0, WM_CREATE)
{
HWND = gethwnd(0);
SetMenuInfo(Menu1, address(#MenuInfo[0]));
SetMenu(HWND, Menu1);
}
//-----------------------------------------------------------------------------------------------------------------------------------------------------
function getmessage(0, WM_COMMAND)
{
}
//-----------------------------------------------------------------------------------------------------------------------------------------------------
function Изменить()
{
MainWindow = window ("Мой диалог" );
MainWindow.width = 998 * pos/100+10+10+(MainWindow.width-MainWindow.widthclient);
MainWindow.height = 730*pos/100+40+10+(MainWindow.height-MainWindow.heightclient);
movewindow(MainWindow);
if (Browser.name == "Мой диалог")
{
visualwindow(MainWindow, 0, x[0]-42, y[0]-89, x[1]+188, y[1]+38, 10, 40, pos, Browser);
resettextout(1);
}
if (pos >= 77)
{
if (MainWindow.width > 794)
{
SetWindowTextA(Button3, "Показать боковое меню");
SetWindowPos(Button3, 0, MainWindow.height, 10, 170, 20, 0);
}
else
{
SetWindowTextA(Button3, "Показать боковое меню");
SetWindowPos(Button3, 0, 610, 10, 170, 20, 0);
}
}
else
{
SetWindowTextA(Button3, ">");
SetWindowPos(Button3, 0, 610, 10, 20, 20, 0);
}
}
//-----------------------------------------------------------------------------------------------------------------------------------------------------