Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
View all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
hongleng
baiduCDP
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
master
Breadcrumbs
baiduCDP
/
shadow_window.h
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
55 lines (41 loc) · 1.5 KB
master
Breadcrumbs
baiduCDP
/
shadow_window.h
Copy path
Top
File metadata and controls
Code
Blame
55 lines (41 loc) · 1.5 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#pragma once
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
// 阴影窗口接口
struct ShadowWnd {
virtual void Setup(int size, int sharpness, int darkness, int offset) = 0;
virtual void Update() = 0;
};
// 创建一个阴影窗口,对目标窗口进行绑定,返回一个接口(无须释放, 生命期与目标窗口同步)
// 注:强制拦截WM_NCCALCSIZE消息,使之不绘制边框和标题栏
ShadowWnd* BindShadowWindow(HWND hwnd_dest);
// 删除绑定的阴影窗口
void UnbindShadowWindow(HWND hwnd_dest);
// 获取绑定的阴影窗口,在运行期,应使用GetShadowWindow()获取相关的阴影对象,且判断是否为空
ShadowWnd* GetShadowWindow(HWND hwnd_dest);
// 启用DWM窗口管理器自带的阴影特效
// 前提: 样式: WS_THICKFRAME, IsCompositionActive(), 以及拦截WM_NCCALESIZE消息
// 如果指定force_hook, 则强制修改样式,以及拦截WM_NCCALESIZE消息, 否则请确保目标窗口已满足前提
int EnableDwmShadow(HWND hwnd, int enable, int force_hook = 1);
// 适用于 XP/Win7经典主题,产生一个右下方阴影特效。 适用于overlapped window
// CS_DROPSHADOW
int EnableStyleShadow(HWND hwnd, int enable);
// 如果支持DWM,则使用 EnableDwmShadow()来开启阴影。
int IsSupportDwm();
// 生成一个带alpha通道的阴影图像
// width,height 矩形大小,以此矩形往外扩展阴影
// size: -20 ~ +20 阴影宽度
// sharpness: 渐变, 0-20, 0为不渐变
// darkness: 色调,最大0-255, 越大越黑
// color: 颜色, 0为黑色
// offset: 偏移, -20 ~ +20 若指定,为右下两个方向, 否则为四周
// rgn: 形状
HBITMAP MakeShadowImage(
int width,
int height,
int size = 10,
int sharpness = 20,
int darkness = 30,
COLORREF color = 0,
int offset = 0,
HRGN rgn = 0);
You can’t perform that action at this time.