Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. ShowWindow() problem - MFC

ShowWindow() problem - MFC

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestionlearning
8 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    J B 0
    wrote on last edited by
    #1

    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

    N 1 Reply Last reply
    0
    • J J B 0

      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

      N Offline
      N Offline
      nguyenvhn
      wrote on last edited by
      #2

      OnInitDialog(){ ....... CRect rc; CWnd* pWnd=GetDesktopWindow(); pWnd->GetWindowRect(rc); MoveWindow(0,0,rc.Width(), rc.Height(), TRUE); .... } Is that all your needs?

      J 1 Reply Last reply
      0
      • N nguyenvhn

        OnInitDialog(){ ....... CRect rc; CWnd* pWnd=GetDesktopWindow(); pWnd->GetWindowRect(rc); MoveWindow(0,0,rc.Width(), rc.Height(), TRUE); .... } Is that all your needs?

        J Offline
        J Offline
        J B 0
        wrote on last edited by
        #3

        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) in OnInitDialog. 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 using

        CRect 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.

        D 1 Reply Last reply
        0
        • J J B 0

          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) in OnInitDialog. 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 using

          CRect 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.

          D Offline
          D Offline
          Dreamz
          wrote on last edited by
          #4

          Try it with Border Resizing

          J 1 Reply Last reply
          0
          • D Dreamz

            Try it with Border Resizing

            J Offline
            J Offline
            J B 0
            wrote on last edited by
            #5

            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.

            D 1 Reply Last reply
            0
            • J J B 0

              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.

              D Offline
              D Offline
              Dreamz
              wrote on last edited by
              #6

              Dont know whether i missed something.But i was talking about the Dialog Properties->Border->Resizing

              J 1 Reply Last reply
              0
              • D Dreamz

                Dont know whether i missed something.But i was talking about the Dialog Properties->Border->Resizing

                J Offline
                J Offline
                J B 0
                wrote on last edited by
                #7

                Thanks Dreamz, that's in fact the solution for me :) That was not difficult at all. Thanks again

                D 1 Reply Last reply
                0
                • J J B 0

                  Thanks Dreamz, that's in fact the solution for me :) That was not difficult at all. Thanks again

                  D Offline
                  D Offline
                  Dreamz
                  wrote on last edited by
                  #8

                  Welcome :) Glad to know it helped you.

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups