找回密码
 加入
搜索
查看: 1649|回复: 2

[AU3基础] 如何让程序的窗口保持在窗口最上层?

[复制链接]
发表于 2010-9-26 23:29:30 | 显示全部楼层 |阅读模式
各位大大,如何让AU3运行在窗口的最上层?
发表于 2010-9-26 23:41:02 | 显示全部楼层
发表于 2010-9-27 10:21:20 | 显示全部楼层
#cs ----------------------------------------------------------------------------

AutoIt Version: 3.3.6.1
Author:         myName

Script Function:
        Template AutoIt script.

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here
#Include <WinAPI.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("我就是这么犀利,谁能挡住我?还有谁?", 623,200, 192, 114)
GUISetState(@SW_SHOW)

While 1
        $hw=_WinAPI_GetForegroundWindow()
                If $hw<>$Form1 Then
                        _WinAPI_SetWindowPos($hw, -2, 0, 0, 0, 0, 3)
                    
                EndIf
                _WinAPI_SetWindowPos($Form1, -1, 0, 0, 0, 0, 3)
                $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit

        EndSwitch
WEnd


以上代码出自
http://www.autoitx.com/forum.php ... hlight=%D6%C3%B6%A5
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-21 20:44 , Processed in 0.076623 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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