当前位置:网站首页>设置窗体透明 隐藏任务栏 与全屏显示
设置窗体透明 隐藏任务栏 与全屏显示
2022-07-04 15:44:00 【全栈程序员站长】
因为一种特别的需要 做了一个小程序主要三个功能
设置窗体透明
void CSetDlg::SetTransparent()
{
::SetWindowPos(m_hWnd,HWND_TOPMOST,0,0,0,0,SWP_NOSIZE|SWP_NOMOVE);//TopMost
SetWindowLong(this->GetSafeHwnd(),GWL_EXSTYLE,GetWindowLong(this->GetSafeHwnd(),GWL_EXSTYLE)^0x80000);
HINSTANCE hModule=LoadLibrary(“User32.DLL”);
if(hModule==NULL)
{
return;
}
typedef BOOL (WINAPI *FN_SetColor)(HWND,COLORREF,BYTE,DWORD);
FN_SetColor SetColor = NULL;
SetColor=(FN_SetColor)GetProcAddress(hModule,”SetLayeredWindowAttributes”);
if (SetColor==NULL)
{
return;
FreeLibrary(hModule);
}
SetColor(this->GetSafeHwnd(),0,50,2);
FreeLibrary(hModule);
}
全屏幕显示窗体
void CSetDlg::SetFullScreen()
{
LONG style = ::GetWindowLong(this->m_hWnd,GWL_STYLE);
style &= ~(WS_DLGFRAME | WS_THICKFRAME);
SetWindowLong(this->m_hWnd,GWL_STYLE, style);
this->ShowWindow(SW_SHOWMAXIMIZED);
CRect rect;
this->GetWindowRect(&rect);
::SetWindowPos(this->m_hWnd,HWND_NOTOPMOST,rect.left-1, rect.top-1, rect.right-rect.left + 3, rect.bottom-rect.top + 3, SWP_FRAMECHANGED);
}
隐藏任务栏
void CSetDlg::SetTaskBarHide()
{
::SetWindowLong(GetSafeHwnd(),GWL_EXSTYLE, WS_EX_TOOLWINDOW);
}
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/110768.html原文链接:https://javaforall.cn
边栏推荐
- What are cache penetration, cache breakdown, and cache avalanche
- VSCode修改缩进不成功,一保存就缩进四个空格
- [Acwing] 58周赛 4490. 染色
- 动态规划股票问题对比
- Capvision Rongying's prospectus in Hong Kong was "invalid": it was strictly questioned by the CSRC and required supplementary disclosure
- 防火墙基础透明模式部署和双机热备
- 开发者,MySQL专栏完更,助你轻松从安装到入门进阶
- 新的职业已经出现,怎么能够停滞不前 ,人社部公布建筑新职业
- 【模板】【luogu P4630】Duathlon 铁人两项(圆方树)
- ble HCI 流控机制
猜你喜欢

The Ministry of human resources and Social Security announced the new construction occupation

开发者,MySQL专栏完更,助你轻松从安装到入门进阶

世界环境日 | 周大福用心服务推动减碳环保

【测试开发】软件测试——基础篇

Smart Logistics Park supply chain management system solution: digital intelligent supply chain enables a new supply chain model for the logistics transportation industry

什么是低代码开发?

第十八届IET交直流輸電國際會議(ACDC2022)於線上成功舉辦

CocosCreator事件派发使用

C# 更加优质的操作MongoDB数据库

Zebras are recognized as dogs, and the reason for AI's mistakes is found by Stanford
随机推荐
Datakit -- the real unified observability agent
Cocoscreator event dispatch use
VMware Tools和open-vm-tools的安装与使用:解决虚拟机不全屏和无法传输文件的问题
Pytorch deep learning quick start tutorial
公司要上监控,Zabbix 和 Prometheus 怎么选?这么选准没错!
长城证券开户安全吗 证券账户怎么开通
Hidden corners of coder Edition: five things that developers hate most
第十八届IET交直流输电国际会议(ACDC2022)于线上成功举办
With an annual income of more than 8 million, he has five full-time jobs. He still has time to play games
祝贺Artefact首席数据科学家张鹏飞先生荣获 Campaign Asia Tech MVP 2022
安信证券手机版下载 网上开户安全吗
[Acwing] 58周赛 4489. 最长子序列
中信证券网上开户安全吗 开户收费吗
Go development: how to use go singleton mode to ensure the security of high concurrency of streaming media?
Spark 中的 Rebalance 操作以及与Repartition操作的区别
How to choose one plus 10 pro and iPhone 13?
[Acwing] 58周赛 4490. 染色
金额计算用 BigDecimal 就万无一失了?看看这五个坑吧~~
智慧物流园区供应链管理系统解决方案:数智化供应链赋能物流运输行业供应链新模式
居家打工年入800多万,一共五份全职工作,他还有时间打游戏