惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Vercel News
Vercel News
博客园 - 司徒正美
C
Check Point Blog
G
Google Developers Blog
The GitHub Blog
The GitHub Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
有赞技术团队
有赞技术团队
P
Proofpoint News Feed
IT之家
IT之家
B
Blog
博客园_首页
量子位
MongoDB | Blog
MongoDB | Blog
博客园 - Franky
J
Java Code Geeks
H
Help Net Security
A
About on SuperTechFans
Apple Machine Learning Research
Apple Machine Learning Research
Jina AI
Jina AI
D
DataBreaches.Net
Y
Y Combinator Blog
大猫的无限游戏
大猫的无限游戏
云风的 BLOG
云风的 BLOG
Google DeepMind News
Google DeepMind News

博客园 - 泡泡

设置文件属性 VC - 泡泡 - 博客园 程序小注意 - 泡泡 - 博客园 有关进程创建,与子进程的路径指定 dll 有关CComboBox - 泡泡 - 博客园 有关线程 ADO 存储过程 - 泡泡 - 博客园 VC执行存储过程 - 泡泡 - 博客园 读写文件操作 - 泡泡 - 博客园 Access数据库SQL操作 ComboBox控件-转 CTime 常用字符转换 字符串分解 音频 Inno SetUp 控件LIST 有关音频编码 Windows Media
窗口透明、半透明
泡泡 · 2006-05-19 · via 博客园 - 泡泡

SetWindowLong(this->GetSafeHwnd(),GWL_EXSTYLE, GetWindowLong(this->GetSafeHwnd(),GWL_EXSTYLE)|0x80000);
 HINSTANCE hInst = LoadLibrary("User32.DLL");
 if(hInst)
 {
  typedef BOOL (WINAPI *MYFUNC)(HWND,COLORREF,BYTE,DWORD);
  MYFUNC fun = NULL;
  //取得SetLayeredWindowAttributes函数指针
  fun=(MYFUNC)GetProcAddress(hInst, "SetLayeredWindowAttributes");
  if(fun)fun(this->GetSafeHwnd(),0,150,2);
  FreeLibrary(hInst);
 } 

//说明:
1.增加WS_EX_LAYERED窗口风格,值为80000
2.在头文件第一行定义#define _WIN32_WINNT 0x500

3. SetLayeredWindowAttributes(
    hWnd,
    0,//颜色值。
    150,//透明深度 0-为完全透明,255-为不透明
    ULW_ALPHA);//参数,表示透明效果。为1,表示对单种颜色透明