ShowWindow() problem - MFC
-
Hi guys, I need to show my dialog always at maximised. So I use
ShowWindow(SW_SHOWMAXIMIZED)
. The problem is that the window that is shown will be full screen and covers the taskbar, if MAXIMIZE BOX is disabled (Resource View -> uncheck MAXIMIZE BOX) Is there any way to show a maximised dialog with the taskbar still available when MAXIMIZE BOX is not included? Thanks -
Hi guys, I need to show my dialog always at maximised. So I use
ShowWindow(SW_SHOWMAXIMIZED)
. The problem is that the window that is shown will be full screen and covers the taskbar, if MAXIMIZE BOX is disabled (Resource View -> uncheck MAXIMIZE BOX) Is there any way to show a maximised dialog with the taskbar still available when MAXIMIZE BOX is not included? Thanks -
OnInitDialog(){ ....... CRect rc; CWnd* pWnd=GetDesktopWindow(); pWnd->GetWindowRect(rc); MoveWindow(0,0,rc.Width(), rc.Height(), TRUE); .... }
Is that all your needs?Thanks for the reply, I think you've misunderstood a bit. I want to show a maximised window that does NOT cover the taskbar area. You might want to try it yourself, have a dialog that the MAXIMIZED BOX is selected FALSE or is not ticked in the resource view. And place
ShowWindow(SW_SHOWMAXIMIZED)
inOnInitDialog
. In my system, that creates a maximised dialog window in full screen. Try to restore the MAXIMIZED BOX, the window is then maximised, with the taskbar still showing. I could somehow force it usingCRect deskRect; SystemParametersInfo(SPI_GETWORKAREA, NULL, &deskRect, 0); MoveWindow(&deskRect);
But this is not so great because the dialog is not in maxmised mode (where window borders are hidden) and also it's been fixed so if taskbar's size is later changed, the dialog window will still stay the same.
-
Thanks for the reply, I think you've misunderstood a bit. I want to show a maximised window that does NOT cover the taskbar area. You might want to try it yourself, have a dialog that the MAXIMIZED BOX is selected FALSE or is not ticked in the resource view. And place
ShowWindow(SW_SHOWMAXIMIZED)
inOnInitDialog
. In my system, that creates a maximised dialog window in full screen. Try to restore the MAXIMIZED BOX, the window is then maximised, with the taskbar still showing. I could somehow force it usingCRect deskRect; SystemParametersInfo(SPI_GETWORKAREA, NULL, &deskRect, 0); MoveWindow(&deskRect);
But this is not so great because the dialog is not in maxmised mode (where window borders are hidden) and also it's been fixed so if taskbar's size is later changed, the dialog window will still stay the same.
-
Thanks Dreamz, OnSizing() handler in my app isn't be able detect resizing of other applications, including the taskbar. I tried anyway, it won't resize.
-
Dont know whether i missed something.But i was talking about the Dialog Properties->Border->Resizing
-
Thanks Dreamz, that's in fact the solution for me :) That was not difficult at all. Thanks again