当前位置:网站首页>设置窗体透明 隐藏任务栏 与全屏显示
设置窗体透明 隐藏任务栏 与全屏显示
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
边栏推荐
- PingCode 性能测试之负载测试实践
- Leetcode list summary
- Smart Logistics Park supply chain management system solution: digital intelligent supply chain enables a new supply chain model for the logistics transportation industry
- 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?
- 【模板】【luogu P4630】Duathlon 铁人两项(圆方树)
- 【华为HCIA持续更新】SDN与FVC
- Rebalance operation in spark and its difference from repartition operation
- Display opencv drawn pictures on MFC picture control control
- Using win10 scheduling task program to automatically run jar package at fixed time
- 上网成瘾改变大脑结构:语言功能受影响,让人话都说不利索
猜你喜欢
wuzhicms代码审计
【HCIA持续更新】广域网技术
【Unity UGUI】ScrollRect 动态缩放格子大小,自动定位到中间的格子
To sort out messy header files, I use include what you use
Yanwen logistics plans to be listed on Shenzhen Stock Exchange: it is mainly engaged in international express business, and its gross profit margin is far lower than the industry level
电子宠物小狗-内部结构是什么?
《吐血整理》保姆级系列教程-玩转Fiddler抓包教程(2)-初识Fiddler让你理性认识一下
Cann operator: using iterators to efficiently realize tensor data cutting and blocking processing
go-micro教程 — 第二章 go-micro v3 使用Gin、Etcd
智慧物流園區供應鏈管理系統解决方案:數智化供應鏈賦能物流運輸行業供應鏈新模式
随机推荐
CocosCreator事件派發使用
【HCIA持续更新】WLAN概述与基本概念
Years of training, towards Kata 3.0! Enter the safe container experience out of the box | dragon lizard Technology
Summary of tx.origin security issues
Internet addiction changes brain structure: language function is affected, making people unable to speak neatly
新的职业已经出现,怎么能够停滞不前 ,人社部公布建筑新职业
将Opencv绘制图片显示在MFC Picture Control控件上
Blood spitting finishing nanny level series tutorial - play Fiddler bag grabbing tutorial (2) - first meet fiddler, let you have a rational understanding
Leetcode list summary
MD5加密的两种方式
网页游戏引擎
Rebalance operation in spark and its difference from repartition operation
R language plot visualization: plot visualizes overlapping histograms and uses geom at the top edge of the histogram_ The rug function adds marginal rug plots
Solution of dealer collaboration system in building materials industry: empowering enterprises to build core competitiveness
容器环境minor gc异常频繁分析
长城证券安全不 证券开户
【华为HCIA持续更新】SDN与FVC
【云原生】服务网格是什么“格”?
Image retrieval
被PMP考试“折磨”出来的考试心得,值得你一览