| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1506 人关注过本帖
标题:SetLayeredWindowAttributes在VC6.0中使用
只看楼主 加入收藏
hamuamu0
Rank: 1
等 级:新手上路
帖 子:15
专家分:0
注 册:2014-1-25
结帖率:75%
收藏
 问题点数:0 回复次数:2 
SetLayeredWindowAttributes在VC6.0中使用
在VC6中编辑一个透明度的函数,用了SetLayeredWindowAttributes这个函数,但是老是显示没定义,不知道是缺了头文件还是怎么的。部分代码如下:


       SetWindowLong(hwnd,GWL_EXSTYLE, GetWindowLong(hwnd,GWL_EXSTYLE)^0x80000);
        SetLayeredWindowAttributes(hwnd,RGB(100,100,100),25,LWA_ALPHA);
        BTMD=0;
头文件为:#include "stdafx.h"
#include <windows.h>
#include <windowsx.h>
#include <mmsystem.h>
#include <commctrl.h>
#include <commdlg.h>
#include <stdio.h>
#include <time.h>
#pragma comment(lib,"winmm.lib")
#include "resource.h"
#include "MainDlg.h"
搜索更多相关主题的帖子: comment include 透明度 
2014-03-11 22:17
rjsp
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:版主
威 望:528
帖 子:9007
专家分:53942
注 册:2011-1-18
收藏
得分:0 
要求 _WIN32_WINNT >= 0x0500
所以在 #include <windows.h> 之前要加 #define _WIN32_WINNT ???我晕,你竟然没说是哪个版本的windows,你自己去google相应的值吧,比如xp是 0x0501
2014-03-12 10:45
hamuamu0
Rank: 1
等 级:新手上路
帖 子:15
专家分:0
注 册:2014-1-25
收藏
得分:0 
回复 2楼 rjsp
我的是win7的系统,#include "stdafx.h"
#define _WIN32_WINNT >= 0x0500
#define _WIN32_WINNT >= 0x0601
#include <windows.h>
#include <windowsx.h>
#include <mmsystem.h>
#include <commctrl.h>
#include <commdlg.h>
#include <shellapi.h>
#include <stdio.h>
#include <time.h>
#pragma comment(lib,"winmm.lib")
#include "resource.h"
#include "MainDlg.h"

但是我把它写在前面显示还是出错啊
提示C:\Users\Administrator\Desktop\yinlue\音乐播放器\MainDlg.cpp(2) : warning C4005: '_WIN32_WINNT' : macro redefinition
        d:\新建文件夹 (4)\音乐播放器\stdafx.h(6) : see previous definition of '_WIN32_WINNT'
C:\Users\Administrator\Desktop\yinlue\音乐播放器\MainDlg.cpp(3) : warning C4005: '_WIN32_WINNT' : macro redefinition
        C:\Users\Administrator\Desktop\yinlue\音乐播放器\MainDlg.cpp(2) : see previous definition of '_WIN32_WINNT'
c:\program files (x86)\microsoft visual studio\vc98\include\commctrl.h(19) : fatal error C1017: invalid integer constant expression
执行 cl.exe 时出错.
2014-03-15 20:03
快速回复:SetLayeredWindowAttributes在VC6.0中使用
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016907 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved