找回密码
 加入
搜索
查看: 2576|回复: 5

InputBox置顶的问题

[复制链接]
发表于 2008-10-13 21:45:33 | 显示全部楼层 |阅读模式
如题!
不知道怎么才能实现?!
用WinSetOnTop,实现不了

[ 本帖最后由 yEn 于 2008-10-16 02:50 编辑 ]
 楼主| 发表于 2008-10-14 20:43:49 | 显示全部楼层
难道没有办法?
发表于 2008-10-15 12:15:51 | 显示全部楼层
好像是没办法,实在要这样,用子窗口带置顶样式
 楼主| 发表于 2008-10-16 02:50:34 | 显示全部楼层
算了,查了很久,也没有什么办法了,看来只好用楼上的办法了!
发表于 2008-12-22 14:25:35 | 显示全部楼层

貌似有点晚了。。。

; 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
发表于 2009-4-1 15:41:19 | 显示全部楼层
; 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


看看了...
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-19 12:05 , Processed in 0.071707 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表