当前位置:网站首页>Set the transparent hidden taskbar and full screen display of the form
Set the transparent hidden taskbar and full screen display of the form
2022-07-04 17:44:00 【Full stack programmer webmaster】
Because of a special need Made a small program with three main functions
Set form transparency
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);
}
Full screen display form
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);
}
Hide taskbar
void CSetDlg::SetTaskBarHide()
{
::SetWindowLong(GetSafeHwnd(),GWL_EXSTYLE, WS_EX_TOOLWINDOW);
}
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/110768.html Link to the original text :https://javaforall.cn
边栏推荐
猜你喜欢
Internet addiction changes brain structure: language function is affected, making people unable to speak neatly
Interpretation of data security governance capability evaluation framework 2.0, the fourth batch of DSG evaluation collection
RecastNavigation 之 Recast
PingCode 性能测试之负载测试实践
The Ministry of human resources and Social Security announced the new construction occupation
Difference between redis' memory obsolescence strategy and expiration deletion strategy
OPPO小布推出预训练大模型OBERT,晋升KgCLUE榜首
PingCode 性能测试之负载测试实践
雨量预警广播自动化数据平台BWII 型广播预警监测仪
CocosCreator事件派发使用
随机推荐
Zhijieyun - meta universe comprehensive solution service provider
国产数据库TiDB初体验:简单易用,快速上手
Hidden corners of coder Edition: five things that developers hate most
创业两年,一家小VC的自我反思
[unity ugui] scrollrect dynamically scales the grid size and automatically locates the middle grid
MVC模式和三层架构
第十八届IET交直流輸電國際會議(ACDC2022)於線上成功舉辦
PingCode 性能测试之负载测试实践
TP configuring multiple databases
Blood spitting finishing nanny level series tutorial - play Fiddler bag grabbing tutorial (2) - first meet fiddler, let you have a rational understanding
High school physics: force, object and balance
NFT流动性市场安全问题频发—NFT交易平台Quixotic被黑事件分析
Wuzhicms code audit
Win32 API access route encrypted web pages
如何进行MDM的产品测试
超标量处理器设计 姚永斌 第6章 指令解码 摘录
KS007基于JSP实现人个人博客系统
长城证券开户安全吗 证券账户怎么开通
Perfectly integrated into win11 style, Microsoft's new onedrive client is the first to see
Pytorch deep learning quick start tutorial