CODE:win w=window (-1, "Notepad", -1); // указатель на окно (блокнот в данном случае)
win dialog;
int percent=100;
int pos_x, pos_y;
int mouse_x, mouse_y, mouse_x2, mouse_y2;
int xx=0, yy=0, xx2=0, yy2=0;
enabletimer(0);
if(w)
{
createdialog(0);
showdialog(0, "Диалог",0, 0, w.widthclient, w.heightclient, 1, 1);
new int scr[w.widthclient+1][w.heightclient+1];
screen (#scr[0][0], 0, 0, w.widthclient, w.heightclient, w);
visualwindow(formatiw(gethwnd(0)), 0, 0, 0, sizearray(scr), sizearray(scr[]), 0, 0, percent, #scr[0][0]);
loop()sleep(1);
}
else messagebox("Окно не найдено");
function getmessage(0, WM_CREATE)
{
dialog=formatiw(gethwnd(0));
}
function getmessage(0, WM_MOUSEWHEEL)
{
setwindowparam(dialog);
xx2=(dialog.width/2-xx) * 100 / percent;
yy2=(dialog.height/2-yy) * 100 / percent;
if(message.wparam>0 && percent<1000)percent=percent+100;
if(message.wparam<0 && percent>100)percent=percent-100;
if(xx<dialog.width/2 && yy<dialog.height/2)
{
xx=dialog.width/2-xx2*percent/100;
yy=dialog.height/2-yy2*percent/100;
}
visualwindow(formatiw(gethwnd(0)), 0, 0, 0, sizearray(scr), sizearray(scr[]), xx, yy, percent, #scr[0][0]);
update(formatiw(gethwnd(0)));
}
CREATE_TIMER(0, 10)
{
if(getkeystate(1))
{
if(formatwi(getwindow())==formatwi(dialog))
{
getmouse(mouse_x, mouse_y, formatiw(gethwnd(0)));
while(getkeystate(1))
{
getmouse(mouse_x2, mouse_y2, formatiw(gethwnd(0)));
visualwindow(formatiw(gethwnd(0)), 0, 0, 0, sizearray(scr), sizearray(scr[]), xx-mouse_x+mouse_x2, yy-mouse_y+mouse_y2, percent, #scr[0][0]);
sleep(1);
}
xx=xx - mouse_x + mouse_x2;
yy=yy - mouse_y + mouse_y2;
update(formatiw(gethwnd(0)));
}
}
if(getkeystate(192))
{
while(getkeystate(192)==1)sleep(10);
if(formatwi(getwindow())==formatwi(dialog))
{
getmouse(pos_x, pos_y, dialog);
pos_x=(sqrt(pow(xx-pos_x, 2))) * 100 / percent;
pos_y=(sqrt(pow(yy-pos_y, 2))) * 100 / percent;
textout(0, 300, 300, "Координаты: "+format(pos_x)+" "+format(pos_y), 0);
}
}
}