找回密码
 加入
搜索
查看: 2686|回复: 6

[GUI管理] 【求助】为什么我的窗口透明是这样的。。。。

  [复制链接]
发表于 2011-5-15 21:08:09 | 显示全部楼层 |阅读模式
为什么我的窗口透明是这样的。。。。
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>
#include <ComboConstants.au3>
#Region ### START Koda GUI section ### Form=c:\users\yf\desktop\denglu\login.kxf
$Form1_1 = GUICreate("用户登录", 410, 271, 272, 175)
GUISetIcon("C:\Users\YF\Desktop\denglu\res\db.ico", -1)
$username = GUICtrlCreateLabel("用户名", 24, 168, 55, 20)
GUICtrlSetFont(-1, 12, 800, 0, "幼圆")
$psw = GUICtrlCreateLabel("密码", 24, 208, 38, 20)
GUICtrlSetFont(-1, 12, 800, 0, "幼圆")
GUICtrlCreateInput("", 88, 168, 161, 21)
GUICtrlCreateInput("", 88, 208, 161, 21)
$Pic1 = GUICtrlCreatePic("C:\Users\YF\Desktop\denglu\res\login.bmp", 0, 0, 409, 129)
$Button1 = GUICtrlCreateButton("登录", 304, 168, 89, 57)
GUICtrlSetFont(-1, 12, 800, 0, "幼圆")
$Pic2 = GUICtrlCreatePic("C:\Users\YF\Desktop\denglu\res\1.bmp", 264, 152, 28, 100)
GUISetBkColor(0xA4D4D3)
        _WinAPI_SetLayeredWindowAttributes($Form1_1, 0xA4D4D3, 255)
        $MARGINS = DllStructCreate("int;int;int;int")
        DllStructSetData($MARGINS, 1, -1)
        DllCall("dwmapi.dll", "none", "DwmExtendFrameIntoClientArea", "hwnd", $Form1_1, "ptr", DllStructGetPtr($MARGINS))
        GUISetState(@SW_SHOW)
        
#EndRegion ### END Koda GUI section ###

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2011-5-15 21:08:34 | 显示全部楼层
不错!学习啦!
发表于 2011-5-15 21:46:47 | 显示全部楼层
不知道是否需要这样的效果:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>
#include <ComboConstants.au3>
#Region ### START Koda GUI section ### Form=c:\users\yf\desktop\denglu\login.kxf
$Form1_1 = GUICreate("用户登录", 410, 271, 272, 175)
GUISetIcon("C:\Users\YF\Desktop\denglu\res\db.ico", -1)
$username = GUICtrlCreateLabel("用户名", 24, 168, 55, 20)
GUICtrlSetBkColor(-1,-2)
GUICtrlSetColor(-1,0x00ffff)
GUICtrlSetFont(-1, 12, 800, 0, "幼圆")
$psw = GUICtrlCreateLabel("密码", 24, 208, 58, 20)
GUICtrlSetBkColor(-1,-2)
GUICtrlSetColor(-1,0x00ffff)
GUICtrlSetFont(-1, 12, 800, 0, "幼圆")
GUICtrlCreateInput("", 88, 168, 161, 21)
GUICtrlCreateInput("", 88, 208, 161, 21)
;$Pic1 = GUICtrlCreatePic("C:\Users\YF\Desktop\denglu\res\login.bmp", 0, 0, 409, 129)
$Button1 = GUICtrlCreateButton("登录", 304, 168, 89, 57)
GUICtrlSetFont(-1, 12, 800, 0, "幼圆")
$Pic2 = GUICtrlCreatePic("C:\Users\YF\Desktop\denglu\res\1.bmp", 264, 152, 28, 100)
GUISetBkColor(0)
;        _WinAPI_SetLayeredWindowAttributes($Form1_1, 0xabcdef, 120)
        $MARGINS = DllStructCreate("int;int;int;int")
        DllStructSetData($MARGINS, 1, -1)
        DllCall("dwmapi.dll", "none", "DwmExtendFrameIntoClientArea", "hwnd", $Form1_1, "ptr", DllStructGetPtr($MARGINS))
        GUISetState(@SW_SHOW)
        
#EndRegion ### END Koda GUI section ###
While GUIGetMsg()+3
WEnd
发表于 2011-5-16 12:58:59 | 显示全部楼层
都很不错,呵呵,学习学习
 楼主| 发表于 2011-5-16 21:09:04 | 显示全部楼层
回复 3# 3mile

恩,透明了,不过还是不明白我是哪里出了什么问题,按了您的改了以后,字体颜色好怪啊,怎么改成普通的黑色。。。
发表于 2011-5-16 21:20:16 | 显示全部楼层
回复 5# yanjerry9133
黑色?窗体背景设置成黑色的了,如果字体再设置成黑色,会被DWM过滤掉的.
不如把字体设置成白色会自然很多.
发表于 2011-5-17 00:31:11 | 显示全部楼层
留坐..............
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-6-5 07:47 , Processed in 0.082960 second(s), 25 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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