CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    May 1999
    Location
    Farnborough, Hants, England
    Posts
    710

    Desktop Size Minus Bars

    I seem to remember somewhere a call to find out the size of the desktop excluding the task bar and any bars such as Microsoft Office - but I can't remember or find it. Anyone know? Or how to get the size of a window if it was maximised (same effect)?

    --
    Jason Teagle
    [email protected]

  2. #2
    Join Date
    May 1999
    Posts
    116

    Re: Desktop Size Minus Bars

    RECT rectWorkArea;
    SystemParametersInfo(SPI_GETWORKAREA, 0, &rectWorkArea, 0);


    will the the size of the screen minus any registered appbars (e.g. OfficeBar) and taskbars.


  3. #3
    Join Date
    Apr 1999
    Posts
    27,449

    Re: Desktop Size Minus Bars

    Capture the WM_GETMINMAXINFO message, or if you use MFC, add ON_WM_GETMINMAXINFO to the message map with the call to OnGetMinMaxInfo()

    Regards,

    Paul McKenzie


  4. #4
    Join Date
    May 1999
    Location
    Farnborough, Hants, England
    Posts
    710

    Re: Desktop Size Minus Bars

    Thanks for your reply. But this only allows me to dictate the maximum or minimum size of my window, doesn't it? How can I trap this for the desktop? I want to know how big to create a window (which is NOT maximised, but takes up all available space) but without overlapping the taskbar.

    --
    Jason Teagle
    [email protected]

  5. #5
    Join Date
    May 1999
    Location
    Farnborough, Hants, England
    Posts
    710

    Way Cool!!!

    Thanks for your reply. Not only does it work in 32-bit, but if I use the defined value (48) instead of the symbol (SPI_GETWORKAREA), I can use it from 16-bit code on 32-bit systems! Brilliant!

    --
    Jason Teagle
    [email protected]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured