当前位置:网站首页>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
边栏推荐
猜你喜欢
To sort out messy header files, I use include what you use
The Block:USDD增长势头强劲
How to choose one plus 10 pro and iPhone 13?
【测试开发】软件测试——基础篇
Zhijieyun - meta universe comprehensive solution service provider
Recast of recastnavigation
Ks007 realizes personal blog system based on JSP
离线、开源版的 Notion—— 笔记软件Anytype 综合评测
完美融入 Win11 风格,微软全新 OneDrive 客户端抢先看
Talk about seven ways to realize asynchronous programming
随机推荐
New technology releases a small program UNIPRO to meet customers' mobile office scenarios
Internet addiction changes brain structure: language function is affected, making people unable to speak neatly
长城证券开户安全吗 证券账户怎么开通
创业两年,一家小VC的自我反思
Using win10 scheduling task program to automatically run jar package at fixed time
To sort out messy header files, I use include what you use
Load test practice of pingcode performance test
TP configuring multiple databases
I2C子系统之适配器的设备接口分析(i2c-dev.c文件分析)
将Opencv绘制图片显示在MFC Picture Control控件上
Pytorch deep learning quick start tutorial
Hidden corners of coder Edition: five things that developers hate most
Web game engine
Superscalar processor design yaoyongbin Chapter 5 instruction set excerpt
一文掌握数仓中auto analyze的使用
High school physics: force, object and balance
如何进行MDM的产品测试
Blood spitting finishing nanny level series tutorial - play Fiddler bag grabbing tutorial (2) - first meet fiddler, let you have a rational understanding
Dynamic programming stock problem comparison
就在今天丨汇丰4位专家齐聚,共讨银行核心系统改造、迁移、重构难题