父窗口由以下代码创建:
Opt("WinTitleMatchMode", 3)
Opt("GUIResizeMode", 1)
$GUI2 = GUICreate("Consoles", 1020, 600, 0, 0, BitOR($WS_MINIMIZEBOX, $WS_MAXIMIZEBOX, $WS_SYSMENU, $WS_CAPTION, $WS_CLIPCHILDREN, $WS_POPUP, $WS_POPUPWINDOW, $WS_GROUP, $WS_BORDER, $WS_SIZEBOX, $WS_CLIPSIBLINGS))
$hwnd00 = WinGetHandle("Consoles")
DisableButton($GUI2, $SC_CLOSE)
子窗口由以下代码创建:
Func StartServer($Type, $loc, $ID, $chosen, $Handle, $Name)
$ID = Run("java " & $chosen & " -Xms512M -XX:MaxPermSize=128M -jar " & '"' & $loc & "\" & $Type & '"', $loc, 5)
Sleep(300)
If Not ProcessWait($ID, 5) = 0 Then
WinSetTitle("C:\Windows\system32\java.exe", "", $Name)
WinSetTitle("C:\WINDOWS\SYSTEM32\java.exe", "", $Name)
$Handle = WinGetHandle($Name)
Sleep(100)
_WinAPI_SetWindowLong($Handle, $GWL_EXSTYLE, $WS_EX_MDICHILD)
_WinAPI_SetParent($Handle, $GUI2)
Sleep(100)
Else
MsgBox(-1, "ERROR", "Either the server file was not found or the server crashed because of and internal or a java error. Please check if the jar excists and look after java errors. The program will now exit.")
ControlSend("Bungee", "", $hwnd0, 'end' & '{ENTER}')
ControlSend("Server1", "", $hwnd1, "stop" & '{ENTER}')
ControlSend("Server2", "", $hwnd2, "stop" & '{ENTER}')
ControlSend("Server3", "", $hwnd3, "stop" & '{ENTER}')
ControlSend("Server4", "", $hwnd4, "stop" & '{ENTER}')
ControlSend("Server5", "", $hwnd5, "stop" & '{ENTER}')
Exit
EndIf
Sleep(500)
EndFunc ;==>StartServer
子窗口可以自由移动。如果它接近父GUI的边界,它会开始出现故障或完全消失 如何定义边框并防止子窗户出门?