找回密码
 加入
搜索
查看: 1988|回复: 1

[GUI管理] 去掉皮肤边框后,怎么做才能移动呢???[已解决]

[复制链接]
发表于 2011-1-5 13:50:55 | 显示全部楼层 |阅读模式
本帖最后由 872777825 于 2011-1-5 13:58 编辑

小弟做个东西去掉皮肤边框加载图片后发现窗口不能移动

不知道还要如何写才能实现

麻烦各位老师指点一下  谢谢  在线等候

源码如下
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 623, 449, 190, 108, $WS_POPUP, $WS_EX_TOOLWINDOW)
$Button1 = GUICtrlCreateButton("为什么拖不动", 136, 168, 385, 89)
$Pic = GUICtrlCreatePic(@ScriptDir & "\tmp.JPG", 0, 0, 623, 449, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

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

        EndSwitch
WEnd
 楼主| 发表于 2011-1-5 13:58:01 | 显示全部楼层

去掉皮肤边框后,怎么做才能移动呢???

通过搜索发现站里有相关案例

以下
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>
#include <ButtonConstants.au3>
 
Global $wmp = ObjCreate("WMPlayer.OCX")
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("", 417, 600, 193, 115, $WS_POPUP, $WS_EX_LAYERED)  ;$WS_EX_LAYERED界面背景透明效果
$Button1 = GUICtrlCreateButton("Button1", 336, 24, 75, 25, 0)
$Button2 = GUICtrlCreateButton("Button2", 336, 72, 75, 25, 0)
$Button3 = GUICtrlCreateButton("Button3", 336, 120, 75, 25, 0)
$Pic1 = GUICtrlCreatePic("4.bmp", 0, 0, 417, 600, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
 
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
 
 While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                 Case $GUI_EVENT_PRIMARYDOWN
            mouseCHK()
        EndSwitch
WEnd
 
Func mouseCHK()
    $MS = GUIGetCursorInfo($Form1)
    If $MS[4] = $Pic1 Then move()
EndFunc   ;==>mouseCHK
Func move()
    Local $PosDiff[2], $MousePos, $WinPos
    $MousePos = MouseGetPos()
    $WinPos = WinGetPos($Form1, "")
    $PosDiff[0] = $WinPos[0] - $MousePos[0]
    $PosDiff[1] = $WinPos[1] - $MousePos[1]
    While _IsPressed("01", DllOpen("user32.dll"))
        $MousePos = MouseGetPos()
        WinMove($Form1, "", $MousePos[0] + $PosDiff[0], $MousePos[1] + $PosDiff[1])
        Sleep(10)
    WEnd
EndFunc   ;==>move
原帖 http://www.autoitx.com/forum.php ... hlight=%D2%C6%B6%AF
谢谢该楼主
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-11-1 08:07 , Processed in 0.075764 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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