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

[GUI管理] 闪屏问题有没有好的解决办法呢?[已解决]

[复制链接]
发表于 2011-3-23 09:39:21 | 显示全部楼层 |阅读模式
本帖最后由 清风飘飘 于 2011-5-19 16:37 编辑
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

#include <Date.au3>

#Region ### START Koda GUI section ### Form=
$pos = WinGetPos("[class:Shell_TrayWnd]")
$Form1 = GUICreate("Form1", 350, 100, @DesktopWidth - 400 - 4, @DesktopHeight - 100 - $pos[3] - 32, $WS_POPUP, $WS_EX_LAYERED)
GUISetBkColor(0xABCDEF);不要透明时屏蔽此行
GUICtrlCreateGroup ("", 1, 1, 348, 98)
$Pic1 = GUICtrlCreatePic("12111.jpg", 10, 16, 330, 50)
$Label1 = GUICtrlCreateLabel("欢迎大家访问奇奇网讯,我们真诚为你精选最好的资讯、软件!",20, 90, 350, 17, -1, $GUI_WS_EX_PARENTDRAG)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetColor(-1,0x000000)
GUICtrlSetFont(-1, 9, 400, 0, "微软雅黑")
GUISetState(@SW_SHOW)
#EndRegion ### START Koda GUI section ### Form=
GUICtrlCreateGroup ("", 5, 5, 340, 65)
_API_SetLayeredWindowAttributes($Form1, 0xABCDEF);不要透明时屏蔽此行
GUICtrlCreateGroup ("", 5, 65, 340, 30)
While -340
        For $i = 500 To -340 step -1
                GUICtrlSetPos($Label1, $i, 75);改这里字体下移了
                Sleep(1)
        Next
        Sleep(1)
WEnd
;以下是透明设置
Func _API_SetLayeredWindowAttributes($hwnd, $i_transcolor, $Transparency = 255, $isColorRef = False)

Local Const $AC_SRC_ALPHA = 1
Local Const $ULW_ALPHA = 2
Local Const $LWA_ALPHA = 0x2
Local Const $LWA_COLORKEY = 0x1
If Not $isColorRef Then
  $i_transcolor = Hex(String($i_transcolor), 6)
  $i_transcolor = Execute('0x00' & StringMid($i_transcolor, 5, 2) & StringMid($i_transcolor, 3, 2) & StringMid($i_transcolor, 1, 2))
EndIf
Local $Ret = DllCall("user32.dll", "int", "SetLayeredWindowAttributes", "hwnd", $hwnd, "long", $i_transcolor, "byte", $Transparency, "long", $LWA_COLORKEY + $LWA_ALPHA)
Select
  Case @error
   Return SetError(@error, 0, 0)
  Case $Ret[0] = 0
   Return SetError(4, 0, 0)
  Case Else
   Return 1
EndSelect
EndFunc   ;==>_API_SetLayeredWindowAttributes
发表于 2011-4-17 21:20:18 | 显示全部楼层
没太看明白代码原理
发表于 2011-4-17 21:36:04 | 显示全部楼层
不用GUICtrlSetPos 用ControlMove("","",$Label1, $i, 75)
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-6-2 23:30 , Processed in 0.073356 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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