Global $blackbarwindow
Opt("GUIOnEventMode", 1)
$newgui=blackbarwin()
GUISetState(@SW_SHOW)
While 1
Sleep(50)
WEnd
Func blackbarwin($thetitle="",$width=500,$height=400,$left=-1,$right=-1,$param1=0,$param2=0)
$blackbarwindow = GUICreate($thetitle, $width, $height, $left, $right, BitOR(0x80000000,$param1),BitOR(0,$param2))
GUICtrlCreateLabel(" "&$thetitle, 0, 0, $width-38, 25,0x0200,0x00100000)
GUICtrlSetFont(-1, 10, 500, 0,"宋体")
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlCreateLabel("-", $width-39, 0, 20, 25,0x0200)
GUICtrlSetFont(-1, 12, 900, 0)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlSetCursor(-1, 0)
GUICtrlSetOnEvent(-1,"miniit")
GUICtrlCreateLabel("×",$width-20, 0, 20, 25,0x0200)
GUICtrlSetFont(-1, 12, 900, 0)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlSetCursor(-1, 0)
GUICtrlSetOnEvent(-1,"closeit")
GUICtrlCreateLabel("", 0, 0, 1, $height-1) ;left
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlCreateLabel("", $width-1, 0, 1, $height-1) ;right
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlCreateLabel("", 0, $height-1, $width, 1) ;down
GUICtrlSetBkColor(-1, 0x000000)
return $blackbarwindow
EndFunc
Func miniit()
GUISetState(@SW_MINIMIZE, $blackbarwindow)
EndFunc
Func closeit()
DllCall("user32.dll", "int", "AnimateWindow", "HWND", $blackbarwindow, "int", 200, "long", 0x00050010)
Exit
EndFunc
上面这个是我的黑边框UDF,使用正常,但有一个缺点,就是使用了那个0x80000000样式后,在任务栏里点此任务,不能最小化和还原切换(譬如打开记事本,任务栏点之可最小化之,再点还原显示之),不知有否API可恢复这个GUI的这个特性??