CODE:
external(INT, "CreateWindow", "CreateWindowExA", "User32.dll" );
external(INT, "CreateMenu", "CreateMenu", "User32.dll" );
external(INT, "CreatePopupMenu", "CreatePopupMenu", "User32.dll" );
external(INT, "CreateFont", "CreateFontA", "Gdi32.dll" );
external(INT, "SetWindowLong", "SetWindowLongA", "User32.dll" );
external(INT, "SetWindowPos", "SetWindowPos", "User32.dll");
external(INT, "SetMenuInfo", "SetMenuInfo", "User32.dll" );
external(INT, "SetBkMode", "SetBkMode", "Gdi32.dll" );
external(INT, "SetScrollRange", "SetScrollRange", "User32.dll" );
external(INT, "SetWindowText", "SetWindowTextA", "User32.dll" );
external(INT, "SetScrollRange", "SetScrollRange", "User32.dll" );
external(INT, "SetScrollPos", "SetScrollPos", "User32.dll" );
external(INT, "SetTextColor", "SetTextColor", "Gdi32.dll" );
external(INT, "SetWindowTextA", "SetWindowTextA", "User32.dll" );
external(INT, "SetMenu", "SetMenu", "User32.dll" );
external(INT, "SendMessage", "SendMessageA", "User32.dll" );
external(INT, "ShowWindow", "ShowWindow", "User32.dll" );
external(INT, "SetFocus", "SetFocus", "User32.dll" );
external(INT, "SelectObject", "SelectObject", "Gdi32.dll" );
external(INT, "SetTextColor", "SetTextColor", "Gdi32.dll" );
external(INT, "GetPrivateProfileString", "GetPrivateProfileStringA", "kernel32.dll");
external(INT, "GetWindowLong", "GetWindowLongA", "User32.dll" );
external(INT, "GetDC", "GetDC", "User32.dll" );
external(INT, "GetWindowText", "GetWindowTextA", "User32.dll");
external(INT, "GetFocus", "GetFocus", "User32.dll" );
external(INT, "GetWindowRect", "GetWindowRect", "User32.dll" );
external(INT, "GlobalMemoryStatusEx", "GlobalMemoryStatusEx", "Kernel32.dll");
external(INT, "GetSystemTimes", "GetSystemTimes", "Kernel32.dll");
external(INT, "InvalidateRect", "InvalidateRect", "user32.dll");
external(INT, "IsWindowVisible", "IsWindowVisible", "User32.dll");
external(INT, "IsIconic", "IsIconic", "User32.dll");
external(INT, "IsZoomed", "IsZoomed", "User32.dll");
external(INT, "EnableWindow", "EnableWindow", "User32.dll" );
external(INT, "AppendMenu", "AppendMenuA", "User32.dll" );
external(INT, "TrackPopupMenu", "TrackPopupMenu", "User32.dll" );
external(INT, "TextOut", "TextOutA", "Gdi32.dll" );
external(INT, "FlashWindowEx", "FlashWindowEx", "User32.dll" );
external(INT, "SelectObject", "SelectObject", "Gdi32.dll" );
external(INT, "Strftime", "Strftime", pathfolder()+"Time.dll" );
external(INT, "WritePrivateProfileString", "WritePrivateProfileStringA", "kernel32.dll");
#define WS_VISIBLE 268435456
#define WS_CHILD 1073741824
#define WS_BORDER 8388608
#define WS_SIZEBOX 262144
#define WS_CHILD 1073741824
#define WS_HSCROLL 1048576
#define WS_VSCROLL 2097152
#define WS_POPUP 2147483648
#define WS_GROUP 131072
#define MNS_NOTIFYBYPOS 134217728
#define MIM_STYLE 16
#define MF_POPUP 16
#define WM_GETTEXT 13
#define WM_SETTEXT 12
#define WM_GETTEXTLENGTH 14
#define WM_SETCURSOR 32
#define WM_SIZE 5
#define WM_ERASEBKGND 20
#define WM_ENABLE 10
#define CB_GETITEMDATA 336
#define CB_GETCURSEL 327
#define CB_ADDSTRING 323
#define CB_DELETESTRING 324
#define CB_FINDSTRING 332
#define CB_GETCURSEL 32
#define CBS_DROPDOWNLIST 3
#define CBS_AUTOHSCROLL 64
#define CBS_DROPDOWN 2
#define CBS_DROPDOWNLIST 3
#define LBS_EXTENDEDSEL 2048
#define LB_ADDSTRING 384
#define LB_GETCOUNT 395
#define LB_SETTOPINDEX 407
#define LBS_DISABLENOSCROLL 4096
win MainWindow, SecondaryWindow, Browser, Game;
int Display_Color, Display_Width, Display_Height;
int VisualWindow_Width = 1000, VisualWindow_Height = 730;
int Value1 = 38;
int ImageX[10], ImageY[10];
int VisualImage[1000][730];
int Object_Button1;
char Text_Button1[255];
int Object_Button2;
int RectButton2[4];
char Text_Button2[255];
int Object_Listbox1;
int Object_Edit1;
int Edit1_TextLength;
int Menu_Information[7] = {28, MIM_STYLE, MNS_NOTIFYBYPOS, 0, 0, 0, 0};
int Menu1, Menu2 = CreatePopupMenu();
getdisplay(Display_Color, Display_Width, Display_Height);
createdialog(0);
createdialog(1);
showdialog(0, "диалог", Display_Width/2-450, Display_Height/2-400, 700, 400, 1, 1);
MainWindow = window ("диалог");
function getmessage(0, WM_CREATE)
{
Object_Button1 = CreateWindow(0, "BUTTON", "1", WS_VISIBLE | WS_CHILD, 10, 10, 120, 20, gethwnd(0), 0, 0, 0);
Object_Button2 = CreateWindow(0, "BUTTON", "2", WS_VISIBLE | WS_CHILD, 140, 10, 250, 20, gethwnd(0), 0, 0, 0);
Object_Listbox1 = CreateWindow(0, "LISTBOX", "3", WS_BORDER | WS_HSCROLL | WS_VSCROLL | LBS_DISABLENOSCROLL | WS_CHILD | WS_VISIBLE, 400, 10, 200, 200, gethwnd(0), 0, 0, 0);
}
function getmessage(0, WM_MOUSEWHEEL)
{
MainWindow = window ("диалог");
resettextout(1);
if(message.wparam > 0)
{
Value1++;
}
else
{
Value1--;
}
if (Value1 < 38)
{
Value1 = 38;
}
if (Value1 > 100)
{
Value1 = 100;
}
VisualWindow_Width = 1000/100*Value1;
VisualWindow_Height = 730/100*Value1;
visualwindow(MainWindow, 0, 0, 0, 1000, 730, 10, 40, Value1, #VisualImage[0][0]);
SetWindowPos(Object_Listbox1, 0, VisualWindow_Width+20, 10, 200, VisualWindow_Height+30, 0);
MainWindow.width = 200+VisualWindow_Width+30+(MainWindow.width-MainWindow.widthclient);
MainWindow.height = VisualWindow_Height+50+(MainWindow.height-MainWindow.heightclient);
movewindow(MainWindow);
}
loop()
{
textout(0, 0, 0, format(VisualWindow_Width)+","+format(VisualWindow_Height)+","+format(Value1)+"-"+format(hiword(message.wparam)), 1);
sleep(10);
}
Проблема в том, что когда быстро крутишь, то размеры окна сильно теряются, а если медленно по 1 значению, то всё супер