当前位置:网站首页>设置窗体透明 隐藏任务栏 与全屏显示
设置窗体透明 隐藏任务栏 与全屏显示
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
边栏推荐
- Cocoscreator event dispatch use
- 7 RSA密码体制
- go-micro教程 — 第二章 go-micro v3 使用Gin、Etcd
- 【云原生】服务网格是什么“格”?
- Years of training, towards Kata 3.0! Enter the safe container experience out of the box | dragon lizard Technology
- 第十八届IET交直流輸電國際會議(ACDC2022)於線上成功舉辦
- The winning rate against people is 84%, and deepmind AI has reached the level of human experts in army chess for the first time
- 手里10万元存款买什么理财产品收益最高?
- Zhijieyun - meta universe comprehensive solution service provider
- 离线、开源版的 Notion—— 笔记软件Anytype 综合评测
猜你喜欢

【HCIA持续更新】广域网技术

Congratulations to Mr. Zhang Pengfei, chief data scientist of artefact, for winning the campaign Asia tech MVP 2022

How to choose one plus 10 pro and iPhone 13?

Blood spitting finishing nanny level series tutorial - play Fiddler bag grabbing tutorial (2) - first meet fiddler, let you have a rational understanding

居家打工年入800多万,一共五份全职工作,他还有时间打游戏

码农版隐秘的角落:作为开发者最讨厌的5件

Solution of dealer collaboration system in building materials industry: empowering enterprises to build core competitiveness

leetcode:421. The maximum XOR value of two numbers in the array

什么是低代码开发?

完美融入 Win11 风格,微软全新 OneDrive 客户端抢先看
随机推荐
Solution of commercial supply chain coordination system in the mineral industry: build a digital intelligent supply chain platform to ensure the safe supply of mineral resources
Blood spitting finishing nanny level series tutorial - play Fiddler bag grabbing tutorial (2) - first meet fiddler, let you have a rational understanding
【模板】【luogu P4630】Duathlon 铁人两项(圆方树)
居家打工年入800多万,一共五份全职工作,他还有时间打游戏
[unity ugui] scrollrect dynamically scales the grid size and automatically locates the middle grid
S2b2b solution for lighting industry: efficiently enable the industrial supply chain and improve the economic benefits of enterprises
Implementation of super large-scale warehouse clusters in large commercial banks
被PMP考试“折磨”出来的考试心得,值得你一览
防火墙基础透明模式部署和双机热备
DataKit——真正的统一可观测性 Agent
Load test practice of pingcode performance test
Vb无法访问数据库stocks
中银证券网上开户安全吗?
Oppo Xiaobu launched Obert, a large pre training model, and promoted to the top of kgclue
动态规划股票问题对比
Cocoscreator event dispatch use
Electronic pet dog - what is the internal structure?
Spark 中的 Rebalance 操作以及与Repartition操作的区别
KS007基于JSP实现人个人博客系统
太方便了,钉钉上就可完成代码发布审批啦!