本帖最后由 zerobin 于 2012-5-15 23:15 编辑
公共扩展样式里有个 $GUI_WS_EX_PARENTDRAG 允许拖动标签(label)或者图片(Pic)控件时即拖动整个父窗口。不 ...
地平线 发表于 2012-5-15 18:09
使用过,没有达到我想要的,现在是下部分窗口可以移动,但是不能操作网页了
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
Opt("GUICoordMode", 0)
Opt("GUIOnEventMode", 1)
Global $menu, $menu2, $menu3, $A1, $A2, $B1, $C1, $C2
Global $url, $Gui_h, $Gui_w, $Form1, $1, $2, $Form2, $Form3, $Label1
$url = "http://WWW.HAO123.COM"
Global $Title = "HAO123"
$Gui_w = 482
$Gui_h = 290
$Form1 = GUICreate($Title, $Gui_w, $Gui_h, -1, -1, $WS_POPUP)
caidan()
$1 = ObjCreate("Shell.Explorer.2")
$2 = GUICtrlCreateObj($1, -30, -30, $Gui_w + 50, $Gui_h)
GUICtrlSetState(-1, $GUI_HIDE)
$1.navigate($url)
GUISetState(@SW_SHOW)
GUICtrlSetState($2, $GUI_show)
While 1
Sleep(200)
WEnd
Func caidan()
$Label1 = GUICtrlCreateLabel("", 0, 0, $Gui_w, $Gui_h, $SS_CENTERIMAGE, $GUI_WS_EX_PARENTDRAG)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT);透明
$menu = GUICtrlCreateMenu("A")
$A1 = GUICtrlCreateMenuItem("HAO123", $menu)
GUICtrlSetOnEvent(-1, "_DT")
$A2 = GUICtrlCreateMenuItem("BAIDU", $menu)
GUICtrlSetOnEvent(-1, "_DT")
$menu2 = GUICtrlCreateMenu("B")
$B1 = GUICtrlCreateMenuItem("SOHU", $menu2)
GUICtrlSetOnEvent(-1, "_DT")
$menu3 = GUICtrlCreateMenu("窗口")
$C1 = GUICtrlCreateMenuItem("最小化", $menu3)
GUICtrlSetOnEvent(-1, "_DT")
$C2 = GUICtrlCreateMenuItem("退出", $menu3)
GUICtrlSetOnEvent(-1, "_DT")
EndFunc ;==>caidan
Func _DT()
Switch @GUI_CtrlId
Case $A1
GUIDelete($Form1)
$url = "http://WWW.HAO123.COM"
Global $Title = "HAO123"
$Gui_w = 420
$Gui_h = 186
$Form1 = GUICreate($Title, $Gui_w, $Gui_h, -1, -1, $WS_POPUP)
caidan()
$1 = ObjCreate("Shell.Explorer.2")
$2 = GUICtrlCreateObj($1, -1, -1, $Gui_w + 50, $Gui_h)
GUICtrlSetState(-1, $GUI_HIDE)
$1.navigate($url)
GUISetState(@SW_SHOW)
GUICtrlSetState($2, $GUI_show)
Case $A2
GUIDelete($Form1)
$url = "http://WWW.BAIDU.COM"
Global $Title = "BAIDU"
$Gui_w = 398
$Gui_h = 220
$Form1 = GUICreate($Title, $Gui_w, $Gui_h, -1, -1, $WS_POPUP)
caidan()
$1 = ObjCreate("Shell.Explorer.2")
$2 = GUICtrlCreateObj($1, -1, -50, $Gui_w + 22, $Gui_h + 50)
GUICtrlSetState(-1, $GUI_HIDE)
$1.navigate($url)
GUISetState(@SW_SHOW)
GUICtrlSetState($2, $GUI_show)
Case $B1
GUIDelete($Form1)
$url = "http://WWW.SOHU.COM"
Global $Title = "SOHU"
$Gui_w = 482
$Gui_h = 290
$Form1 = GUICreate($Title, $Gui_w, $Gui_h, -1, -1, $WS_POPUP)
caidan()
$1 = ObjCreate("Shell.Explorer.2")
$2 = GUICtrlCreateObj($1, -1, -17, $Gui_w + 50, $Gui_h)
GUICtrlSetState(-1, $GUI_HIDE)
$1.navigate($url)
GUISetState(@SW_SHOW)
GUICtrlSetState($2, $GUI_show)
Case $C1
WinSetState($Form1, "", @SW_MINIMIZE)
Case $C2
Exit
EndSwitch
EndFunc ;==>_DT
|