找回密码
 加入
搜索
查看: 6061|回复: 17

如何使指定窗口始终处于最底层?

  [复制链接]
发表于 2008-7-5 20:56:29 | 显示全部楼层 |阅读模式
如题。                                               .

[ 本帖最后由 新手上路 于 2008-7-15 09:54 编辑 ]
发表于 2008-7-5 23:24:39 | 显示全部楼层
API。
 楼主| 发表于 2008-7-5 23:30:38 | 显示全部楼层
呵呵,本人新手,不懂怎么用 API 这么高级的呀
发表于 2008-7-6 15:59:03 | 显示全部楼层
 楼主| 发表于 2008-7-6 20:20:54 | 显示全部楼层
不是这样的。我的要求是,假设有 A、B、C 三个窗口,只有 B、C 可以成为顶层窗口,即使用鼠标激活 A 窗口,也不会浮到顶层。
 楼主| 发表于 2008-7-7 13:51:08 | 显示全部楼层
请 sanhen 大侠再指点一下啊
发表于 2008-7-10 01:43:36 | 显示全部楼层

$Parent = GUICreate("")
$Form1 = GUICreate("InputPass", 109, 13, -1, -1, 0x80000000, 0, $Parent);弹出试窗口并且不在任务拦显示
$Info = WinGetPos($Form1)
$PasswordEdit = GUICtrlCreateInput("", 0, 0, 89, 15, 0x0020 + 0x0080, 0x00020000);密码输入框
$ButtonOk = GUICtrlCreateButton("ok", 90, 0, 20, 14, 0)
$Width = Width_() / 2 - ($Info[2] / 2);设置左侧在屏幕中间
DllCall("user32.dll", "long", "SetWindowPos", "long", $Form1, "long", -1, "long", $Width, "long", 0, "long", 0, "long", 0, "long", 1);置顶
GUISetState(@SW_SHOW)
While 1
$msg = GUIGetMsg()
Select
Case $msg = $ButtonOk
Exit
EndSelect
WEnd


;--------------------------------------返回分辨率宽度---------------------------
Func Width_()
Local $colItems = "", $Output = ""
$objWMIService = ObjGet("winmgmts:\\localhost\root\CIMV2")
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_DesktopMonitor", "WQL", 0x10 + 0x20)
For $objItem In $colItems
$Output = $objItem.ScreenWidth
Next
Return $Output
EndFunc ;==>Width_
发表于 2008-7-10 01:47:11 | 显示全部楼层
晕  看错标题   还以为是最顶层呢
发表于 2008-7-10 05:15:37 | 显示全部楼层
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Opt('MustDeclareVars', 1)

Example1()


; example 1
Func Example1()
    Local $msg,$Child,$hwnd

    $Child=GUICreate("My GUI") 
        
        $hwnd=WinGetHandle("Program Manager","")
        
        DllCall("user32.dll","hwnd","SetParent","hwnd",$Child,"hwnd",$hwnd)
        
    GUISetState(@SW_SHOW)       


    While 1
        $msg = GUIGetMsg()

        If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    WEnd
    GUIDelete()
EndFunc   ;==>Example1

发表于 2008-7-10 05:43:36 | 显示全部楼层
    收下了!!
发表于 2009-10-15 19:58:31 | 显示全部楼层
呵呵,不错,学习一下。。
发表于 2009-11-2 16:43:17 | 显示全部楼层
学习一下能看懂一点
发表于 2010-9-8 08:03:19 | 显示全部楼层
看不懂9楼代码的意思啊,谁能解释一下.学习学习
发表于 2011-11-5 12:02:44 | 显示全部楼层
完全没看明白。
发表于 2012-3-3 01:20:43 | 显示全部楼层
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-28 16:15 , Processed in 0.091224 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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