vc怎么让窗口全屏显示
我想要像游戏那样的全屏显示,最好是能改分辨率试了这个函数,效果不好,我用的1024*780的背景图,他全屏的时候成拼接的背景ModifyStyle(WS_CAPTION,...
我想要像游戏那样的全屏显示,最好是能改分辨率
试了这个函数,效果不好,我用的1024*780的背景图,他全屏的时候成拼接的背景
ModifyStyle(WS_CAPTION,0,0);
SendMessage(WM_SYSCOMMAND,SC_MAXIMIZE,0);
ShowWindow(SW_SHOWMAXIMIZED); 展开
试了这个函数,效果不好,我用的1024*780的背景图,他全屏的时候成拼接的背景
ModifyStyle(WS_CAPTION,0,0);
SendMessage(WM_SYSCOMMAND,SC_MAXIMIZE,0);
ShowWindow(SW_SHOWMAXIMIZED); 展开
1个回答
展开全部
void CXXXDlg::SetFullScreen()
{
int frameWidth = GetSystemMetrics(SM_CXFRAME);
int frameHeight = GetSystemMetrics(SM_CYFRAME);
int captionHeight = GetSystemMetrics(SM_CYCAPTION);
int screenWidth = GetSystemMetrics(SM_CXSCREEN);
int screenHeight = GetSystemMetrics(SM_CYSCREEN);
CRect rect;
GetClientRect(&rect);
rect.left = rect.left - frameWidth;
rect.top = rect.top - frameHeight - captionHeight ;
rect.bottom = rect.top + screenHeight + 2 * frameHeight + captionHeight;
rect.right = rect.left + screenWidth + 2 * frameWidth;
ShowWindow(SW_HIDE);
SetWindowPos(&wndTopMost, rect.left, rect.top, rect.Width(), rect.Height(), SWP_SHOWWINDOW);
}
lz试试吧
{
int frameWidth = GetSystemMetrics(SM_CXFRAME);
int frameHeight = GetSystemMetrics(SM_CYFRAME);
int captionHeight = GetSystemMetrics(SM_CYCAPTION);
int screenWidth = GetSystemMetrics(SM_CXSCREEN);
int screenHeight = GetSystemMetrics(SM_CYSCREEN);
CRect rect;
GetClientRect(&rect);
rect.left = rect.left - frameWidth;
rect.top = rect.top - frameHeight - captionHeight ;
rect.bottom = rect.top + screenHeight + 2 * frameHeight + captionHeight;
rect.right = rect.left + screenWidth + 2 * frameWidth;
ShowWindow(SW_HIDE);
SetWindowPos(&wndTopMost, rect.left, rect.top, rect.Width(), rect.Height(), SWP_SHOWWINDOW);
}
lz试试吧
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询