我想用鼠标移动无边框HTA窗口

时间:2016-06-24 14:34:46

标签: move onmouseover hta borderless movable

我喜欢批处理文件编程,但它运行安静,我不想公开代码,所以我决定制作一个HTA窗口来显示它的运行..

即使它的显示,我想它无边框,但是它不能移动,所以我需要它可移动或用鼠标移动,就像,如果即将到达窗口,它显示从光标移动,就像“捕捉我,如果你能“,我看到一些按钮,图像示例,但有窗口,我无法做到它

<HTML><HEAD><HTA:application border="none" showInTaskbar="no" innerBorder="no" scroll="no" singleInstance="yes" selection="no" version="1.0"/>
<style type="text/css">
    body 
    { 
        color: #FFFFFF; background: #1E1E1E; font-family: "Lucida Console"; font-size: 11px; 
    }
</style>
<script type="text/javascript">
document.onmouseenter=MoveWindow;
document.onmouseover=MovenoWindow;
document.onload=resize();
document.onmouseenter=MoveWindow;
document.onmouseover=MovenoWindow;
    function resize()
    {
        window.moveTo(screen.width/2-116,screen.height/2-screen.height/2)
        window.resizeTo(220,20)
    }
    function MoveWindow (event) 
    {
        if (!event) 
        {
            event = window.event;
        }
        cursor = { x : 0, y : 0 };
        cursor.x = event.clientX;
        cursor.y = event.clientY;
        window.moveBy (cursor.x-1,cursor.y-1);
        }
    function MovenoWindow (event) 
    {
        if (!event) 
        {
            event = window.event;
        }
        cursor = { x : 0, y : 0 };
        cursor.x = event.clientX;
        cursor.y = event.clientY;
        window.moveBy (cursor.x-10,cursor.y-10);
    }
</script></head>
<body topmargin="5" leftmargin="5" marginheight="0" marginwidth="0">
<center>CATCH ME IF YOU CAN</center></BODY></HTML>

0 个答案:

没有答案