找回密码
 加入
搜索
查看: 2067|回复: 6

[AU3基础] [已解决] $WS_POPUP 属性的窗体如何用鼠标在桌面上拖动

  [复制链接]
发表于 2016-5-4 09:31:45 | 显示全部楼层 |阅读模式
本帖最后由 hnfeng 于 2016-5-6 20:24 编辑

下面的代码中的窗体只显示在桌面中间位置。怎样才能用鼠标拖动呢? 先谢谢了


#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("Form1", 460, 260, -1, -1, $WS_POPUP)
GUISetBkColor(0x008080)
$Button1 = GUICtrlCreateButton("OK", 384, 224, 65, 25)
GUICtrlSetBkColor(-1, 0x0080c0)
GUISetState(@SW_SHOW)
WinSetTrans($Form1, "", 200)

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button1
                        Exit
        EndSwitch
WEnd
发表于 2016-5-4 09:50:47 | 显示全部楼层
好像只有快捷键
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Global $g_move = False
HotKeySet("{home}", "_moveit")
$Form1 = GUICreate("Form1", 460, 260, -1, -1, $WS_POPUP)
GUISetBkColor(0x008080)
$Button1 = GUICtrlCreateButton("OK", 384, 224, 65, 25)
GUICtrlSetBkColor(-1, 0x0080c0)
GUISetState(@SW_SHOW)
WinSetTrans($Form1, "", 200)

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button1
                        Exit
        EndSwitch
WEnd


Func _moveit()
        $g_move = Not $g_move
        While $g_move
                WinMove($Form1, "", MouseGetPos(0), MouseGetPos(1))
        WEnd
EndFunc   ;==>_moveit
 楼主| 发表于 2016-5-4 10:07:33 | 显示全部楼层
回复 2# zghwelcome


    谢谢。
不怎么想用快捷键
想尽量用鼠标拖动
发表于 2016-5-4 10:45:47 | 显示全部楼层
本帖最后由 kk_lee69 于 2016-5-4 10:47 编辑

回复 1# hnfeng

http://www.autoitx.com/forum.php ... =%CE%DE%B1%DF%BF%F2

善用搜尋
 楼主| 发表于 2016-5-4 10:57:21 | 显示全部楼层
回复 4# kk_lee69


    多谢多谢
发表于 2016-5-4 12:40:34 | 显示全部楼层
回复 5# hnfeng


    似乎你前年回复过那贴
 楼主| 发表于 2016-5-6 20:23:58 | 显示全部楼层
回复 6# afan


    确实,看到了才知道

不好意思,忘记了  
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-9-29 03:23 , Processed in 0.189696 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表