见代码
#include <WindowsConstants.au3>
$Form1_1 = GUICreate("", 439, 466, -1, -1, -1, $WS_EX_ACCEPTFILES)
HotKeySet("^!c", "show")
While 1
If GUIGetMsg() = -3 Then Exit
WEnd
Func show()
_SetParent($Form1_1, "Program Manager")
_SetWindowPos(WinGetHandle(AutoItWinGetTitle()), 291, 125)
GUISetState(@SW_SHOW)
EndFunc
Func _SetParent($TitleP, $TitleC)
If WinExists($TitleP) Then
If WinExists($TitleC) Then
$HwndP = WinGetHandle($TitleP)
$HwndC = WinGetHandle($TitleC)
DllCall("user32.dll", "str", "SetParent", "HWnd", $HwndP, "HWnd", $HwndC)
Return 1
Else
Return -1
EndIf
Else
Return -1
EndIf
EndFunc
Func _SetWindowPos($hWnd, $x, $y)
Local $cX, $cY
$hWndInsertAfter = "HWND_TOPMOST"
$wFlags = 1
DllCall("user32.dll", "long", "SetWindowPos", "long", $hWnd, "long", $hWndInsertAfter, "long", $x, _
"long", $y, "long", $cX, "long", $cY, "long", $wFlags)
EndFunc
是因为使用了SetParent还是其它原因?
高手都来支下招!!! |