-
August 12th, 2009, 03:11 PM
#1
Maximize hides task bar
Visual Studio 2008 pro
MFC Dialog app.
In OnInitDialog() I include the following lines:
ShowWindow(SW_SHOWDEFAULT);
ShowWindow(SW_MAXIMIZE);
This maximizes the window but it overwrites the task bar. How do I maximize the window of the app and still have the task bar visible ??
Thanks
Zapper
-
August 13th, 2009, 10:49 AM
#2
Re: Maximize hides task bar
This maximizes the window but it overwrites the task bar.
Not always. It depends on the properties of the task bar.
-
August 13th, 2009, 02:14 PM
#3
Re: Maximize hides task bar
If you are referring to the property "Keep the taskbar on top of other windows" that is selected and my app still "overwrites" it.
Zapper
-
August 16th, 2009, 03:12 PM
#4
Re: Maximize hides task bar
Ok I figured out what the deal was with this and I will put this up in case someone else runs into the same problem.
It seems that if you remove the maximize box and you use ShowWindow(SW_MAXIMIZE) your app will fill the screen, even overpainting the task bar, if you leave the maximize box in the project and use the same command, the taskbar will remain visible.
My issue was that I only wanted the app to run maximized AND still have the task bar visible without allowing the user access to a restore button.
You can accomplish this if you override the OnSysCommand. The app I was writing already included an OnSysCommand function to handle the About Box so I modified it like this and got the results I wanted.
Code:
void CMyApp::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
else
{
if(nID == SC_RESTORE){
if(IsIconic())
ShowWindow(SW_MAXIMIZE);
}else{
CDialog::OnSysCommand(nID, lParam);
}
}
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|