InputBox置顶的问题
如题!不知道怎么才能实现?!
用WinSetOnTop,实现不了
[ 本帖最后由 yEn 于 2008-10-16 02:50 编辑 ] :face (18): 难道没有办法? 好像是没办法,实在要这样,用子窗口带置顶样式 算了,查了很久,也没有什么办法了,看来只好用楼上的办法了!
貌似有点晚了。。。
; InputBox OnTop; Author - herewasplato
$ans = _InputBoxOnTop("Title", "Prompt")
If @error = 0 Then MsgBox(0, "Returned", $ans)
If @error = 1 Then MsgBox(0, "", "The Cancel button was pushed.")
If @error = 2 Then MsgBox(0, "", "The Timeout time was reached.")
If @error = 3 Then MsgBox(0, "", "The InputBox failed to open.")
Func _InputBoxOnTop($IBTitle, $IBPrompt, $IBDefault = "", _
$IBpassword_char = "", $IBWidth = -1, $IBHeight = -1, _
$IBLeft = Default, $IBTop = Default, $IBTimeOut = "")
Local $file = FileOpen(EnvGet("temp") & "\InputBoxOT.au3", 2)
If $file = -1 Then Return;if error, give up
Local $line1 = 'AutoItSetOption(' & '"WinWaitDelay", 0' & ')'
Local $line2 = 'WinWait("' & $IBTitle & '", "' & $IBPrompt & '")'
Local $line3 = 'WinSetOnTop("' & $IBTitle & '", "' & $IBPrompt & '" ,1)'
FileWrite($file, $line1 & @CRLF & $line2 & @CRLF & $line3)
FileClose($file)
Run(@AutoItExe & " /AutoIt3ExecuteScript " & EnvGet("temp") & "\InputBoxOT.au3")
Local $ans = InputBox($IBTitle, $IBPrompt, $IBDefault, _
$IBpassword_char, $IBWidth, $IBHeight, _
$IBLeft, $IBTop, $IBTimeOut)
If @error Then
$ans = @error
While Not FileDelete(EnvGet("temp") & "\InputBoxOT.au3")
Sleep(10)
WEnd
SetError($ans)
$ans = ""
Return $ans
EndIf
While Not FileDelete(EnvGet("temp") & "\InputBoxOT.au3")
Sleep(10)
WEnd
Return ($ans)
EndFunc;==>_InputBoxOnTop ; Author - herewasplato
$ans = InputBoxOnTop("Title", "Prompt")
If @error = 0 Then MsgBox(0, "Returned", $ans)
If @error = 1 Then MsgBox(0, "", "The Cancel button was pushed.")
If @error = 2 Then MsgBox(0, "", "The Timeout time was reached.")
If @error = 3 Then MsgBox(0, "", "The InputBox failed to open.")
Func InputBoxOnTop($IBTitle, $IBPrompt, $IBDefault = "", _
$IBpassword_char = "", $IBWidth = -1, $IBHeight = -1, _
$IBLeft = Default, $IBTop = Default, $IBTimeOut = "")
Local $file = FileOpen(EnvGet("temp") & "InputBoxOT.au3", 2)
If $file = -1 Then Return;if error, give up
Local $line1 = 'AutoItSetOption(' & '"WinWaitDelay", 0' & ')'
Local $line2 = 'WinWait("' & $IBTitle & '", "' & $IBPrompt & '")'
Local $line3 = 'WinSetOnTop("' & $IBTitle & '", "' & $IBPrompt & '" ,1)'
FileWrite($file, $line1 & @CRLF & $line2 & @CRLF & $line3)
FileClose($file)
Run(@AutoItExe & " /AutoIt3ExecuteScript " & EnvGet("temp") & "InputBoxOT.au3")
Local $ans = InputBox($IBTitle, $IBPrompt, $IBDefault, _
$IBpassword_char, $IBWidth, $IBHeight, _
$IBLeft, $IBTop, $IBTimeOut)
If @error Then
$ans = @error
While Not FileDelete(EnvGet("temp") & "InputBoxOT.au3")
Sleep(10)
WEnd
SetError($ans)
$ans = ""
Return $ans
EndIf
While Not FileDelete(EnvGet("temp") & "InputBoxOT.au3")
Sleep(10)
WEnd
Return ($ans)
EndFunc;==>_InputBoxOnTop
看看了...
页:
[1]