清风飘飘 发表于 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("")
$Form1 = GUICreate("Form1", 350, 100, @DesktopWidth - 400 - 4, @DesktopHeight - 100 - $pos - 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
   Return SetError(4, 0, 0)
Case Else
   Return 1
EndSelect
EndFunc   ;==>_API_SetLayeredWindowAttributes

xrzmjz 发表于 2011-4-17 21:20:18

没太看明白代码原理

xzxnovice 发表于 2011-4-17 21:36:04

不用GUICtrlSetPos 用ControlMove("","",$Label1, $i, 75)
页: [1]
查看完整版本: 闪屏问题有没有好的解决办法呢?[已解决]