当前位置:网站首页>Window maximum and minimum settings
Window maximum and minimum settings
2022-07-03 10:03:00 【Master Hao】
void MainWindow::gShowHideTaskBar(BOOL bHide)
{
RECT rectWorkArea;
RECT rectTaskBar;
RECT Rect;
GetWindowRect(::FindWindow(L"Shell_TrayWnd",NULL), &Rect); // <<— Note &
//::GetWindowRect(::FindWindow(L"Shell_TrayWnd",NULL), rectTaskBar);
HWND hTask;
hTask = ::FindWindow(L"Shell_TrayWnd",NULL);
if( bHide )
{
// Hide the specified progress bar
SystemParametersInfo(SPI_GETWORKAREA,
0,
(LPVOID)&rectWorkArea,
0);
rectWorkArea.bottom+=Rect.bottom-Rect.top;
// Make sure the window handle is valid
if(hTask)
{
::ShowWindow(hTask,SW_HIDE);
// Reset mainwindow Window height
SystemParametersInfo(SPI_SETWORKAREA,
0,
(LPVOID)&rectWorkArea,
0);
GlobalParams::getInstance()->setMainWindowSize(rectWorkArea.right-rectWorkArea.left,rectWorkArea.bottom-rectWorkArea.top);
this->setFixedSize(rectWorkArea.right-rectWorkArea.left+1,rectWorkArea.bottom-rectWorkArea.top+1);
ui->maxButton->hide();
ui->minButton->hide();
ui->closeButton->hide();
}
}
else
{
// Display the specified progress bar
SystemParametersInfo(SPI_GETWORKAREA,
0,
(LPVOID)&rectWorkArea,
0);
if(hTask)
{
rectWorkArea.bottom-=Rect.bottom-Rect.top;
SystemParametersInfo(SPI_SETWORKAREA,
0,
(LPVOID)&rectWorkArea,
0);
this->showNormal();
::ShowWindow(hTask,SW_SHOW);
GlobalParams::getInstance()->setMainWindowSize(rectWorkArea.right-rectWorkArea.left,rectWorkArea.bottom-rectWorkArea.top);
// Maximize after normalization
this->setFixedSize(rectWorkArea.right-rectWorkArea.left,rectWorkArea.bottom-rectWorkArea.top);
ui->maxButton->show();
ui->minButton->show();
ui->closeButton->show();
}
}
}
边栏推荐
- 4G module designed by charging pile obtains signal strength and quality
- 2312、卖木头块 | 面试官与狂徒张三的那些事(leetcode,附思维导图 + 全部解法)
- Pymssql controls SQL for Chinese queries
- 我想各位朋友都应该知道学习的基本规律就是:从易到难
- 手机都算是单片机的一种,只不过它用的硬件不是51的芯片
- Comment la base de données mémoire joue - t - elle l'avantage de la mémoire?
- Open Euler Kernel Technology Sharing - Issue 1 - kdump Basic Principles, use and Case Introduction
- Synchronization control between tasks
- Which language should I choose to program for single chip microcomputer
- QT qcombobox QSS style settings
猜你喜欢
Education is a pass and ticket. With it, you can step into a higher-level environment
JS foundation - prototype prototype chain and macro task / micro task / event mechanism
03 FastJson 解决循环引用
Uniapp realizes global sharing of wechat applet and custom sharing button style
SCM career development: those who can continue to do it have become great people. If they can't endure it, they will resign or change their careers
It is difficult to quantify the extent to which a single-chip computer can find a job
There is no specific definition of embedded system
JS基础-原型原型链和宏任务/微任务/事件机制
Notes on C language learning of migrant workers majoring in electronic information engineering
51 MCU tmod and timer configuration
随机推荐
Project cost management__ Plan value_ Earned value_ Relationship among actual cost and Countermeasures
Stm32f407 key interrupt
Sending and interrupt receiving of STM32 serial port
Synchronization control between tasks
Design of charging pile mqtt transplantation based on 4G EC20 module
Google browser plug-in recommendation
Vscode markdown export PDF error
学历是一张通行证,门票,你有了它,可以踏入更高层次的环境里
Installation and removal of MySQL under Windows
Interruption system of 51 single chip microcomputer
Application of 51 single chip microcomputer timer
Gif image analysis drawing RGB to YUV table lookup method to reduce CPU occupancy
【力扣刷题笔记(二)】特别技巧,模块突破,45道经典题目分类总结,在不断巩固中精进
Project scope management__ Scope management plan and scope specification
单片机学到什么程度能找到工作,这个标准不好量化
Happy Dragon Boat Festival—— Zongzi written by canvas~~~~~
Which language should I choose to program for single chip microcomputer
Seven sorting of ten thousand words by hand (code + dynamic diagram demonstration)
Yocto technology sharing phase IV: customize and add software package support
要選擇那種語言為單片機編寫程序呢