hkzhangt 发表于 2010-9-26 23:29:30

如何让程序的窗口保持在窗口最上层?

各位大大,如何让AU3运行在窗口的最上层?

水木子 发表于 2010-9-26 23:41:02

http://www.autoitx.com/search.php?searchid=4044&orderby=lastpost&ascdesc=desc&searchsubmit=yes

t87564833 发表于 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?mod=viewthread&tid=17261&highlight=%D6%C3%B6%A5
页: [1]
查看完整版本: 如何让程序的窗口保持在窗口最上层?