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

[GUI管理] 报告:win2008下编译,gui窗口置顶编码失效

[复制链接]
发表于 2017-4-18 16:44:29 | 显示全部楼层 |阅读模式
在win2008下直接运行、编译,置顶代码失效,窗口不能置顶
在xp下编译,可以置顶。
把xp编译后的exe文件拿到win2008下,可以正常使用,运行时仍然置顶。
_SetWindowPos($Form1, 200, 200)
Func _MainSwitch()
        Switch @GUI_CtrlId
                Case $GUI_EVENT_CLOSE
                        GUIDelete($Form1)
                        Exit
       EndSwitch
        EndFunc
        Func _SetWindowPos($hWnd, $x, $y) ;使用API将窗体保持最前  
 Local $cX, $cY  
 Dim $hWndInsertAfter = -1  
 Dim $wFlags = 1  
 DllCall("user32.dll", "long", "SetWindowPos", "long", $hWnd, "long", $hWndInsertAfter, "long", $x, _  
   "long", $y, "long", $cX, "long", $cY, "long", $wFlags)  
EndFunc   ;==>_SetWindowPos 
发表于 2017-4-18 17:13:37 | 显示全部楼层
回复 1# pingguo002

64位元 與 32位元問題吧

  在WIN2008下 以32位元編譯 看看
发表于 2017-4-18 23:14:07 | 显示全部楼层
winsetontop这个比较好用。。。
发表于 2017-4-18 23:17:42 | 显示全部楼层
例子:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 615, 438, 192, 124)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        WinSetOnTop($Form1,"",1)
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit

        EndSwitch
WEnd

 楼主| 发表于 2017-4-19 09:57:06 | 显示全部楼层
谢谢,选32位编译就能正常编译运行了
发表于 2017-4-19 10:16:17 | 显示全部楼层
回复 5# pingguo002

解決了 請修改標題   請看板規
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-4-25 22:38 , Processed in 0.075645 second(s), 22 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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