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

推荐订阅源

D
DataBreaches.Net
N
Netflix TechBlog - Medium
P
Proofpoint News Feed
D
Docker
J
Java Code Geeks
L
LangChain Blog
Microsoft Security Blog
Microsoft Security Blog
The GitHub Blog
The GitHub Blog
I
InfoQ
Stack Overflow Blog
Stack Overflow Blog
云风的 BLOG
云风的 BLOG
Engineering at Meta
Engineering at Meta
MongoDB | Blog
MongoDB | Blog
月光博客
月光博客
T
Tailwind CSS Blog
M
MIT News - Artificial intelligence
Blog — PlanetScale
Blog — PlanetScale
Google DeepMind News
Google DeepMind News
腾讯CDC
罗磊的独立博客
U
Unit 42
爱范儿
爱范儿
Vercel News
Vercel News
MyScale Blog
MyScale Blog

博客园 - 泡泡

设置文件属性 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,表示对单种颜色透明