当前位置:网站首页>设置窗体透明 隐藏任务栏 与全屏显示
设置窗体透明 隐藏任务栏 与全屏显示
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
边栏推荐
- [template] [Luogu p4630] duathlon Triathlon (round square tree)
- Two methods of MD5 encryption
- Understand ThreadLocal in one picture
- Solution of dealer collaboration system in building materials industry: empowering enterprises to build core competitiveness
- Kunming Third Ring Road Closure project will pass through these places. Is there one near your home?
- 电子宠物小狗-内部结构是什么?
- Which domestic cloud management platform manufacturer is good in 2022? Why?
- VMware Tools和open-vm-tools的安装与使用:解决虚拟机不全屏和无法传输文件的问题
- 中银证券网上开户安全吗?
- Pytorch deep learning quick start tutorial
猜你喜欢
整理混乱的头文件,我用include what you use
2022PMP考试基本情况详情了解
CANN算子:利用迭代器高效实现Tensor数据切割分块处理
解决el-input输入框.number数字输入问题,去掉type=“number“后面箭头问题也可以用这种方法代替
【云原生】服务网格是什么“格”?
一加10 Pro和iPhone 13怎么选?
KS007基于JSP实现人个人博客系统
防火墙基础透明模式部署和双机热备
Perfectly integrated into win11 style, Microsoft's new onedrive client is the first to see
Understand ThreadLocal in one picture
随机推荐
Which domestic cloud management platform manufacturer is good in 2022? Why?
How to "use" Perl modules in directories that are not in @inc- How do I 'use' a Perl module in a directory not in @INC?
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
【Go ~ 0到1 】 第六天 文件的读写与创建
智慧物流園區供應鏈管理系統解决方案:數智化供應鏈賦能物流運輸行業供應鏈新模式
[Huawei HCIA continuous update] SDN and FVC
电子宠物小狗-内部结构是什么?
Understand ThreadLocal in one picture
【华为HCIA持续更新】SDN与FVC
《吐血整理》保姆级系列教程-玩转Fiddler抓包教程(2)-初识Fiddler让你理性认识一下
什么是低代码开发?
Redis 的内存淘汰策略和过期删除策略的区别
Load test practice of pingcode performance test
[template] [Luogu p4630] duathlon Triathlon (round square tree)
【测试开发】软件测试——基础篇
缓存穿透、缓存击穿、缓存雪崩分别是什么
La 18e Conférence internationale de l'IET sur le transport d'électricité en courant alternatif et en courant continu (acdc2022) s'est tenue avec succès en ligne.
矿产行业商业供应链协同系统解决方案:构建数智化供应链平台,保障矿产资源安全供应
利用win10计划任务程序定时自动运行jar包
金额计算用 BigDecimal 就万无一失了?看看这五个坑吧~~