[已解决] $WS_POPUP 属性的窗体如何用鼠标在桌面上拖动
本帖最后由 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
好像只有快捷键
#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 回复 2# zghwelcome
谢谢。
不怎么想用快捷键
想尽量用鼠标拖动 本帖最后由 kk_lee69 于 2016-5-4 10:47 编辑
回复 1# hnfeng
http://www.autoitx.com/forum.php?mod=viewthread&tid=24994&highlight=%CE%DE%B1%DF%BF%F2
善用搜尋{:face (356):} 回复 4# kk_lee69
多谢多谢 回复 5# hnfeng
似乎你前年回复过那贴 {:face (303):} 回复 6# afan
确实,看到了才知道
不好意思,忘记了{:face (394):}
页:
[1]